On 7/3/25 9:45 AM, David Marchand wrote:
> As OVS does not know of the 25G speed, matching on a list of known speed
> for deducing full duplex capability is broken.
>
> Add a new netdev op to retrieve the duplex status for the existing netdev
> implementations.
>
> Reported-at: https://issues.redhat.com/browse/FDP-883
> Signed-off-by: David Marchand <[email protected]>
> ---
> include/openvswitch/netdev.h | 2 +-
> lib/netdev-bsd.c | 31 ++++++++++++++++++++++++++-----
> lib/netdev-dpdk.c | 20 ++++++++++++++++++++
> lib/netdev-linux-private.h | 1 +
> lib/netdev-linux.c | 35 +++++++++++++++++++++++++++++++++++
> lib/netdev-provider.h | 7 +++++++
> lib/netdev.c | 30 +++++++++++++++++++++++-------
> ofproto/ofproto-dpif-sflow.c | 7 +++----
> tests/system-interface.at | 12 ++++++++++++
> vswitchd/bridge.c | 8 +++-----
> 10 files changed, 131 insertions(+), 22 deletions(-)
>
<snip>
> @@ -2765,6 +2766,38 @@ netdev_linux_get_speed(const struct netdev *netdev_,
> uint32_t *current,
> return error;
> }
>
> +static int
> +netdev_linux_get_duplex_locked(struct netdev_linux *netdev, bool
> *full_duplex)
> +{
> + int err;
> +
> + if (netdev_linux_netnsid_is_remote(netdev)) {
> + return EOPNOTSUPP;
> + }
> +
> + netdev_linux_read_features(netdev);
> + err = netdev->get_features_error;
> + if (!err && netdev->current_duplex == DUPLEX_UNKNOWN) {
One more thing.
The SPEED/DUPLEX_UNKNOWN were introduced in Linux v3.2, so we may need to
define them at the top, as we do for some later introduced link speeds.
It's possible (and even likely) that we introduced some other stuff that is
not available in older kernels at this point, but we should try to keep
things consistent until the official decision to drop support for building
with some older kernels is there.
> + err = EOPNOTSUPP;
> + }
> + if (!err) {
> + *full_duplex = netdev->current_duplex == DUPLEX_FULL;
> + }
> + return err;
> +}
> +
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev