summaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bonding.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2014-10-31 19:47:54 +0100
committerDavid S. Miller <davem@davemloft.net>2014-10-31 21:09:03 +0100
commit31aa860e0aafd3a7c5a31c2aae67b6534115ea41 (patch)
treec0b1a357f1e77cb493b77ccf8b1048f604a690d7 /drivers/net/bonding/bonding.h
parentMerge branch 'sunvnet-multi-tx-queue' (diff)
downloadlinux-31aa860e0aafd3a7c5a31c2aae67b6534115ea41.tar.xz
linux-31aa860e0aafd3a7c5a31c2aae67b6534115ea41.zip
bonding: add bond_tx_drop() helper
Because bonding stats are usually sum of slave stats, it was not easy to account for tx drops at bonding layer. We can use dev->tx_dropped for this, as this counter is later added to the device stats (in dev_get_stats()) This extends the idea we had in commit ee6377147409a ("bonding: Simplify the xmit function for modes that use xmit_hash") for bond_3ad_xor_xmit() to other bonding modes. Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Mahesh Bandewar <maheshb@google.com> Reviewed-by: Nikolay Aleksandrov <nikolay@redhat.com> Acked-by: Mahesh Bandewar <maheshb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bonding.h')
-rw-r--r--drivers/net/bonding/bonding.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 10920f0686e2..bfb0b51c081a 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -645,4 +645,10 @@ extern struct bond_parm_tbl ad_select_tbl[];
/* exported from bond_netlink.c */
extern struct rtnl_link_ops bond_link_ops;
+static inline void bond_tx_drop(struct net_device *dev, struct sk_buff *skb)
+{
+ atomic_long_inc(&dev->tx_dropped);
+ dev_kfree_skb_any(skb);
+}
+
#endif /* _LINUX_BONDING_H */