diff options
author | dingtianhong <dingtianhong@huawei.com> | 2014-03-25 05:00:09 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-03-26 16:40:24 -0400 |
commit | 054bb8801038c93c42cb6cde75141aa396afd065 (patch) | |
tree | 825cf25616cca0b1959c2a81e58abdfdb20b8cb1 /drivers/net | |
parent | 7aceb47a9df3383b24824c3e4bd4f029e4598fda (diff) |
bonding: slight optimization for bond xmit path
Add unlikely() micro to the unlikely conditions in the bond
xmit path for slight optimization.
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index e717db301d46..ee17c246326e 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -2957,7 +2957,7 @@ static bool bond_flow_dissect(struct bonding *bond, struct sk_buff *skb, | |||
2957 | fk->ports = 0; | 2957 | fk->ports = 0; |
2958 | noff = skb_network_offset(skb); | 2958 | noff = skb_network_offset(skb); |
2959 | if (skb->protocol == htons(ETH_P_IP)) { | 2959 | if (skb->protocol == htons(ETH_P_IP)) { |
2960 | if (!pskb_may_pull(skb, noff + sizeof(*iph))) | 2960 | if (unlikely(!pskb_may_pull(skb, noff + sizeof(*iph)))) |
2961 | return false; | 2961 | return false; |
2962 | iph = ip_hdr(skb); | 2962 | iph = ip_hdr(skb); |
2963 | fk->src = iph->saddr; | 2963 | fk->src = iph->saddr; |
@@ -2966,7 +2966,7 @@ static bool bond_flow_dissect(struct bonding *bond, struct sk_buff *skb, | |||
2966 | if (!ip_is_fragment(iph)) | 2966 | if (!ip_is_fragment(iph)) |
2967 | proto = iph->protocol; | 2967 | proto = iph->protocol; |
2968 | } else if (skb->protocol == htons(ETH_P_IPV6)) { | 2968 | } else if (skb->protocol == htons(ETH_P_IPV6)) { |
2969 | if (!pskb_may_pull(skb, noff + sizeof(*iph6))) | 2969 | if (unlikely(!pskb_may_pull(skb, noff + sizeof(*iph6)))) |
2970 | return false; | 2970 | return false; |
2971 | iph6 = ipv6_hdr(skb); | 2971 | iph6 = ipv6_hdr(skb); |
2972 | fk->src = (__force __be32)ipv6_addr_hash(&iph6->saddr); | 2972 | fk->src = (__force __be32)ipv6_addr_hash(&iph6->saddr); |
@@ -3768,7 +3768,7 @@ static netdev_tx_t bond_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
3768 | * If we risk deadlock from transmitting this in the | 3768 | * If we risk deadlock from transmitting this in the |
3769 | * netpoll path, tell netpoll to queue the frame for later tx | 3769 | * netpoll path, tell netpoll to queue the frame for later tx |
3770 | */ | 3770 | */ |
3771 | if (is_netpoll_tx_blocked(dev)) | 3771 | if (unlikely(is_netpoll_tx_blocked(dev))) |
3772 | return NETDEV_TX_BUSY; | 3772 | return NETDEV_TX_BUSY; |
3773 | 3773 | ||
3774 | rcu_read_lock(); | 3774 | rcu_read_lock(); |