Commit 4d4ac1b0 authored by dingtianhong's avatar dingtianhong Committed by David S. Miller

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: default avatarDing Tianhong <dingtianhong@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a742e1f5
...@@ -1371,7 +1371,6 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev) ...@@ -1371,7 +1371,6 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
int do_tx_balance = 1; int do_tx_balance = 1;
u32 hash_index = 0; u32 hash_index = 0;
const u8 *hash_start = NULL; const u8 *hash_start = NULL;
int res = 1;
struct ipv6hdr *ip6hdr; struct ipv6hdr *ip6hdr;
skb_reset_mac_header(skb); skb_reset_mac_header(skb);
...@@ -1469,7 +1468,8 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev) ...@@ -1469,7 +1468,8 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
ETH_ALEN); ETH_ALEN);
} }
res = bond_dev_queue_xmit(bond, skb, tx_slave->dev); bond_dev_queue_xmit(bond, skb, tx_slave->dev);
goto out;
} else { } else {
if (tx_slave) { if (tx_slave) {
_lock_tx_hashtbl(bond); _lock_tx_hashtbl(bond);
...@@ -1478,11 +1478,9 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev) ...@@ -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 */
/* no suitable interface, frame not sent */ kfree_skb(skb);
kfree_skb(skb); out:
}
return NETDEV_TX_OK; return NETDEV_TX_OK;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment