Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 314497
b: refs/heads/master
c: 596e202
h: refs/heads/master
i:
  314495: f33d7ae
v: v3
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Jun 19, 2012
1 parent 45cd608 commit de5871b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5149ee58385bdfef260fb07a89a8ff0913be6b25
refs/heads/master: 596e2024c42159fedf71b3d17fba78eed9b5bf10
23 changes: 16 additions & 7 deletions trunk/drivers/net/team/team_mode_loadbalance.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,27 @@ static struct lb_priv *lb_priv(struct team *team)
return (struct lb_priv *) &team->mode_priv;
}

static bool lb_transmit(struct team *team, struct sk_buff *skb)
static unsigned char lb_get_skb_hash(struct lb_priv *lb_priv,
struct sk_buff *skb)
{
struct sk_filter *fp;
uint32_t lhash;
unsigned char *c;

fp = rcu_dereference(lb_priv->fp);
if (unlikely(!fp))
return 0;
lhash = SK_RUN_FILTER(fp, skb);
c = (char *) &lhash;
return c[0] ^ c[1] ^ c[2] ^ c[3];
}

static bool lb_transmit(struct team *team, struct sk_buff *skb)
{
struct team_port *port;
unsigned int hash;
int port_index;

fp = rcu_dereference(lb_priv(team)->fp);
if (unlikely(!fp))
goto drop;
hash = SK_RUN_FILTER(fp, skb);
port_index = hash % team->en_port_count;
port_index = lb_get_skb_hash(lb_priv(team), skb) % team->en_port_count;
port = team_get_port_by_index_rcu(team, port_index);
if (unlikely(!port))
goto drop;
Expand Down

0 comments on commit de5871b

Please sign in to comment.