On Thu, Sep 04, 2025 at 12:43:05AM +0300, [email protected] wrote: > From: Mohammad Heib <[email protected]> > > Currently the i40e driver enforces its own internally calculated per-VF MAC > filter limit, derived from the number of allocated VFs and available > hardware resources. This limit is not configurable by the administrator, > which makes it difficult to control how many MAC addresses each VF may > use. > > This patch adds support for the new generic devlink runtime parameter > "max_mac_per_vf" which provides administrators with a way to cap the > number of MAC addresses a VF can use: > > - When the parameter is set to 0 (default), the driver continues to use > its internally calculated limit. > > - When set to a non-zero value, the driver applies this value as a strict > cap for VFs, overriding the internal calculation. > > Important notes: > > - The configured value is a theoretical maximum. Hardware limits may > still prevent additional MAC addresses from being added, even if the > parameter allows it. > > - Since MAC filters are a shared hardware resource across all VFs, > setting a high value may cause resource contention and starve other > VFs. > > - This change gives administrators predictable and flexible control over > VF resource allocation, while still respecting hardware limitations. > > - Previous discussion about this change: > https://lore.kernel.org/netdev/[email protected] > https://lore.kernel.org/netdev/[email protected] > > Signed-off-by: Mohammad Heib <[email protected]> > --- > Documentation/networking/devlink/i40e.rst | 32 +++++++++++++ > drivers/net/ethernet/intel/i40e/i40e.h | 4 ++ > .../net/ethernet/intel/i40e/i40e_devlink.c | 48 ++++++++++++++++++- > .../ethernet/intel/i40e/i40e_virtchnl_pf.c | 31 ++++++++---- > 4 files changed, 105 insertions(+), 10 deletions(-) > > diff --git a/Documentation/networking/devlink/i40e.rst > b/Documentation/networking/devlink/i40e.rst > index d3cb5bb5197e..524524fdd3de 100644 > --- a/Documentation/networking/devlink/i40e.rst > +++ b/Documentation/networking/devlink/i40e.rst > @@ -7,6 +7,38 @@ i40e devlink support > This document describes the devlink features implemented by the ``i40e`` > device driver. > > +Parameters > +========== > + > +.. list-table:: Generic parameters implemented > + :widths: 5 5 90 > + > + * - Name > + - Mode > + - Notes > + * - ``max_mac_per_vf`` > + - runtime > + - Controls the maximum number of MAC addresses a VF can use > + on i40e devices. > + > + By default (``0``), the driver enforces its internally calculated > per-VF > + MAC filter limit, which is based on the number of allocated VFS. > + > + If set to a non-zero value, this parameter acts as a strict cap: > + the driver will use the user-provided value instead of its internal > + calculation. > + > + **Important notes:** > + - MAC filters are a **shared hardware resource** across all VFs.
Sorry for not noticing this before sending my previous response. make htmldocs is unhappy about the line above. Could you look into it? .../i40e.rst:33: ERROR: Unexpected indentation. [docutils] > + Setting a high value may cause other VFs to be starved of filters. > + > + - This value is a **theoretical maximum**. The hardware may return > + errors when its absolute limit is reached, regardless of the value > + set here. > + > + The default value is ``0`` (internal calculation is used). > + > + ...
