[ofa-general] [PATCHv2] IB/ipoib: S/G and HW checksum support
Michael S. Tsirkin
mst at dev.mellanox.co.il
Tue Sep 4 10:48:43 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:04:19PM +0300, Michael S. Tsirkin wrote:
>
> > > This would be alot better in my mind of the option was negotiated as
> > > part of the CM setup process.
> >
> > Unfortunately, HW_CSUM device->features flag is a per-netdevice one.
> > We could do an extra pass over the packet, but this would mean a
> > performance hit for such paths. Your suggestion also does
> > not address multicast addresses.
>
> Why is there a big difference in performance if the stack does the
> csum update or if the netdevice does the csum update?
>
> 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
> > > 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.
> 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.
Since skb is not marked with CHECKSUM_COMPLETE, linux will
recompute the checksum IMO.
--
MST
More information about the general
mailing list