[ofa-general] IPOIB checksum offload support

Eli Cohen eli at dev.mellanox.co.il
Sun Mar 16 05:22:24 PDT 2008


Hi Roland,

in reference to this commit ID b6fe014b2ade84f82c614ee68292fb85ce1fc573:

1. It seems that there is a memory leak that the following fixes:

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index d0fbb0e..75f99c0 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -1140,6 +1140,9 @@ static struct net_device *ipoib_add_port(const char *format,
 		priv->dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
 	}
 
+	kfree(device_attr);
+	device_attr = NULL;
+
 	/*
 	 * Set the full membership bit, so that we join the right
 	 * broadcast group, etc.

2. I see that you added an else clause here:

index 08c4396..8ed09d1 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
@@ -231,6 +231,12 @@ static void ipoib_ib_handle_rx_wc(struct net_device *dev, struct ib_wc *wc)
        skb->dev = dev;
        /* XXX get correct PACKET_ type here */
        skb->pkt_type = PACKET_HOST;
+
+       if (test_bit(IPOIB_FLAG_CSUM, &priv->flags) && likely(wc->csum_ok))
+               skb->ip_summed = CHECKSUM_UNNECESSARY;
+       else
+               skb->ip_summed = CHECKSUM_NONE;
+

Since CHECKSUM_NONE is defined as 0 and since a new skb is memset to 0,
it seems to be unnecessary, at least in the head kernel. Moreover, in
the previous versions of IPOIB, we did not explicitly set the ip_summed
field of the skb. Do you think we must have the "else" here.






More information about the general mailing list