Hello,
On Thu, 13 Sep 2001, Roberto Nibali wrote:
> Hi Julian,
>
> > For TUN we set skb->ip_summed to CHECKSUM_NONE after the
> > packet is changed and it indicates to the output functions that
> > this paacket does not have checksum calculated. The same is missing
> > for NAT in both directions.
>
> Hmm, I see, but what do we gain by setting skb->ip_summed to
> CHECKSUM_NONE? I did a short:
Nothing, may be we have to return CHECKSUM_UNNECESSARY, as
you said, when the checksum is correct.
> find . -name "*.[c]" -exec grep --context "CHECKSUM_" /dev/null {} \;
>
> and I stepped over the netfilter stuff:
>
> if (skb->ip_summed == CHECKSUM_HW) {
> if (outdev == NULL) {
> skb->ip_summed = CHECKSUM_NONE;
> } else {
> skb_checksum_help(skb);
>
> Don't we need to call skb_checksum_help? Or what happens to the the
> skb if we set CHECKSUM_NONE and dev->features is NETIF_F_HW_CSUM?
> At least, I see now the connection between LVS and the problem people
> describe with the eepro100.
We can't touch here.
> > What I don't understand is why we have checksum error before
> > that point. Jeremy still didn't responded and I don't know whether
> > his chip has raw support for rx checksuming or whether the e100
>
> Can we printk the device->features on that driver?
This driver does not enable checksuming for my chip and
I can't debug it fully. In fact, Jeremy has chip that does not
perform full check for the packets, only for the payload and
the rest (IP and pseudo header) are checked in CPU. Then I assume
CHECKSUM_HW is returned but with wrong skb->csum.
> I'm sorry, I confused the drivers. There's neither CHECKSUM_HW nor
> any of the others mentioned in include/kernel/skbuff.h. Sometimes I
> get the impression that Alexey really seems to be a very disturbed
> guy while reading his comments on network related things :)
>
> > This patch is for LVS and is at home. But I can try to build it
> > again for you, if you have cards with hardware checksuming support :)
>
> I have to check out stock :) A short grep in drivers/net didn't
> reveil that many drivers supporting HW checksumming but I will go
> for the starfire quad ethernet one. I'm not sure however since I
> fail to see the NETIF_F_HW_CSUM feature set in starfire.c.
I don't see similar handling in the kernel, may be only
e100 performs such actions?
What I see in 2.4 is that (I have to test these changes):
- if we detect CHECKSUM_HW we have to check the pseudo header and
then to set CHECKSUM_UNNECESSARY (The strange thing is why we receive
CHECKSUM_HW with wrong checksum in skb->csum). The e100 man page
recommends ia64 platform for these XsumRX checks.
- if we complete the checksum we can change ip_summed to
CHECKSUM_UNNECESSARY (NAT), then nobody needs to make TX csum
- DR can return CHECKSUM_UNNECESSARY too
> > OK, appended.
>
> Wow, that simple?
May be not :) I'm planning one optimization more: not
to make full payload TX sum again (after NAT) but to update the
csum with the diff caused from the mangling (addr+port). The same
is done in netfilter. I assume the drivers better to see
CHECKSUM_UNNECESSARY on output?
> > Or better CHECKSUM_NONE, used in the output functions
>
> Yep, I see the comments in skbuff.h now. Am I right that the
> checksumming is then done in tcp.c?
No, we don't reach the sockets
> Regards,
> Roberto Nibali, ratz
Regards
--
Julian Anastasov <ja@xxxxxx>
|