aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2008-11-21 00:08:19 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-21 00:08:19 -0500
commit33dbabc4a7f7bd72313c73a3c199f31f3900336f (patch)
treef56e24fec9369ca1d1ef12eb18e4000a09fb5c3e /drivers/net/ixgbe
parent46132188bf72e22ef097f16ed5c969ee8cea1e8b (diff)
DCB: Add interface to query # of TCs supported by device
Adds interface for Data Center Bridging (DCB) to query (and set if supported) the number of traffic classes currently supported by the device for the two (DCB) features: priority groups (PG) and priority flow control (PFC). Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ixgbe')
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb_nl.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c
index eb3a6cea1aaa..5921795f8403 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c
@@ -376,6 +376,35 @@ static u8 ixgbe_dcbnl_getcap(struct net_device *netdev, int capid, u8 *cap)
376 return rval; 376 return rval;
377} 377}
378 378
379static u8 ixgbe_dcbnl_getnumtcs(struct net_device *netdev, int tcid, u8 *num)
380{
381 struct ixgbe_adapter *adapter = netdev_priv(netdev);
382 u8 rval = 0;
383
384 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
385 switch (tcid) {
386 case DCB_NUMTCS_ATTR_PG:
387 *num = MAX_TRAFFIC_CLASS;
388 break;
389 case DCB_NUMTCS_ATTR_PFC:
390 *num = MAX_TRAFFIC_CLASS;
391 break;
392 default:
393 rval = -EINVAL;
394 break;
395 }
396 } else {
397 rval = -EINVAL;
398 }
399
400 return rval;
401}
402
403static u8 ixgbe_dcbnl_setnumtcs(struct net_device *netdev, int tcid, u8 num)
404{
405 return -EINVAL;
406}
407
379struct dcbnl_rtnl_ops dcbnl_ops = { 408struct dcbnl_rtnl_ops dcbnl_ops = {
380 .getstate = ixgbe_dcbnl_get_state, 409 .getstate = ixgbe_dcbnl_get_state,
381 .setstate = ixgbe_dcbnl_set_state, 410 .setstate = ixgbe_dcbnl_set_state,
@@ -391,6 +420,8 @@ struct dcbnl_rtnl_ops dcbnl_ops = {
391 .setpfccfg = ixgbe_dcbnl_set_pfc_cfg, 420 .setpfccfg = ixgbe_dcbnl_set_pfc_cfg,
392 .getpfccfg = ixgbe_dcbnl_get_pfc_cfg, 421 .getpfccfg = ixgbe_dcbnl_get_pfc_cfg,
393 .setall = ixgbe_dcbnl_set_all, 422 .setall = ixgbe_dcbnl_set_all,
394 .getcap = ixgbe_dcbnl_getcap 423 .getcap = ixgbe_dcbnl_getcap,
424 .getnumtcs = ixgbe_dcbnl_getnumtcs,
425 .setnumtcs = ixgbe_dcbnl_setnumtcs
395}; 426};
396 427