Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bd7d2106 authored by Jim Hanko's avatar Jim Hanko Committed by David S. Miller
Browse files

team: fall back to hash if table entry is empty



If the hash to port mapping table does not have a valid port (i.e. when
a port goes down), fall back to the simple hashing mechanism to avoid
dropping packets.

Signed-off-by: default avatarJim Hanko <hanko@drivescale.com>
Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d3b55771
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -137,7 +137,13 @@ static struct team_port *lb_htpm_select_tx_port(struct team *team,
						struct sk_buff *skb,
						unsigned char hash)
{
	return rcu_dereference_bh(LB_HTPM_PORT_BY_HASH(lb_priv, hash));
	struct team_port *port;

	port = rcu_dereference_bh(LB_HTPM_PORT_BY_HASH(lb_priv, hash));
	if (likely(port))
		return port;
	/* If no valid port in the table, fall back to simple hash */
	return lb_hash_select_tx_port(team, lb_priv, skb, hash);
}

struct lb_select_tx_port {