aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.c
diff options
context:
space:
mode:
authorJohn Fastabend <john.r.fastabend@intel.com>2011-08-04 01:47:07 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-09-23 12:05:49 -0400
commit4c09f3a0674119504af4e5805b327213055c412f (patch)
tree645b923b51696deee6066f5a7690b35700729f02 /drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.c
parentc6bda30a06d925b68d86e61c289d3ce980d4a36c (diff)
ixgbe: DCB, do not call set_state() from IEEE mode
The DCB CEE command set_state() will complete successfully but is misleading because it enables IEEE mode. After this patch the command is failed. And IEEE PFC/ETS is managed from ieee paths now instead of using CEE primitives. Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.c')
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.c
index 9d88c31487bc..83bf7cc3fbf0 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.c
@@ -40,7 +40,8 @@
40 * hardware. The IEEE 802.1Qaz specification do not use bandwidth 40 * hardware. The IEEE 802.1Qaz specification do not use bandwidth
41 * groups so this is much simplified from the CEE case. 41 * groups so this is much simplified from the CEE case.
42 */ 42 */
43s32 ixgbe_ieee_credits(__u8 *bw, __u16 *refill, __u16 *max, int max_frame) 43static s32 ixgbe_ieee_credits(__u8 *bw, __u16 *refill,
44 __u16 *max, int max_frame)
44{ 45{
45 int min_percent = 100; 46 int min_percent = 100;
46 int min_credit, multiplier; 47 int min_credit, multiplier;
@@ -291,6 +292,39 @@ s32 ixgbe_dcb_hw_pfc_config(struct ixgbe_hw *hw, u8 pfc_en)
291 return ret; 292 return ret;
292} 293}
293 294
295s32 ixgbe_dcb_hw_ets(struct ixgbe_hw *hw, struct ieee_ets *ets, int max_frame)
296{
297 __u16 refill[IEEE_8021QAZ_MAX_TCS], max[IEEE_8021QAZ_MAX_TCS];
298 __u8 prio_type[IEEE_8021QAZ_MAX_TCS];
299 int i;
300
301 /* naively give each TC a bwg to map onto CEE hardware */
302 __u8 bwg_id[IEEE_8021QAZ_MAX_TCS] = {0, 1, 2, 3, 4, 5, 6, 7};
303
304 /* Map TSA onto CEE prio type */
305 for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) {
306 switch (ets->tc_tsa[i]) {
307 case IEEE_8021QAZ_TSA_STRICT:
308 prio_type[i] = 2;
309 break;
310 case IEEE_8021QAZ_TSA_ETS:
311 prio_type[i] = 0;
312 break;
313 default:
314 /* Hardware only supports priority strict or
315 * ETS transmission selection algorithms if
316 * we receive some other value from dcbnl
317 * throw an error
318 */
319 return -EINVAL;
320 }
321 }
322
323 ixgbe_ieee_credits(ets->tc_tx_bw, refill, max, max_frame);
324 return ixgbe_dcb_hw_ets_config(hw, refill, max,
325 bwg_id, prio_type, ets->prio_tc);
326}
327
294s32 ixgbe_dcb_hw_ets_config(struct ixgbe_hw *hw, 328s32 ixgbe_dcb_hw_ets_config(struct ixgbe_hw *hw,
295 u16 *refill, u16 *max, u8 *bwg_id, 329 u16 *refill, u16 *max, u8 *bwg_id,
296 u8 *prio_type, u8 *prio_tc) 330 u8 *prio_type, u8 *prio_tc)