On Fri, Sep 25, 2026 at 12:44:10PM +0200, Björn Töpel wrote:
> Memory-provider queue configuration is validated when the provider is
> bound. A later ethtool ring change may invalidate it because drivers
> can size queue memory from both ring depth and RX page size. The fbnic
> consumer is added in the following patch.
> 
> Keep configured RX ring depths in netdev_config and stage proposed
> values in cfg_pending. Validate every RX queue before calling the
> driver. Each check validates the device defaults, then any queue
> memory-provider override. Commit the values only after the driver
> accepts them.
> 
> Drivers which consume stored ring depths through queue configuration
> must initialize every RX depth before registering the netdev. Stored
> values override callback defaults, including when zero.
> 
> The callback receives a rendered configuration rather than a queue ID.
> Validation should depend on the configuration, not queue identity.
> Checking defaults also covers the case where every queue has a
> memory-provider override.
> 
> Drivers may normalize ring depths when applying them. Require the
> validation callback to use the same normalization. Drivers must report
> the applied depths through the ethtool_ringparam argument so the core
> records the result.
> 
> Use the same transaction for ioctl and netlink. Drivers without
> ndo_validate_qcfg skip the new validation.
> 
> Link: https://lore.kernel.org/all/[email protected]/
> 
> Signed-off-by: Björn Töpel <[email protected]>
> ---
>  include/linux/ethtool.h     |  4 ++-
>  include/net/netdev_queues.h | 56 ++++++++++++++++++++++++++++++++-----
>  net/core/dev.h              |  2 ++
>  net/core/netdev_config.c    | 38 +++++++++++++++++++++++--
>  net/ethtool/common.c        |  8 ++++++
>  net/ethtool/common.h        |  2 ++
>  net/ethtool/ioctl.c         | 24 ++++++++++++++--
>  net/ethtool/rings.c         | 13 ++++++++-
>  8 files changed, 133 insertions(+), 14 deletions(-)
>

Reviewed-by: Joe Damato <[email protected]>

Reply via email to