Skip to content

Commit 5a6b991

Browse files
committed
Merge branch 'bonding-next'
Ding Tianhong says: ==================== bonding: slight optimization and avoid spam for bond xmit path v1->v2: Add ratelimit for debugging is not a good idea, it will miss some message if the user turns the debugging on, so remove the patch 3. use net_err_ratelimited instead of pr_err_ratelimited and use __func__ instead of bond_xmit_broadcast(). ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 7aceb47 + 9152e26 commit 5a6b991

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/net/bonding/bond_main.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2957,7 +2957,7 @@ static bool bond_flow_dissect(struct bonding *bond, struct sk_buff *skb,
29572957
fk->ports = 0;
29582958
noff = skb_network_offset(skb);
29592959
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))))
29612961
return false;
29622962
iph = ip_hdr(skb);
29632963
fk->src = iph->saddr;
@@ -2966,7 +2966,7 @@ static bool bond_flow_dissect(struct bonding *bond, struct sk_buff *skb,
29662966
if (!ip_is_fragment(iph))
29672967
proto = iph->protocol;
29682968
} 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))))
29702970
return false;
29712971
iph6 = ipv6_hdr(skb);
29722972
fk->src = (__force __be32)ipv6_addr_hash(&iph6->saddr);
@@ -3656,8 +3656,8 @@ static int bond_xmit_broadcast(struct sk_buff *skb, struct net_device *bond_dev)
36563656
struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC);
36573657

36583658
if (!skb2) {
3659-
pr_err("%s: Error: bond_xmit_broadcast(): skb_clone() failed\n",
3660-
bond_dev->name);
3659+
net_err_ratelimited("%s: Error: %s: skb_clone() failed\n",
3660+
bond_dev->name, __func__);
36613661
continue;
36623662
}
36633663
/* bond_dev_queue_xmit always returns 0 */
@@ -3768,7 +3768,7 @@ static netdev_tx_t bond_start_xmit(struct sk_buff *skb, struct net_device *dev)
37683768
* If we risk deadlock from transmitting this in the
37693769
* netpoll path, tell netpoll to queue the frame for later tx
37703770
*/
3771-
if (is_netpoll_tx_blocked(dev))
3771+
if (unlikely(is_netpoll_tx_blocked(dev)))
37723772
return NETDEV_TX_BUSY;
37733773

37743774
rcu_read_lock();

0 commit comments

Comments
 (0)