[ofa-general] [PATCHv2] IB/ipoib: S/G and HW checksum support

Michael S. Tsirkin mst at dev.mellanox.co.il
Tue Sep 4 12:56:51 PDT 2007


> Quoting Jason Gunthorpe <jgunthorpe at obsidianresearch.com>:
> Subject: Re: [ofa-general] [PATCHv2] IB/ipoib: S/G and HW checksum support
> 
> On Tue, Sep 04, 2007 at 08:48:43PM +0300, Michael S. Tsirkin wrote:
> > > Aren't you already summing all UD packets (inclusing multicast) in the
> > > driver before sending? Though, to be honest, I don't see this in your
> > > patch, so maybe not..
> > 
> > no
> 
> Yuk. Sending invalid UD packets is horrible.

I don't understand where do you get malformed UD packets.

> > So it truely is all or
> > nothing. Every gateway, embedded IP device, etc must support this or
> > you cannot use it..
> >
> > > > > What if the RXing Linux IB side is acting as a forwarder to ethernet?
> > > > > It will forward corrupt packets if this option is set, right?
> > > > 
> > > > No. The checksum will be calculated by the gateway before being sent on the
> > > > ethernet interface.
> > > 
> > > I thought linux only recomputed the checksum on the forwarding path if
> > > the skb was marked as needing checksum. Since you set the skb as
> > > already summed, there should be cases where invalid packets will be
> > > forwarded..
> > 
> > I don't set CHECKSUM_UNECESSARY, so linux will have to recompute the checksum.
> 
> Eh? You set IPOIB_HEADER_F_HWCSUM on the TX path if the csum is
> invalid

If I get CHECKSUM_NONE, I really expect there's no checksum.
So ... 

> and the test that on the rx path to set CHECKSUM_UNNECESSARY.
> So, all badly csumed packets have CHECKSUM_UNECESSARY set.

Hmm. What badly csumed packets?

> > > I'd be surprised if a real, hardware, IPoIB to XX device recomputed
> > > the checksum unconditionally. The typical approach is to do an
> > > incremental update of the checksum if you are changing the packet
> > > headers. This preserves the end-to-end-ness and also does not require
> > > buffering the entire packet before updating it.
> 
> I was talking about real, existing HW gateways here, not Linux. I
> don't know of any reason a gateway would even touch the payload and
> require a L4 checksum update, let alone doing it non-incrementally..

The IPoIB side that gets packet with hw csum bit set is required
to calculate the checksum. I don't think there's a ton of
non-linux HW gateways from ipoib to ethernet, but yes,
this spec change does require all ipoib nodes to participate.

-- 
MST



More information about the general mailing list