]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ixgbe: DCB, return max for IEEE traffic classes
authorJohn Fastabend <john.r.fastabend@intel.com>
Wed, 19 Oct 2011 08:48:49 +0000 (08:48 +0000)
committerJoe Jin <joe.jin@oracle.com>
Thu, 17 May 2012 14:23:24 +0000 (22:23 +0800)
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.

(cherry picked from commit 8599e251b3dd18c7bcb342d5b4acecc420f43606)
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>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/ixgbe/ixgbe_dcb_nl.c

index 62cc6a2e10dc869316d615a2e5dc4b752fb2942e..27634c7dcdc2ead2ed14141b383fbead9d46e0f0 100644 (file)
@@ -561,11 +561,12 @@ static int ixgbe_dcbnl_ieee_getets(struct net_device *dev,
        struct ixgbe_adapter *adapter = netdev_priv(dev);
        struct ieee_ets *my_ets = adapter->ixgbe_ieee_ets;
 
+       ets->ets_cap = adapter->dcb_cfg.num_tcs.pg_tcs;
+
        /* No IEEE PFC settings available */
        if (!my_ets)
-               return -EINVAL;
+               return 0;
 
-       ets->ets_cap = adapter->dcb_cfg.num_tcs.pg_tcs;
        ets->cbs = my_ets->cbs;
        memcpy(ets->tc_tx_bw, my_ets->tc_tx_bw, sizeof(ets->tc_tx_bw));
        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,
        struct ieee_pfc *my_pfc = adapter->ixgbe_ieee_pfc;
        int i;
 
+       pfc->pfc_cap = adapter->dcb_cfg.num_tcs.pfc_tcs;
+
        /* No IEEE PFC settings available */
        if (!my_pfc)
-               return -EINVAL;
+               return 0;
 
-       pfc->pfc_cap = adapter->dcb_cfg.num_tcs.pfc_tcs;
        pfc->pfc_en = my_pfc->pfc_en;
        pfc->mbc = my_pfc->mbc;
        pfc->delay = my_pfc->delay;