]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
IB/ipoib: Update RX counters after ACL filtering
authorYuval Shaia <yuval.shaia@oracle.com>
Thu, 6 Sep 2018 11:12:38 +0000 (04:12 -0700)
committerBrian Maly <brian.maly@oracle.com>
Wed, 26 Sep 2018 00:29:45 +0000 (20:29 -0400)
There is no reason to update RX counters if packet will be dropped in
IB-ACL filtering.

Orabug: 28655409

Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Reviewed-by: HÃ¥kon Bugge <haakon.bugge@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/infiniband/ulp/ipoib/ipoib_ib.c

index 11456e2d68e240e6b9e109e63e9de607ee7d501f..406f07b4b6da76e49b0b19adbaec8a9b4d86c7ce 100644 (file)
@@ -284,9 +284,6 @@ static void ipoib_ib_handle_rx_wc(struct net_device *dev, struct ib_wc *wc)
 
        skb->truesize = SKB_TRUESIZE(skb->len);
 
-       ++dev->stats.rx_packets;
-       dev->stats.rx_bytes += skb->len;
-
        if (unlikely(be16_to_cpu(skb->protocol) == ETH_P_ARP)) {
                if (priv->acl.enabled) {
                        subnet_prefix = be64_to_cpu(sgid->global.subnet_prefix);
@@ -312,6 +309,9 @@ static void ipoib_ib_handle_rx_wc(struct net_device *dev, struct ib_wc *wc)
                        goto drop;
                }
 
+       ++dev->stats.rx_packets;
+       dev->stats.rx_bytes += skb->len;
+
        skb_push(skb, IPOIB_ENCAP_LEN);
        skb_add_pseudo_hdr(skb);