lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #56288] IP forward problem with hardware and software


From: Tom Gibson
Subject: [lwip-devel] [bug #56288] IP forward problem with hardware and software checksum calculation interfaces
Date: Thu, 24 Feb 2022 08:40:35 -0500 (EST)

Follow-up Comment #3, bug #56288 (project lwip):

[comment #2 comment #2:]
> Fixed by seting checksum fields of IP/UDP/TCP/ICMP to 0 in ip4_forward().

Hi Simon,

I have reviewed the commit which relates to this bug at
https://git.savannah.nongnu.org/cgit/lwip.git/commit/?id=61c67fc2295e522c7a12175581d6928c3951c0bf
and I believe the changes it includes may be causing an issue in our
scenario.

We are using an i.MX RT 1050 EVKB with LWIP 2.2.0 which has a built in
Ethernet interface, we are also using NXP's virtual RNDIS USB network driver
which is software-based.

When forwarding packets from the Ethernet interface to the USB RNDIS interface
(which definitely does not feature hardware checksum offload) checksums are
being zeroed by the lines in this commit and then not subsequently
recalculated. This is happening because CHKSUM_GEN_IP, CHKSUM_GEN_UDP,
CHKSUM_GEN_TCP, CHKSUM_GEN_ICMP are all set to 1, i.e. generate checksums in
software, however it would appear to me that for the software checksum
use-case checksums should not be set to zero at these lines. Is this an error
in the patch?

An additional observation that I had is that the other half of the if check
appears to be looking to see if the output interface supports
hardware-offload, however the pointer 'inp' refers to the the input interface.
'netif' is the output interface, would this be the correct interface to check
for hardware offload support?

If my conclusions above are correc0t, should the check actually be more along
the lines of

if (!CHECKSUM_GEN_IP || NETIF_CHECKSUM_ENABLED(netif, NETIF_CHECKSUM_GEN_IP))

? That is assuming that the latter check will be true in the case where
'netif' supports hardware offload.

Regards,
Tom Gibson

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56288>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]