From nobody Fri May 06 15:47:13 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 725181AC9FE1 for ; Fri, 6 May 2022 15:47:14 +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 4Kvw1G1BHHz3nGD for ; Fri, 6 May 2022 15:47:14 +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 05D401EB54 for ; Fri, 6 May 2022 15:47:14 +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 246FlDfq012792 for ; Fri, 6 May 2022 15:47:13 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 246FlDtx012791 for bugs@FreeBSD.org; Fri, 6 May 2022 15:47:13 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 263820] dwc: dwc driver is not able to receive packets after adding new MAC address Date: Fri, 06 May 2022 15:47:13 +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.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=1651852034; 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=KUHcFZAyq12Cl1Mn0LndKcb3gdQt8mnyv/YyamMGA5A=; b=WWgzj0Pru283YtuTSRplLM6KfqOQvEqbeItxa7z0M8LXAzysoUMqJf7882utjLE1slUidk iMBE73AykeQJXFTeVW5S7J+qWtVleiFFQGKuFCP/MgNjzYDayUHuav+Q3e+mQr91tvdMFA w34nmzcrnu6jbQeD/qIf0b/c6pAl8VQCnCtjdgjuRA+QM3c6lc7SPwIoPbrTHVSbTlRHZB R4JaYC0m5z24JxjeR3OYQaNVQmH8WtXodFQuvyzgV77n0C/sk2fbYeGldSSdl/JFnvW+kr yvBm2uwggPDX2MQmYonXevD66hSPKmefkSRuhDpecBOlcwbQmXqR4Lsn/2pNCA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651852034; a=rsa-sha256; cv=none; b=T7VrT98swZIlzB5hhSdltJe01Obg0RIL7DohrOzpqEHw30FACH6vxYucS8T0Em+tMaVEU1 /Hmz5d2YAJev840GoZMdu7RrlZu456+0JzIZEqsIHfyWO+Dnulkbs+8tO5irGk1NXoBIaj qIfbF6BXofs31MGm1oAf+DJ+qzgE9xj3rxrki7ETDyPKu/Fpfwk5MXb56xSCCL7zdnbhYZ Sz8kLzGSk+8wjhuFhil7NDBEg+GOanAA/CGMswd+gfsluckftoVz1QD8xEzYPAloLRi7+o UKme4K4UPJyCRXltxCoTGOnRwA6hxT8/FgajfYNphR8RQVNUPPGL+PbjeCgZrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D263820 Bug ID: 263820 Summary: dwc: dwc driver is not able to receive packets after adding new MAC address 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 Created attachment 233772 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D233772&action= =3Dedit Preliminary fix patch Overview -------- After adding a new mac address to the dwc0 interface, the dwc0 interface is= not able to receive packets. However, "ifconfig dwc0" shows that the interface = is UP. Actual Results -------------- 1. Set up In dwc driver's Freebsd terminal 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 dwc0: flags=3D8843 metric 0 mtu 1500 options=3D8000b ether fa:97:92:f6:f1:09 inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255 media: Ethernet autoselect (1000baseT ) status: active nd6 options=3D29 root@generic:~ # ping -c 1 192.168.3.2 PING 192.168.3.2 (192.168.3.2): 56 data bytes 64 bytes from 192.168.3.2: icmp_seq=3D0 ttl=3D64 time=3D0.509 ms --- 192.168.3.2 ping statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/stddev =3D 0.509/0.509/0.509/0.000 ms Host Terminal 1 Check interface config $ ifconfig enp0s31f6 enp0s31f6: flags=3D4163 mtu 1500 inet 192.168.3.2 netmask 255.255.255.0 broadcast 192.168.3.255 inet6 fe80::f897:92ff:fef6:f102 prefixlen 64 scopeid 0x20 ether 8c:8c:aa:c1:2b:c3 txqueuelen 1000 (Ethernet) RX packets 1662 bytes 516194 (516.1 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 10885 bytes 1346113 (1.3 MB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 16 memory 0xae380000-ae3a0000 Run the tcpdump on interface 'enp0s31f6" sudo tcpdump -U -pi enp0s31f6 -en 2. Test Results In dwc driver's Freebsd terminal root@generic:~ # ifconfig dwc0 ether 22:33:44:55:66:77 root@generic:~ # ifconfig dwc0 dwc0: flags=3D8843 metric 0 mtu 1500 options=3D8000b ether 22:33:44:55:66:77 hwaddr 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 root@generic:~ # netstat -n -I dwc0 Name Mtu Network Address Ipkts Ierrs Idrop Opkts O= errs Coll dwc0 1500 22:33:44:55:66:77 52 0 0 196 = 0 0 dwc0 - 192.168.3.0/2 192.168.3.129 16 - - 10 = - - root@generic:~ # ping -c 1 192.168.3.2 PING 192.168.3.2 (192.168.3.2): 56 data bytes --- 192.168.3.2 ping statistics --- 1 packets transmitted, 0 packets received, 100.0% packet loss root@generic:~ # netstat -n -I dwc0 Name Mtu Network Address Ipkts Ierrs Idrop Opkts O= errs Coll dwc0 1500 22:33:44:55:66:77 52 0 0 198 = 0 0 dwc0 - 192.168.3.0/2 192.168.3.129 16 - - 11 = - - Packets captured by the tcpdump at Host Terminal 1 $ sudo tcpdump -U -pi enp0s31f6 -en tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on enp0s31f6, link-type EN10MB (Ethernet), capture size 262144 by= tes 11:13:17.395542 22:33:44:55:66:77 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x080= 6), length 60: Request who-has 192.168.3.2 tell 192.168.3.129, length 46 11:13:17.395584 8c:8c:aa:c1:2b:c3 > 22:33:44:55:66:77, ethertype ARP (0x080= 6), length 42: Reply 192.168.3.2 is-at 8c:8c:aa:c1:2b:c3, length 28 ^C 2 packets captured 2 packets received by filter 0 packets dropped by kernel Analysis -------------- According to the changes in the Ipkts section from the netstat results, the= ARP response packet is not received. the "ifconfig dwc0" shows that the dwc0 interface is UP. For the Opkts section, the ARP request packet is counted twice, which I have reported in Bug 263817.=20 However, if I use the "ifconfig dwc0 192.168.3.129/24" command to configure= the interface after setting the new mac address. The interface can work properl= y. root@generic:~ # ifconfig dwc0 192.168.3.129/24 root@generic:~ # ifconfig dwc0 dwc0: flags=3D8843 metric 0 mtu 1500 options=3D8000b ether 22:33:44:55:66:77 hwaddr 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 root@generic:~ # ping -c 1 192.168.3.2 PING 192.168.3.2 (192.168.3.2): 56 data bytes 64 bytes from 192.168.3.2: icmp_seq=3D0 ttl=3D64 time=3D0.565 ms --- 192.168.3.2 ping statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/stddev =3D 0.565/0.565/0.565/0.000 ms I also tried to fix this bug in my development environment. I found that the interface can tx/rx packets after adding new mac address if I add the "dwc_setup_rxfilter()" function at the end of the "dwc_init_locked()". I decomposed the "dwc_setup_rxfilter()" function continuously and found that = it is the setting of the mac address making the interface work again. My patch= is attached. Could you help to analyze why we should add the mac address to the driver t= wice to make the driver run when setting a new MAC address? Because the mac addr= ess is configured into the driver once at the "dwc_setup_rxfilter()" at the beginning of the "dwc_init_locked()". --=20 You are receiving this mail because: You are the assignee for the bug.=