Skip to content

Commit

Permalink
bonding: slight optimization for bond_alb_xmit()
Browse files Browse the repository at this point in the history
The bond_alb_xmit will check the return value for
bond_dev_queue_xmit() every time, but the bond_dev_queue_xmit()
is always return 0, it is no need to check the value every time,
so remove the unneed judgement for the xmit path.

Signed-off-by: Ding Tianhong <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
dingtianhong authored and davem330 committed Jan 2, 2014
1 parent a742e1f commit 4d4ac1b
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions drivers/net/bonding/bond_alb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,6 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
int do_tx_balance = 1;
u32 hash_index = 0;
const u8 *hash_start = NULL;
int res = 1;
struct ipv6hdr *ip6hdr;

skb_reset_mac_header(skb);
Expand Down Expand Up @@ -1469,7 +1468,8 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
ETH_ALEN);
}

res = bond_dev_queue_xmit(bond, skb, tx_slave->dev);
bond_dev_queue_xmit(bond, skb, tx_slave->dev);
goto out;
} else {
if (tx_slave) {
_lock_tx_hashtbl(bond);
Expand All @@ -1478,11 +1478,9 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
}
}

if (res) {
/* no suitable interface, frame not sent */
kfree_skb(skb);
}

/* no suitable interface, frame not sent */
kfree_skb(skb);
out:
return NETDEV_TX_OK;
}

Expand Down

0 comments on commit 4d4ac1b

Please sign in to comment.