Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 09 May 2022 18:36:17 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 263886] dwc: dwc driver fails to detect a bad checksum packet when the RXCSUM capability is turned on
Message-ID:  <bug-263886-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D263886

            Bug ID: 263886
           Summary: dwc: dwc driver fails to detect a bad checksum packet
                    when the RXCSUM capability is turned on
           Product: Base System
           Version: CURRENT
          Hardware: arm64
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: jiahali@blackberry.com
 Attachment #233823 text/plain
         mime type:

Created attachment 233823
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D233823&action=
=3Dedit
python script for sending good/bad checksum packet

The dwc driver's RXCSUM hardware offloading is not able to detect the packet
with a bad checksum. In my development environment, I will manually send a
packet with a good checksum and a packet with a bad checksum respectively to
the  dwc0 interface. The python script and Wireshark log are attached.

The setup of the environment is as follows

On host

$ ifconfig enp0s31f6
enp0s31f6: flags=3D4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.3.2  netmask 255.255.255.0  broadcast 192.168.3.255
        ether 8c:8c:aa:c1:2b:c3  txqueuelen 1000  (Ethernet)
        RX packets 2378  bytes 991956 (991.9 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 14312  bytes 1872875 (1.8 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16  memory 0xae380000-ae3a0000


On the Freebsd current image

root@generic:~ # uname  -a
FreeBSD generic 14.0-CURRENT FreeBSD 14.0-CURRENT #0 main-n254961-b91a48693=
a5:
Thu Apr 21 09:35:51 UTC 2022=20=20=20=20
root@releng1.nyi.freebsd.org:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC arm=
64

root@generic:~ # ifconfig dwc0 192.168.3.129/24

root@generic:~ # ifconfig dwc0 -rxcsum -txcsum
root@generic:~ # ifconfig dwc0
dwc0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=3D80008<VLAN_MTU,LINKSTATE>
        ether fa:97:92:f6:f1:09
        inet 192.168.3.129 netmask 0xffffff00 broadcast 192.168.3.255
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        nd6 options=3D29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

Test Procedure

1. Check dwc0 config showing that the RXCSUM offloading is off in Freebsd
root@generic:~ # ifconfig dwc0
dwc0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=3D80008<VLAN_MTU,LINKSTATE>
        ether fa:97:92:f6:f1:09
        inet 192.168.3.129 netmask 0xffffff00 broadcast 192.168.3.255
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        nd6 options=3D29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

2. Check the current netstat in the Freebsd
root@generic:~ # netstat -s -p ip
ip:
        42 total packets received
        5 bad header checksums

3. Send a good packet from the host to dwc0

sudo python3 send_raw_ping.py -s good

4. Check the current netstat in Freebsd
root@generic:~ # netstat -s -p ip
ip:
        43 total packets received
        5 bad header checksums

5. Send a bad packet from the host to dwc0

sudo python3 send_raw_ping.py -s bad

6. Check the current netstat in Freebsd. The bad checksum packet is detecte=
d.
root@generic:~ # netstat -s -p ip
ip:
        44 total packets received
        6 bad header checksums

7. Check the dwc0 interface config in Freebsd showing the RXCSUM is off.
root@generic:~ # ifconfig dwc0
dwc0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=3D80008<VLAN_MTU,LINKSTATE>
        ether fa:97:92:f6:f1:09
        inet 192.168.3.129 netmask 0xffffff00 broadcast 192.168.3.255
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        nd6 options=3D29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

8. Turn on the dwc0's RXCSUM capability in Freebsd
root@generic:~ # ifconfig dwc0 rxcsum

9. Check the dwc0 interface config in Freebsd showing the RXCSUM is on
root@generic:~ # ifconfig dwc0
dwc0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=3D80009<RXCSUM,VLAN_MTU,LINKSTATE>
        ether fa:97:92:f6:f1:09
        inet 192.168.3.129 netmask 0xffffff00 broadcast 192.168.3.255
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        nd6 options=3D29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

11. Check the current netstat in Freebsd
root@generic:~ # netstat -s -p ip
ip:
        44 total packets received
        6 bad header checksums

11. Send a good packet from the host to dwc0

sudo python3 send_raw_ping.py -s good

12. Check the current netstat in Freebsd.
root@generic:~ # netstat -s -p ip
ip:
        45 total packets received
        6 bad header checksums

13. Send a bad packet from the host to dwc0

sudo python3 send_raw_ping.py -s bad

14. Check the current netstat in Freebsd. The bad checksum packet is not
detected.
root@generic:~ # netstat -s -p ip
ip:
        46 total packets received
        6 bad header checksums



Expected Results:

At step 14, the results should be=20

root@generic:~ # netstat -s -p ip
ip:
        46 total packets received
        7 bad header checksums

The packet with bad checksum should be detected and recorded at the netstat.

Do I miss any configuration to enable the RXCSUM hardware offloading? Or the
RXCSUM is not supported at the dwc driver now.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-263886-227>