On 7/3/25 9:45 AM, David Marchand wrote:
> As the link speeds have evolved over the years, the list of supported
> rates is obsolete in OVS.
> Yet a catch all value (NETDEV_F_OTHER) is available, so use it.
> 
> Fixes: 6240c0b4c80e ("netdev: Add netdev_get_speed() to netdev API.")
> Signed-off-by: David Marchand <david.march...@redhat.com>
> ---
>  lib/netdev-bsd.c          | 3 +++
>  lib/netdev-linux.c        | 2 +-
>  tests/system-interface.at | 2 +-
>  3 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/netdev-bsd.c b/lib/netdev-bsd.c
> index 6e3091b939..c7cd59376a 100644
> --- a/lib/netdev-bsd.c
> +++ b/lib/netdev-bsd.c
> @@ -1151,6 +1151,9 @@ netdev_bsd_get_features(const struct netdev *netdev,
>  
>      /* Current settings. */
>      *current = netdev_bsd_parse_media(ifmr.ifm_active);
> +    if (!*current) {
> +        *current = NETDEV_F_OTHER;
> +    }
>  
>      /* Advertised features. */
>      *advertised = netdev_bsd_parse_media(ifmr.ifm_current);
> diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
> index a63d03d484..5dad2e7ed7 100644
> --- a/lib/netdev-linux.c
> +++ b/lib/netdev-linux.c
> @@ -2680,7 +2680,7 @@ netdev_linux_read_features(struct netdev_linux *netdev)
>      } else if (netdev->current_speed == 1000000) {
>          netdev->current = NETDEV_F_1TB_FD;
>      } else {
> -        netdev->current = 0;
> +        netdev->current = NETDEV_F_OTHER;

I'm not sure if we should set NETDEV_F_OTHER when the speed is reported
as zero or as SPEED_UNKNOWN.  We may need to not set any flags in this case.

>      }
>  
>      if (ecmd.port == PORT_TP) {
> diff --git a/tests/system-interface.at b/tests/system-interface.at
> index d4ee5c46ba..cb0835ad6b 100644
> --- a/tests/system-interface.at
> +++ b/tests/system-interface.at
> @@ -199,7 +199,7 @@ OFPST_PORT_DESC reply (OF1.5):
>   1(tap0): addr:aa:55:aa:55:00:01
>       config:     0
>       state:      LIVE
> -     current:    COPPER
> +     current:    OTHER COPPER
>       speed: 50000 Mbps now, 0 Mbps max
>  ])
>  

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to