[Intel-wired-lan] [PATCH net v4] iavf: Fix max_rate limiting

Sreenivas, Bharathi bharathi.sreenivas at intel.com
Tue Jul 19 11:18:55 UTC 2022



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces at osuosl.org> On Behalf Of Jun
> Zhang
> Sent: Tuesday, June 14, 2022 4:11 AM
> To: intel-wired-lan at lists.osuosl.org
> Cc: Patynowski, PrzemyslawX <przemyslawx.patynowski at intel.com>
> Subject: [Intel-wired-lan] [PATCH net v4] iavf: Fix max_rate limiting
> 
> From: Przemyslaw Patynowski <przemyslawx.patynowski at intel.com>
> 
> Fix max_rate option in tc, check for proper quanta boundaries.
> Check for minimum value provided and if it fits expected 50Mbps quanta.
> 
> Without this patch, iavf could send settings for max_rate limiting that would be
> accepted from by PF even the max_rate option is less than expected 50Mbps
> quanta. It results in no rate limiting on traffic as rate limiting will be floored to
> 0.
> 
> Example:
> tc qdisc add dev $vf root mqprio num_tc 3 map 0 2 1 queues \
> 2 at 0 2 at 2 2 at 4 hw 1 mode channel shaper bw_rlimit \ max_rate 50Mbps
> 500Mbps 500Mbps
> 
> Should limit TC0 to circa 50 Mbps
> 
> tc qdisc add dev $vf root mqprio num_tc 3 map 0 2 1 queues \
> 2 at 0 2 at 2 2 at 4 hw 1 mode channel shaper bw_rlimit \ max_rate 0Mbps
> 100Kbit 500Mbps
> 
> Should return error
> 
> Fixes: d5b33d024496 ("i40evf: add ndo_setup_tc callback to i40evf")
> Signed-off-by: Przemyslaw Patynowski <przemyslawx.patynowski at intel.com>
> Signed-off-by: Jun Zhang <xuejun.zhang at intel.com>
> ---
> v2: Change author to Przemyslaw, and change variable to RCT
> v3: Add space between title & commit message body
> v4: Change Fixes Tag to 12 Char Format
> ---
>  drivers/net/ethernet/intel/iavf/iavf.h      |  1 +
>  drivers/net/ethernet/intel/iavf/iavf_main.c | 24 +++++++++++++++++++--
>  2 files changed, 23 insertions(+), 2 deletions(-)
> 
Tested-by: Bharathi Sreenivas <bharathi.sreenivas at intel.com>


More information about the Intel-wired-lan mailing list