diff options
author | Anirudh Venkataramanan <anirudh.venkataramanan@intel.com> | 2019-02-28 18:24:27 -0500 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2019-04-18 11:38:47 -0400 |
commit | a629cf0a018b8d80b65bfd2b7f0d209a52834315 (patch) | |
tree | 384e6b27df69d658e89dd72bfac4d27e873dad00 /drivers/net/ethernet/intel/ice/ice_dcb_lib.c | |
parent | 00cc3f1b3a3011b5fee9711244ffcec418b519f0 (diff) |
ice: Update rings based on TC information
This patch adds a new function ice_vsi_cfg_dcb_rings which updates a
VSI's rings based on DCB traffic class information.
Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_dcb_lib.c')
-rw-r--r-- | drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 38 |
1 files changed, 38 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 6bbca2c99dbd..aabba91189bd 100644 --- a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c | |||
@@ -58,6 +58,44 @@ u8 ice_dcb_get_num_tc(struct ice_dcbx_cfg *dcbcfg) | |||
58 | } | 58 | } |
59 | 59 | ||
60 | /** | 60 | /** |
61 | * ice_vsi_cfg_dcb_rings - Update rings to reflect DCB TC | ||
62 | * @vsi: VSI owner of rings being updated | ||
63 | */ | ||
64 | void ice_vsi_cfg_dcb_rings(struct ice_vsi *vsi) | ||
65 | { | ||
66 | struct ice_ring *tx_ring, *rx_ring; | ||
67 | u16 qoffset, qcount; | ||
68 | int i, n; | ||
69 | |||
70 | if (!test_bit(ICE_FLAG_DCB_ENA, vsi->back->flags)) { | ||
71 | /* Reset the TC information */ | ||
72 | for (i = 0; i < vsi->num_txq; i++) { | ||
73 | tx_ring = vsi->tx_rings[i]; | ||
74 | tx_ring->dcb_tc = 0; | ||
75 | } | ||
76 | for (i = 0; i < vsi->num_rxq; i++) { | ||
77 | rx_ring = vsi->rx_rings[i]; | ||
78 | rx_ring->dcb_tc = 0; | ||
79 | } | ||
80 | return; | ||
81 | } | ||
82 | |||
83 | ice_for_each_traffic_class(n) { | ||
84 | if (!(vsi->tc_cfg.ena_tc & BIT(n))) | ||
85 | break; | ||
86 | |||
87 | qoffset = vsi->tc_cfg.tc_info[n].qoffset; | ||
88 | qcount = vsi->tc_cfg.tc_info[n].qcount_tx; | ||
89 | for (i = qoffset; i < (qoffset + qcount); i++) { | ||
90 | tx_ring = vsi->tx_rings[i]; | ||
91 | rx_ring = vsi->rx_rings[i]; | ||
92 | tx_ring->dcb_tc = n; | ||
93 | rx_ring->dcb_tc = n; | ||
94 | } | ||
95 | } | ||
96 | } | ||
97 | |||
98 | /** | ||
61 | * ice_pf_dcb_recfg - Reconfigure all VEBs and VSIs | 99 | * ice_pf_dcb_recfg - Reconfigure all VEBs and VSIs |
62 | * @pf: pointer to the PF struct | 100 | * @pf: pointer to the PF struct |
63 | * | 101 | * |