Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 06 Apr 2022 14:05:03 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 263091] [genet] genet interface is not able to transmit/receive packet after the interface is marked "down" then marked "up"
Message-ID:  <bug-263091-227@https.bugs.freebsd.org/bugzilla/>

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

            Bug ID: 263091
           Summary: [genet] genet interface is not able to
                    transmit/receive packet after the interface is marked
                    "down" then marked "up"
           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

Overview
--------

The genet interface is not able transmit/receive any packets after the genet
interface is marked "down"
firstly then marked "up".

The reason is that the implementation genet driver code will reset the genet
interface but not change the runtime flag of genet driver. Therefore, when
"ifconfig genet up" command is used, the genet driver cannot be re-initiali=
zed
again. Moreover, the initialization of genet driver is to enbale the driver=
's
DMA and interrupts, which is not enbale the genet driver being reset when g=
enet
is marked down.

Steps to Reproduce
------------------

1. Config a static IP address to both of the host's interface and the genet
interface

In the DUT(Device Under Test), with genet interface and Freebsd running, si=
de

root@generic:~ # ifconfig genet0 192.168.3.129 netmask 255.255.255.0
root@generic:~ # ifconfig genet0
genet0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1=
500
=20=20=20=20=20=20=20
options=3D68000b<RXCSUM,TXCSUM,VLAN_MTU,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        ether dc:a6:32:bf:f4:e6
        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>


In the host computer with direct Ethernet cable connection to the DUT

$ sudo ifconfig enp0s31f6 192.168.3.2
$ 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 384  bytes 37406 (37.4 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 5674  bytes 1175798 (1.1 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16  memory 0xae380000-ae3a0000

2. Host's interface and genet interface can transmit/receive packet to/from
each other

In the DUT

root@generic:~ # ping 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.445 ms
64 bytes from 192.168.3.2: icmp_seq=3D1 ttl=3D64 time=3D0.321 ms
64 bytes from 192.168.3.2: icmp_seq=3D2 ttl=3D64 time=3D0.361 ms
^C
--- 192.168.3.2 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev =3D 0.321/0.376/0.445/0.051 ms

In the host

$ ping 192.168.3.129
PING 192.168.3.129 (192.168.3.129) 56(84) bytes of data.
64 bytes from 192.168.3.129: icmp_seq=3D1 ttl=3D64 time=3D0.242 ms
64 bytes from 192.168.3.129: icmp_seq=3D2 ttl=3D64 time=3D0.233 ms
64 bytes from 192.168.3.129: icmp_seq=3D3 ttl=3D64 time=3D0.180 ms
^C
--- 192.168.3.129 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2049ms
rtt min/avg/max/mdev =3D 0.180/0.218/0.242/0.027 ms

3. Mark the genet interface "down", then mark the interface "up"

root@generic:~ # ifconfig genet0 down
root@generic:~ # ifconfig genet0
genet0: flags=3D8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
=20=20=20=20=20=20=20
options=3D68000b<RXCSUM,TXCSUM,VLAN_MTU,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        ether dc:a6:32:bf:f4:e6
        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>
root@generic:~ # ifconfig genet0 up
root@generic:~ # ifconfig genet0=20
genet0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1=
500
=20=20=20=20=20=20=20
options=3D68000b<RXCSUM,TXCSUM,VLAN_MTU,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        ether dc:a6:32:bf:f4:e6
        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>

Actual Results
--------------

1. Genet interface is not able to transmit/receive any packet

In the DUT

root@generic:~ # ping 192.168.3.2
PING 192.168.3.2 (192.168.3.2): 56 data bytes
^C
--- 192.168.3.2 ping statistics ---
4 packets transmitted, 0 packets received, 100.0% packet loss

In the host

$ ping 192.168.3.129
PING 192.168.3.129 (192.168.3.129) 56(84) bytes of data.
>From 192.168.3.2 icmp_seq=3D9 Destination Host Unreachable
>From 192.168.3.2 icmp_seq=3D10 Destination Host Unreachable
>From 192.168.3.2 icmp_seq=3D11 Destination Host Unreachable
^C
--- 192.168.3.129 ping statistics ---
13 packets transmitted, 0 received, +3 errors, 100% packet loss, time 12280=
ms
pipe 4

Expected Results
----------------
The "ifconfig genet0 up" can re-enable the genet inerface after the genet
interface is marked as "down". The data communication between the genet and=
 the
host should be recovered when the interface is re-enbale.

Build Date & Hardware
---------------------
root@generic:~ # uname -a
FreeBSD generic 14.0-CURRENT FreeBSD 14.0-CURRENT #0 main-n254105-d53927b0b=
ae:
Thu Mar 31 09:26:32 UTC 2022=20=20=20=20
root@releng1.nyi.freebsd.org:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC arm=
64

--=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-263091-227>