Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ixgbe: DCB, missed translation from 8021Qaz TSA to CEE link strict

The patch below allowed IEEE 802.1Qaz and CEE DCB hardware
configurations to use common hardware set routines,

commit 88eb696cc6a7af8f9272266965b1a4dd7d6a931b
Author: John Fastabend <john.r.fastabend@intel.com>
Date: Thu Feb 10 03:02:11 2011 -0800

ixgbe: DCB, abstract out dcb_config from DCB hardware configuration

However the case when CEE link strict and group strict
are set was missed and are currently being mapped
incorrectly in some configurations.

This patch resolves this.

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>

authored by

John Fastabend and committed by
Jeff Kirsher
3b97fd69 8187cd48

+23 -25
+1 -23
drivers/net/ixgbe/ixgbe_dcb.c
··· 292 292 } 293 293 294 294 s32 ixgbe_dcb_hw_ets_config(struct ixgbe_hw *hw, 295 - u16 *refill, u16 *max, u8 *bwg_id, u8 *tsa) 295 + u16 *refill, u16 *max, u8 *bwg_id, u8 *prio_type) 296 296 { 297 - int i; 298 - u8 prio_type[IEEE_8021QAZ_MAX_TCS]; 299 - 300 - /* Map TSA onto CEE prio type */ 301 - for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) { 302 - switch (tsa[i]) { 303 - case IEEE_8021QAZ_TSA_STRICT: 304 - prio_type[i] = 2; 305 - break; 306 - case IEEE_8021QAZ_TSA_ETS: 307 - prio_type[i] = 0; 308 - break; 309 - default: 310 - /* Hardware only supports priority strict or 311 - * ETS transmission selection algorithms if 312 - * we receive some other value from dcbnl 313 - * throw an error 314 - */ 315 - return -EINVAL; 316 - } 317 - } 318 - 319 297 switch (hw->mac.type) { 320 298 case ixgbe_mac_82598EB: 321 299 ixgbe_dcb_config_rx_arbiter_82598(hw, refill, max,
+22 -2
drivers/net/ixgbe/ixgbe_dcb_nl.c
··· 642 642 { 643 643 struct ixgbe_adapter *adapter = netdev_priv(dev); 644 644 __u16 refill[IEEE_8021QAZ_MAX_TCS], max[IEEE_8021QAZ_MAX_TCS]; 645 + __u8 prio_type[IEEE_8021QAZ_MAX_TCS]; 645 646 int max_frame = dev->mtu + ETH_HLEN + ETH_FCS_LEN; 646 - int err; 647 + int i, err; 647 648 /* naively give each TC a bwg to map onto CEE hardware */ 648 649 __u8 bwg_id[IEEE_8021QAZ_MAX_TCS] = {0, 1, 2, 3, 4, 5, 6, 7}; 649 650 ··· 660 659 661 660 memcpy(adapter->ixgbe_ieee_ets, ets, sizeof(*adapter->ixgbe_ieee_ets)); 662 661 662 + /* Map TSA onto CEE prio type */ 663 + for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) { 664 + switch (ets->tc_tsa[i]) { 665 + case IEEE_8021QAZ_TSA_STRICT: 666 + prio_type[i] = 2; 667 + break; 668 + case IEEE_8021QAZ_TSA_ETS: 669 + prio_type[i] = 0; 670 + break; 671 + default: 672 + /* Hardware only supports priority strict or 673 + * ETS transmission selection algorithms if 674 + * we receive some other value from dcbnl 675 + * throw an error 676 + */ 677 + return -EINVAL; 678 + } 679 + } 680 + 663 681 ixgbe_ieee_credits(ets->tc_tx_bw, refill, max, max_frame); 664 682 err = ixgbe_dcb_hw_ets_config(&adapter->hw, refill, max, 665 - bwg_id, ets->tc_tsa); 683 + bwg_id, prio_type); 666 684 return err; 667 685 } 668 686