[openib-general] [PATCH] IPoIB receive wc error

Shirley Ma xma at us.ibm.com
Sun Mar 26 13:10:48 PST 2006


Hello Roland,

If IPoIB has an unsuccessful receive packet (wc->status != IB_WC_SUCCESS), 

is it a permenent error or a temp error?

If it is a temp eror, receive packet errors stat should be increased, and 
the old buffer 
should be reused instead of being freed. In the extreme case, if none of 
the receive's 
wc is successful, there is no buffer to receive any incoming packets.

Please correct me if I am wrong. Attachement is the patch file.

Signed-off-by: Shirley Ma <xma at us.ibm.com>

diff -urN infiniband/ulp/ipoib/ipoib_ib.c 
infiniband-rx_error/ulp/ipoib/ipoib_ib.c
--- infiniband/ulp/ipoib/ipoib_ib.c     2006-03-26 11:57:15.853035656 
-0800
+++ infiniband-rx_error/ulp/ipoib/ipoib_ib.c    2006-03-26 
12:47:53.946175296 -0800
@@ -196,10 +196,11 @@
                                        ipoib_warn(priv, "failed recv 
event "
                                                   "(status=%d, wrid=%d 
vend_err %x)\n",
                                                   wc->status, wr_id, 
wc->vendor_err);
-                               dma_unmap_single(priv->ca->dma_device, 
addr,
-                                                IPOIB_BUF_SIZE, 
DMA_FROM_DEVICE);
-                               dev_kfree_skb_any(skb);
-                               priv->rx_ring[wr_id].skb = NULL;
+                               ++priv->stats.rx_errors;
+                               /* ignore this packet, reuse the old 
buffer */
+                               if (unlikely(ipoib_ib_post_receive(dev, 
wr_id)))
+                                       ipoib_warn(priv, 
"ipoib_ib_post_receive failed "
+                                                  "for buf %d\n", wr_id);
                                return;
                        }

 

Thanks
Shirley Ma
IBM Linux Technology Center
15300 SW Koll Parkway
Beaverton, OR 97006-6063
Phone(Fax): (503) 578-7638

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20060326/722d74ea/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: infiniband-rx_error.patch
Type: application/octet-stream
Size: 801 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20060326/722d74ea/attachment.obj>


More information about the general mailing list