aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/ipoib/ipoib_ib.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/ulp/ipoib/ipoib_ib.c')
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_ib.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
index 8404f05b2b6e..10944888cffd 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
@@ -197,6 +197,13 @@ static void ipoib_ib_handle_rx_wc(struct net_device *dev, struct ib_wc *wc)
197 } 197 }
198 198
199 /* 199 /*
200 * Drop packets that this interface sent, ie multicast packets
201 * that the HCA has replicated.
202 */
203 if (wc->slid == priv->local_lid && wc->src_qp == priv->qp->qp_num)
204 goto repost;
205
206 /*
200 * If we can't allocate a new RX buffer, dump 207 * If we can't allocate a new RX buffer, dump
201 * this packet and reuse the old buffer. 208 * this packet and reuse the old buffer.
202 */ 209 */
@@ -213,24 +220,18 @@ static void ipoib_ib_handle_rx_wc(struct net_device *dev, struct ib_wc *wc)
213 skb_put(skb, wc->byte_len); 220 skb_put(skb, wc->byte_len);
214 skb_pull(skb, IB_GRH_BYTES); 221 skb_pull(skb, IB_GRH_BYTES);
215 222
216 if (wc->slid != priv->local_lid || 223 skb->protocol = ((struct ipoib_header *) skb->data)->proto;
217 wc->src_qp != priv->qp->qp_num) { 224 skb_reset_mac_header(skb);
218 skb->protocol = ((struct ipoib_header *) skb->data)->proto; 225 skb_pull(skb, IPOIB_ENCAP_LEN);
219 skb_reset_mac_header(skb);
220 skb_pull(skb, IPOIB_ENCAP_LEN);
221 226
222 dev->last_rx = jiffies; 227 dev->last_rx = jiffies;
223 ++priv->stats.rx_packets; 228 ++priv->stats.rx_packets;
224 priv->stats.rx_bytes += skb->len; 229 priv->stats.rx_bytes += skb->len;
225 230
226 skb->dev = dev; 231 skb->dev = dev;
227 /* XXX get correct PACKET_ type here */ 232 /* XXX get correct PACKET_ type here */
228 skb->pkt_type = PACKET_HOST; 233 skb->pkt_type = PACKET_HOST;
229 netif_receive_skb(skb); 234 netif_receive_skb(skb);
230 } else {
231 ipoib_dbg_data(priv, "dropping loopback packet\n");
232 dev_kfree_skb_any(skb);
233 }
234 235
235repost: 236repost:
236 if (unlikely(ipoib_ib_post_receive(dev, wr_id))) 237 if (unlikely(ipoib_ib_post_receive(dev, wr_id)))