aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Fastabend <john.r.fastabend@intel.com>2011-10-19 04:48:49 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-11-02 19:55:55 -0400
commit8599e251b3dd18c7bcb342d5b4acecc420f43606 (patch)
tree54632af24a86dc2506661fa33ddc6a31ceff8b6d
parent331bcf45feb76d507a769d9d3b26ff5626804117 (diff)
ixgbe: DCB, return max for IEEE traffic classes
Returning the max traffic classes on get requests simplifies user space configurations because applications will know explicitly how many traffic classes can be used. Typical switch implementations use 2 or 3 traffic classes so this not seen often today. And user space can learn the number of traffic classes by return codes but this allows user space to configure ixgbe correctly at the start. 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>
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
index 3631d639d86a..33b93ffb87cb 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
@@ -561,11 +561,12 @@ static int ixgbe_dcbnl_ieee_getets(struct net_device *dev,
561 struct ixgbe_adapter *adapter = netdev_priv(dev); 561 struct ixgbe_adapter *adapter = netdev_priv(dev);
562 struct ieee_ets *my_ets = adapter->ixgbe_ieee_ets; 562 struct ieee_ets *my_ets = adapter->ixgbe_ieee_ets;
563 563
564 ets->ets_cap = adapter->dcb_cfg.num_tcs.pg_tcs;
565
564 /* No IEEE PFC settings available */ 566 /* No IEEE PFC settings available */
565 if (!my_ets) 567 if (!my_ets)
566 return -EINVAL; 568 return 0;
567 569
568 ets->ets_cap = adapter->dcb_cfg.num_tcs.pg_tcs;
569 ets->cbs = my_ets->cbs; 570 ets->cbs = my_ets->cbs;
570 memcpy(ets->tc_tx_bw, my_ets->tc_tx_bw, sizeof(ets->tc_tx_bw)); 571 memcpy(ets->tc_tx_bw, my_ets->tc_tx_bw, sizeof(ets->tc_tx_bw));
571 memcpy(ets->tc_rx_bw, my_ets->tc_rx_bw, sizeof(ets->tc_rx_bw)); 572 memcpy(ets->tc_rx_bw, my_ets->tc_rx_bw, sizeof(ets->tc_rx_bw));
@@ -621,11 +622,12 @@ static int ixgbe_dcbnl_ieee_getpfc(struct net_device *dev,
621 struct ieee_pfc *my_pfc = adapter->ixgbe_ieee_pfc; 622 struct ieee_pfc *my_pfc = adapter->ixgbe_ieee_pfc;
622 int i; 623 int i;
623 624
625 pfc->pfc_cap = adapter->dcb_cfg.num_tcs.pfc_tcs;
626
624 /* No IEEE PFC settings available */ 627 /* No IEEE PFC settings available */
625 if (!my_pfc) 628 if (!my_pfc)
626 return -EINVAL; 629 return 0;
627 630
628 pfc->pfc_cap = adapter->dcb_cfg.num_tcs.pfc_tcs;
629 pfc->pfc_en = my_pfc->pfc_en; 631 pfc->pfc_en = my_pfc->pfc_en;
630 pfc->mbc = my_pfc->mbc; 632 pfc->mbc = my_pfc->mbc;
631 pfc->delay = my_pfc->delay; 633 pfc->delay = my_pfc->delay;