summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ice/ice_ptp.h
diff options
context:
space:
mode:
authorMichal Jaron <michalx.jaron@intel.com>2022-09-01 09:49:33 +0200
committerTony Nguyen <anthony.l.nguyen@intel.com>2022-09-19 14:13:06 -0700
commit198eb7e1b81d8ba676d0f4f120c092032ae69a8e (patch)
treeef9f13aa7d1d2709b40304d5b34149837242b56b /drivers/net/ethernet/intel/ice/ice_ptp.h
parent372539def2824c43b6afe2403045b140f65c5acc (diff)
downloadlinux-stable-198eb7e1b81d8ba676d0f4f120c092032ae69a8e.tar.gz
linux-stable-198eb7e1b81d8ba676d0f4f120c092032ae69a8e.tar.bz2
linux-stable-198eb7e1b81d8ba676d0f4f120c092032ae69a8e.zip
i40e: Fix set max_tx_rate when it is lower than 1 Mbps
While converting max_tx_rate from bytes to Mbps, this value was set to 0, if the original value was lower than 125000 bytes (1 Mbps). This would cause no transmission rate limiting to occur. This happened due to lack of check of max_tx_rate against the 1 Mbps value for max_tx_rate and the following division by 125000. Fix this issue by adding a helper i40e_bw_bytes_to_mbits() which sets max_tx_rate to minimum usable value of 50 Mbps, if its value is less than 1 Mbps, otherwise do the required conversion by dividing by 125000. Fixes: 5ecae4120a6b ("i40e: Refactor VF BW rate limiting") Signed-off-by: Michal Jaron <michalx.jaron@intel.com> Signed-off-by: Andrii Staikov <andrii.staikov@intel.com> Tested-by: Bharathi Sreenivas <bharathi.sreenivas@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_ptp.h')
0 files changed, 0 insertions, 0 deletions