diff options
| author | Usha Ketineni <[email protected]> | 2019-11-06 10:05:28 +0000 |
|---|---|---|
| committer | Jeff Kirsher <[email protected]> | 2019-11-08 19:58:49 +0000 |
| commit | 1ddef455f4a8ba6374ce6a3ec88c815b3d4a4ad2 (patch) | |
| tree | afd7a9d721b6431d4594fe2c22b301e63d6078ce /drivers/net/ethernet/intel/ice/ice_dcb_lib.c | |
| parent | ice: Use ice_ena_vsi and ice_dis_vsi in DCB configuration flow (diff) | |
| download | kernel-1ddef455f4a8ba6374ce6a3ec88c815b3d4a4ad2.tar.gz kernel-1ddef455f4a8ba6374ce6a3ec88c815b3d4a4ad2.zip | |
ice: Add NDO callback to set the maximum per-queue bitrate
Allow for rate limiting Tx queues. Bitrate is set in
Mbps(megabits per second).
Mbps max-rate is set for the queue via sysfs:
/sys/class/net/<iface>/queues/tx-<queue>/tx_maxrate
ex: echo 100 >/sys/class/net/ens7/queues/tx-0/tx_maxrate
echo 200 >/sys/class/net/ens7/queues/tx-1/tx_maxrate
Note: A value of zero for tx_maxrate means disabled,
default is disabled.
Signed-off-by: Usha Ketineni <[email protected]>
Co-developed-by: Tarun Singh <[email protected]>
Signed-off-by: Tarun Singh <[email protected]>
Signed-off-by: Tony Nguyen <[email protected]>
Tested-by: Andrew Bowers <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_dcb_lib.c')
| -rw-r--r-- | drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c index baea28c712ee..c00c68bacadb 100644 --- a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c @@ -102,6 +102,16 @@ u8 ice_dcb_get_num_tc(struct ice_dcbx_cfg *dcbcfg) } /** + * ice_dcb_get_tc - Get the TC associated with the queue + * @vsi: ptr to the VSI + * @queue_index: queue number associated with VSI + */ +u8 ice_dcb_get_tc(struct ice_vsi *vsi, int queue_index) +{ + return vsi->tx_rings[queue_index]->dcb_tc; +} + +/** * ice_vsi_cfg_dcb_rings - Update rings to reflect DCB TC * @vsi: VSI owner of rings being updated */ |
