[ofa-general] [PATCH 3/11] ib_core: add checksum offload support

Or Gerlitz ogerlitz at voltaire.com
Tue Sep 25 03:57:55 PDT 2007


Eli Cohen wrote:
> On Tue, 2007-09-25 at 12:15 +0200, Or Gerlitz wrote:
>> Eli Cohen wrote:

>>> A device that publishes IB_DEVICE_IP_CSUM actually supports
>>> calculating checksum on transmit and provides indication whether

>> I find it more clear if the device capability (same for the send flag) 
>> name would follow one of these:
>>> #define NETIF_F_IP_CSUM     2       /* Can checksum TCP/UDP over IPv4. */
>>> #define NETIF_F_NO_CSUM     4       /* Does not require checksum. F.e. loopack. */
>>> #define NETIF_F_HW_CSUM     8       /* Can checksum all the packets. */
>>> #define NETIF_F_IPV6_CSUM   16      /* Can checksum TCP/UDP over IPV6 */

> I am not sure that defining all kinds of capabilities to the device are
> useful. For example if a device defines only IP checksum than there is
> no useful.

I did not say that you need to add four capabilities, you can add one 
that fits the connectX feature eg IB_DEVICE_HW_CSUM and document that if 
the device supports this, it is capable to compute TCP and UDP checksum 
for both IPv4 and IPv6 packets, etc. Later if some new HW will be 
capable to offload only IPv4, they will add a new capability etc.


>>> Index: ofa_1_3_dev_kernel/include/rdma/ib_verbs.h
>>>  enum ib_cq_notify_flags {
>>> @@ -615,7 +617,9 @@ enum ib_send_flags {
>>>  	IB_SEND_FENCE		= 1,
>>>  	IB_SEND_SIGNALED	= (1<<1),
>>>  	IB_SEND_SOLICITED	= (1<<2),
>>> -	IB_SEND_INLINE		= (1<<3)
>>> +	IB_SEND_INLINE		= (1<<3),
>>> +	IB_SEND_IP_CSUM         = (1<<4),
>> there's no point for the HW to compute the IP csum, asking this is a 
>> pure waste, since the stack always does it

>>> +	IB_SEND_UDP_TCP_CSUM    = (1<<5)
>>>  };

> I am not sure this is always true but anyway it is not a waste since
> computing the checksum does put more "work" on the hardware.

Again, per the discussion over the thread it --is-- true, also, it 
creates confusion while reading the code (why to ask the HW to do 
something which is always done by SW?), also this does not put more work 
on the private case of the connectX HW which relies on the IB ICRC, 
second HW might go and actually compute the IP header csum.

Or.






More information about the general mailing list