mirror_ubuntu-kernels/drivers/net/ethernet/intel
Przemyslaw Patynowski ec60d54cb9 iavf: Fix max_rate limiting
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@0 2@2 2@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@0 2@2 2@4 hw 1 mode channel shaper bw_rlimit \
max_rate 0Mbps 100Kbit 500Mbps

Should return error

Fixes: d5b33d0244 ("i40evf: add ndo_setup_tc callback to i40evf")
Signed-off-by: Przemyslaw Patynowski <przemyslawx.patynowski@intel.com>
Signed-off-by: Jun Zhang <xuejun.zhang@intel.com>
Tested-by: Bharathi Sreenivas <bharathi.sreenivas@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2022-07-29 08:45:31 -07:00
..
e1000 e1000: switch to napi_build_skb() 2021-12-28 09:42:25 -08:00
e1000e Revert "e1000e: Fix possible HW unit hang after an s0ix exit" 2022-07-14 09:17:21 -07:00
fm10k fm10k: Fix syntax errors in comments 2021-12-21 09:17:47 -08:00
i40e i40e: Fix interface init with MSI interrupts (no MSI-X) 2022-07-25 18:48:41 -07:00
iavf iavf: Fix max_rate limiting 2022-07-29 08:45:31 -07:00
ice ice: do not setup vlan for loopback VSI 2022-07-26 13:15:36 -07:00
igb igb: Make DMA faster when CPU is active on the PCIe link 2022-06-22 18:46:24 -07:00
igbvf igbvf: Remove useless DMA-32 fallback configuration 2022-01-27 08:58:24 -08:00
igc igc: Reinstate IGC_REMOVED logic and implement it properly 2022-07-14 09:18:02 -07:00
ixgb ixgb: Remove useless DMA-32 fallback configuration 2022-01-27 08:58:23 -08:00
ixgbe ixgbe: Add locking to prevent panic when setting sriov_numvfs to zero 2022-07-18 20:13:40 -07:00
ixgbevf ixgbe: propagate XFRM offload state direction instead of flags 2022-05-06 08:32:52 +02:00
e100.c eth: switch to netif_napi_add_weight() 2022-05-08 11:33:57 +01:00
Kconfig ice: support crosstimestamping on E822 devices if supported 2021-12-21 09:11:40 -08:00
Makefile