From: Yuval Shaia Date: Thu, 6 Sep 2018 11:11:16 +0000 (-0700) Subject: IB/ipoib: Filter RX packets before adding pseudo header X-Git-Tag: v4.1.12-124.31.3~525 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=8ad25f0efa03f49013df3e5114c3dc75373d3f9d;p=users%2Fjedix%2Flinux-maple.git IB/ipoib: Filter RX packets before adding pseudo header IB-ACL filtering is based on SGID (carried in the GRH). The function skb_add_pseudo_hdr clears the SGID from the header. Doing filtering after this call has no effect since all packets will drop for not having SGID in. Fix this by moving the call to skb_add_pseudo_hdr to be after IB-ACL filtering while still adjusting skb->data as needed for the filtering. Orabug: 28655409 Signed-off-by: Yuval Shaia Reviewed-by: HÃ¥kon Bugge Signed-off-by: Brian Maly --- diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index 974eeb9fcd295..11456e2d68e24 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c @@ -280,7 +280,7 @@ static void ipoib_ib_handle_rx_wc(struct net_device *dev, struct ib_wc *wc) skb_pull(skb, IB_GRH_BYTES); skb->protocol = ((struct ipoib_header *) skb->data)->proto; - skb_add_pseudo_hdr(skb); + skb_pull(skb, IPOIB_ENCAP_LEN); skb->truesize = SKB_TRUESIZE(skb->len); @@ -312,6 +312,9 @@ static void ipoib_ib_handle_rx_wc(struct net_device *dev, struct ib_wc *wc) goto drop; } + skb_push(skb, IPOIB_ENCAP_LEN); + skb_add_pseudo_hdr(skb); + skb->dev = dev; if ((dev->features & NETIF_F_RXCSUM) && likely(wc->wc_flags & IB_WC_IP_CSUM_OK))