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

Eli Cohen eli at mellanox.co.il
Tue Sep 25 03:30:52 PDT 2007


On Tue, 2007-09-25 at 12:15 +0200, Or Gerlitz wrote:
> Eli Cohen wrote:
> > Add checksum offload support to the core
> > A device that publishes IB_DEVICE_IP_CSUM actually supports
> > calculating checksum on transmit and provides indication whether
> > the checksum is OK on receive.
> 
> Hi Eli,
> 
>  From the discussion over the "IB/ipoib: S/G and HW checksum support" 
> thread, I understand that Linux actually never offloads the IP checksum 
> calculation to the HW but rather only the TCP and UDP checksum.
> 
> 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 */
> 
> Or.

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.

> 
> > 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.




More information about the general mailing list