Re: [PATCH net-next 3/9] IB/ipoib: Add support for acting as VIF
From: Eric Dumazet <hidden>
Date: 2012-07-10 12:26:26
On Tue, 2012-07-10 at 15:16 +0300, Or Gerlitz wrote:
From: Erez Shitrit <redacted> When IPoIB interface acts as a VIF for an eIPoIB interface, it uses the skb cb storage area on the RX flow, to place information which can be of use to the upper layer device. One such usage example, is when an eIPoIB inteface needs to generate a source mac for incoming Ethernet frames. The IPoIB code checks the VIF private flag on the RX path, and accoriding to the value of the flag prepares the skb CB data, etc.
...
quoted hunk ↗ jump to hunk
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index 5c1bc99..da28799 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c@@ -300,7 +300,13 @@ static void ipoib_ib_handle_rx_wc(struct net_device *dev, struct ib_wc *wc) likely(wc->wc_flags & IB_WC_IP_CSUM_OK)) skb->ip_summed = CHECKSUM_UNNECESSARY; - napi_gro_receive(&priv->napi, skb); + /* if handler is registered on top of ipoib, set skb oob data */ + if (dev->priv_flags & IFF_EIPOIB_VIF) { + set_skb_oob_cb_data(skb, wc, &priv->napi); + /* the registered handler will take care of the skb */ + netif_receive_skb(skb); + } else + napi_gro_receive(&priv->napi, skb);
skb->cb[] can be destroyed in netif_receive_skb() / __netif_receive_skb() #ifdef CONFIG_NET_CLS_ACT skb = handle_ing(skb, &pt_prev, &ret, orig_dev); ... #endif