Re: [PATCH net-next 10/10] net/mlx5e: Enable the data direct netdev feature
From: Mina Almasry
Date: Fri Oct 09 2026 - 19:56:56 EST
On Thu, Oct 8, 2026 at 6:28 AM Tariq Toukan <tariqt@xxxxxxxxxx> wrote:
> From: Dragos Tatulea <dtatulea@xxxxxxxxxx>
>
> + /* Changing the flag reopens the channels with a different DMA device,
> + * which would break any dmabuf currently bound to this netdev.
> + */
> + if (netdev_has_dmabuf_binding(netdev, NULL)) {
> + netdev_err(netdev, "Can't change data_direct while dmabufs are bound\n");
> + return -EBUSY;
> + }
> +
> + new_params = priv->channels.params;
> + MLX5E_SET_PFLAG(&new_params, MLX5E_PFLAG_DATA_DIRECT, enable);
> +
> + return mlx5e_safe_switch_params(priv, &new_params, NULL, NULL, true);
(Note: LLM-assisted review comment below.)
set_pflag_data_direct() is called under rtnl_lock() only, whereas
netdev_nl_bind_rx_doit() and netdev_nl_bind_tx_doit() serialize bindings under
netdev_lock(netdev) without holding rtnl_lock().
Should set_pflag_data_direct() hold netdev_lock(netdev) across both
netdev_has_dmabuf_binding() and mlx5e_safe_switch_params() (just as
mlx5e_data_direct_event() does in patch 08/10) so a concurrent bind-rx/bind-tx
cannot race past the -EBUSY check while channels are switching DMA devices?
--
Thanks,
Mina