On 1 Apr 2026, at 11:13, Eli Britstein wrote:

> The started field is currently 'bool', accessed in netdev-dpdk only
> under a mutex lock. In netdev-doca it will be used not under a lock.
> Move it to be atomic as a pre-step towards it.

Hi Eli,

Thanks for the patch, one question and comment below.

//Eelco

> Signed-off-by: Eli Britstein <[email protected]>
> ---
>  lib/netdev-dpdk-private.h | 11 ++++++++++-
>  lib/netdev-dpdk.c         | 12 +++++++-----
>  2 files changed, 17 insertions(+), 6 deletions(-)
>
> diff --git a/lib/netdev-dpdk-private.h b/lib/netdev-dpdk-private.h
> index 9b82db750..79aa2292a 100644
> --- a/lib/netdev-dpdk-private.h
> +++ b/lib/netdev-dpdk-private.h
> @@ -109,7 +109,7 @@ struct netdev_dpdk_common {
>          uint16_t port_id;
>          bool attached;
>          bool is_representor;
> -        bool started;
> +        atomic_bool started;
>          struct eth_addr hwaddr;
>          int mtu;
>          int socket_id;
> @@ -170,4 +170,13 @@ netdev_dpdk_common_cast(const struct netdev *netdev)
>      return CONTAINER_OF(netdev, struct netdev_dpdk_common, up);
>  }
>
> +static inline bool
> +dpdk_dev_is_started(struct netdev_dpdk_common *common)

I think naming should be inline with other APIs, something like;

netdev_dpdk_is_started()

> +{
> +    bool started;
> +
> +    atomic_read(&common->started, &started);

Any reason why this is not atomic_read_relaxed() (for all accesses)?
If so, please add a comment why.

> +    return started;
> +}
> +

[...]

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to