diff options
author | dingtianhong <dingtianhong@huawei.com> | 2014-01-02 09:13:02 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-01 22:58:15 -0500 |
commit | 4d4ac1b0927c046413f0e92c38a833335a2d7590 (patch) | |
tree | b800d7eb245e17405bdb71462631ecdcfb98a56e /drivers | |
parent | a742e1f545c38efb769bd02b91f11b1c9acb6e56 (diff) |
bonding: slight optimization for bond_alb_xmit()
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 <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/bonding/bond_alb.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index 759ddeebe390..a2c47476804d 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c @@ -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); @@ -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); @@ -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; } |