From nobody Mon May 09 18:36:17 2022 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 732221AE5022 for ; Mon, 9 May 2022 18:36:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Kxqcx1Rhjz3PcL for ; Mon, 9 May 2022 18:36:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0DE3815EDD for ; Mon, 9 May 2022 18:36:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 249IaHd5048384 for ; Mon, 9 May 2022 18:36:17 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 249IaGP5048383 for bugs@FreeBSD.org; Mon, 9 May 2022 18:36:16 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f 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 Date: Mon, 09 May 2022 18:36:17 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: jiahali@blackberry.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.mimetype attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652121377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AFCM9wf1PxjlDvYGHj00pFVfcRbr45uNuDkFPL0q6O4=; b=BU19UrsgExL78gJFihcBUhPG1MmB4WmjqDZI+plOCnMY04Ia1PJqmUao9xMp8u+9sbhxaf ZG7vSyVTUiNhwK170Q3tG+NyVH3vHjrjFF3qNu6armVgHEQkpx3cpz4Cnx4l4sZ9r9gbkh CiwZ/pjShDqVyTETTCQSYWwhEZqybM5RK5+LklnxtVItmfwALHD3gNHEzxRf62mbG0ACwX jsJ0y1JQwBhqr3/D6mMLxjzOUGUTHcxdZS7aRdfhcCBAmqQ6lH3m/qH/7Dp3PDAs5kmYl2 M+ixdHnRbkaYCWqSxDAjvMiANsqqBVNmvrsVm58XP3L3e4YzKHYY6x6CoQwLvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652121377; a=rsa-sha256; cv=none; b=a6jl7BRDKojFmHxdHYpgDGPdESXEn3YAN6Rw8ncN002Hk+cjdSrvxagh0YvDaOvOPUf5pD auX35h2P3acU95G6xj+Q0v+7/3M4nxn0J98ZSd1x4DQWwaAnpaDiddKJrZVd4t20uYV/O1 pfE4idhZs6TNlsKyEkdL03An0l1EVwwlDP2f85Ss7fhTZVDa7K/GOUpNs7n7mK13qMYrBp oTnvhxThs3Sx82PosJA52I6aVCFIy6hMoouTa0R17by1eyF/xANtvOVQaygLxHAn8yBLiq DPvaGc2RFZbt+iiKsTuK3phUHeF2nmCt3DUWCbhCVeRM9ul1CIsIE6LSittkpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N 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 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 metric 0 mtu 1500 options=3D80008 ether fa:97:92:f6:f1:09 inet 192.168.3.129 netmask 0xffffff00 broadcast 192.168.3.255 media: Ethernet autoselect (1000baseT ) status: active nd6 options=3D29 Test Procedure 1. Check dwc0 config showing that the RXCSUM offloading is off in Freebsd root@generic:~ # ifconfig dwc0 dwc0: flags=3D8843 metric 0 mtu 1500 options=3D80008 ether fa:97:92:f6:f1:09 inet 192.168.3.129 netmask 0xffffff00 broadcast 192.168.3.255 media: Ethernet autoselect (1000baseT ) status: active nd6 options=3D29 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 metric 0 mtu 1500 options=3D80008 ether fa:97:92:f6:f1:09 inet 192.168.3.129 netmask 0xffffff00 broadcast 192.168.3.255 media: Ethernet autoselect (1000baseT ) status: active nd6 options=3D29 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 metric 0 mtu 1500 options=3D80009 ether fa:97:92:f6:f1:09 inet 192.168.3.129 netmask 0xffffff00 broadcast 192.168.3.255 media: Ethernet autoselect (1000baseT ) status: active nd6 options=3D29 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.=