Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 02 Mar 2024 21:14:02 +0000
From:      bugzilla-noreply@freebsd.org
To:        virtualization@FreeBSD.org
Subject:   [Bug 264253] hyperv: ifconfig media autoselect on FreeBSD 13.0 displays error: ifconfig: SIOCSIFMEDIA (media): Operation not supported
Message-ID:  <bug-264253-27103-5M601qO1m7@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-264253-27103@https.bugs.freebsd.org/bugzilla/>
References:  <bug-264253-27103@https.bugs.freebsd.org/bugzilla/>

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

Mark Peek <mp@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mp@FreeBSD.org

--- Comment #6 from Mark Peek <mp@FreeBSD.org> ---
I see the same error across 10.4, 13.0, and 15-current

10.4
=3D=3D=3D=3D
# uname -a
FreeBSD fbsd10 10.4-RELEASE FreeBSD 10.4-RELEASE #0 r324094: Fri Sep 29
01:45:44 UTC 2017     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GEN=
ERIC
 amd64
# ifconfig -mv hn0
hn0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=3D8051b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,TSO4,LRO,LINK=
STATE>
=20=20=20=20=20=20=20
capabilities=3D48071b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,TSO4,TSO6,LRO,L=
INKSTATE,TXCSUM_IPV6>
        ether 00:15:5d:0a:28:00
        hwaddr 00:15:5d:0a:28:00
        inet6 fe80::215:5dff:fe0a:2800%hn0 prefixlen 64 scopeid 0x2
        inet6 2601:601:4000:c4de:215:5dff:fe0a:2800 prefixlen 64 autoconf
        inet6 fd50:d9bc:e952:6040:215:5dff:fe0a:2800 prefixlen 64 detached
autoconf
        inet 10.1.10.215 netmask 0xffffff00 broadcast 10.1.10.255
        nd6 options=3D23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
        media: Ethernet autoselect (10Gbase-T <full-duplex>)
        status: active
        supported media:
                media autoselect
# ifconfig hn0 media autoselect
ifconfig: SIOCSIFMEDIA (media): Operation not supported

13.0
=3D=3D=3D=3D
# uname -a
FreeBSD bsd13 13.0-RELEASE FreeBSD 13.0-RELEASE #0
releng/13.0-n244733-ea31abc261f: Fri Apr  9 04:24:09 UTC 2021=20=20=20=20
root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64
# ifconfig -mv hn0
hn0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=3D8051b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,TSO4,LRO,LINK=
STATE>
=20=20=20=20=20=20=20
capabilities=3D48071b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,TSO4,TSO6,LRO,L=
INKSTATE,TXCSUM_IPV6>
        ether 00:15:5d:0a:28:01
        inet 10.1.10.139 netmask 0xffffff00 broadcast 10.1.10.255
        media: Ethernet autoselect (10Gbase-T <full-duplex>)
        status: active
        supported media:
                media autoselect
        nd6 options=3D29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
# ifconfig hn0 media autoselect
ifconfig: SIOCSIFMEDIA (media): Operation not supported

15-current
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
# uname -a
FreeBSD FreeBSD-current 15.0-CURRENT FreeBSD 15.0-CURRENT #0
main-n268454-9097284b98be: Thu Feb 22 03:00:34 UTC 2024=20=20=20=20
root@releng3.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64
# ifconfig -mv hn0
hn0: flags=3D1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metri=
c 0
mtu 1500
        options=3D8051b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,TSO4,LRO,LINK=
STATE>
=20=20=20=20=20=20=20
capabilities=3D48071b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,TSO4,TSO6,LRO,L=
INKSTATE,TXCSUM_IPV6>
        ether 00:15:5d:0a:28:02
        inet 10.1.10.125 netmask 0xffffff00 broadcast 10.1.10.255
        inet6 fe80::215:5dff:fe0a:2802%hn0 prefixlen 64 scopeid 0x2
        inet6 2601:601:4000:c4de:215:5dff:fe0a:2802 prefixlen 64 autoconf
pltime 14400 vltime 86400
        inet6 fd50:d9bc:e952:6040:215:5dff:fe0a:2802 prefixlen 64 detached
autoconf pltime 1800 vltime 1800
        media: Ethernet autoselect (10Gbase-T <full-duplex>)
        status: active
        supported media:
                media autoselect
        nd6 options=3D23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
        drivername: hn0
# ifconfig hn0 media autoselect
ifconfig: SIOCSIFMEDIA (media): Operation not supported


This is not surprising since the hn_ifmedia_upd() callback is the same and
returns EOPNOTSUPP. The code for 10.4 is here:
https://github.com/freebsd/freebsd-src/blob/releng/10.4/sys/dev/hyperv/netv=
sc/if_hn.c#L1008

Since the only media supported is autoselect, it seems reasonable to just
return 0 from hn_ifmedia_upd() instead of EOPNOTSUPP. Patched on 15-current,
this results in no error for "autoselect" and will error for unregistered m=
edia
types.

# ifconfig hn0 media autoselect
# ifconfig hn0 media 100baseT
ifconfig: SIOCSIFMEDIA (media): Device not configured

An early review D4611 did have hn_ifmedia_upd() return 0 but was abandoned.=
 A
subsequent review D4852 has this function returning EOPNOTSUPP.

Allowing selection of the current (and only) registered media type seems
reasonable rather than throwing an error. I'm going to try contacting a cou=
ple
of the contributors to the reviews to see if they agree.

--=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-264253-27103-5M601qO1m7>