aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/ulp')
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_ib.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
index ec6b4fbe25e4..dfa71903d6e4 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
@@ -223,6 +223,7 @@ static void ipoib_ib_handle_rx_wc(struct net_device *dev, struct ib_wc *wc)
223 unsigned int wr_id = wc->wr_id & ~IPOIB_OP_RECV; 223 unsigned int wr_id = wc->wr_id & ~IPOIB_OP_RECV;
224 struct sk_buff *skb; 224 struct sk_buff *skb;
225 u64 mapping[IPOIB_UD_RX_SG]; 225 u64 mapping[IPOIB_UD_RX_SG];
226 union ib_gid *dgid;
226 227
227 ipoib_dbg_data(priv, "recv completion: id %d, status: %d\n", 228 ipoib_dbg_data(priv, "recv completion: id %d, status: %d\n",
228 wr_id, wc->status); 229 wr_id, wc->status);
@@ -271,6 +272,16 @@ static void ipoib_ib_handle_rx_wc(struct net_device *dev, struct ib_wc *wc)
271 ipoib_ud_dma_unmap_rx(priv, mapping); 272 ipoib_ud_dma_unmap_rx(priv, mapping);
272 ipoib_ud_skb_put_frags(priv, skb, wc->byte_len); 273 ipoib_ud_skb_put_frags(priv, skb, wc->byte_len);
273 274
275 /* First byte of dgid signals multicast when 0xff */
276 dgid = &((struct ib_grh *)skb->data)->dgid;
277
278 if (!(wc->wc_flags & IB_WC_GRH) || dgid->raw[0] != 0xff)
279 skb->pkt_type = PACKET_HOST;
280 else if (memcmp(dgid, dev->broadcast + 4, sizeof(union ib_gid)) == 0)
281 skb->pkt_type = PACKET_BROADCAST;
282 else
283 skb->pkt_type = PACKET_MULTICAST;
284
274 skb_pull(skb, IB_GRH_BYTES); 285 skb_pull(skb, IB_GRH_BYTES);
275 286
276 skb->protocol = ((struct ipoib_header *) skb->data)->proto; 287 skb->protocol = ((struct ipoib_header *) skb->data)->proto;
@@ -281,9 +292,6 @@ static void ipoib_ib_handle_rx_wc(struct net_device *dev, struct ib_wc *wc)
281 dev->stats.rx_bytes += skb->len; 292 dev->stats.rx_bytes += skb->len;
282 293
283 skb->dev = dev; 294 skb->dev = dev;
284 /* XXX get correct PACKET_ type here */
285 skb->pkt_type = PACKET_HOST;
286
287 if (test_bit(IPOIB_FLAG_CSUM, &priv->flags) && likely(wc->csum_ok)) 295 if (test_bit(IPOIB_FLAG_CSUM, &priv->flags) && likely(wc->csum_ok))
288 skb->ip_summed = CHECKSUM_UNNECESSARY; 296 skb->ip_summed = CHECKSUM_UNNECESSARY;
289 297