diff options
author | Alex Vesker <valex@mellanox.com> | 2017-07-10 11:12:43 -0400 |
---|---|---|
committer | Leon Romanovsky <leon@kernel.org> | 2017-07-23 02:45:11 -0400 |
commit | 4829d964dfb027558c732cfa0d13b716ab3f0838 (patch) | |
tree | cd3c58cd9cc96a0478587db10f5a48a38a4927b7 | |
parent | d2e46fccc3e3d73a741efe433f00960331280696 (diff) |
IB/ipoib: Add multicast packets statistics
Update the multicast counter when multicast packets are received and
provide this information through ethtool support.
Signed-off-by: Alex Vesker <valex@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_ethtool.c | 3 | ||||
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_ib.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c b/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c index 7871379342f4..184a22f48027 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c | |||
@@ -52,7 +52,8 @@ static const struct ipoib_stats ipoib_gstrings_stats[] = { | |||
52 | IPOIB_NETDEV_STAT(tx_bytes), | 52 | IPOIB_NETDEV_STAT(tx_bytes), |
53 | IPOIB_NETDEV_STAT(tx_errors), | 53 | IPOIB_NETDEV_STAT(tx_errors), |
54 | IPOIB_NETDEV_STAT(rx_dropped), | 54 | IPOIB_NETDEV_STAT(rx_dropped), |
55 | IPOIB_NETDEV_STAT(tx_dropped) | 55 | IPOIB_NETDEV_STAT(tx_dropped), |
56 | IPOIB_NETDEV_STAT(multicast), | ||
56 | }; | 57 | }; |
57 | 58 | ||
58 | #define IPOIB_GLOBAL_STATS_LEN ARRAY_SIZE(ipoib_gstrings_stats) | 59 | #define IPOIB_GLOBAL_STATS_LEN ARRAY_SIZE(ipoib_gstrings_stats) |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index 57a9655e844d..02eda1f53a67 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c | |||
@@ -256,6 +256,8 @@ static void ipoib_ib_handle_rx_wc(struct net_device *dev, struct ib_wc *wc) | |||
256 | 256 | ||
257 | ++dev->stats.rx_packets; | 257 | ++dev->stats.rx_packets; |
258 | dev->stats.rx_bytes += skb->len; | 258 | dev->stats.rx_bytes += skb->len; |
259 | if (skb->pkt_type == PACKET_MULTICAST) | ||
260 | dev->stats.multicast++; | ||
259 | 261 | ||
260 | skb->dev = dev; | 262 | skb->dev = dev; |
261 | if ((dev->features & NETIF_F_RXCSUM) && | 263 | if ((dev->features & NETIF_F_RXCSUM) && |