aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJohn Fastabend <john.r.fastabend@intel.com>2011-02-23 00:58:03 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-03-12 07:11:53 -0500
commit24095aa347a32673cf220fc0bd0b78d28ba0a69e (patch)
tree4b7a3e37c581de6c8282b0ec0c6e2627cce32419 /drivers
parente5b646355770d34eab360ebae93c56c407dfe803 (diff)
ixgbe: enable ndo_tc_setup
This patch adds the ndo_tc_setup to ixgbe. By default we set the device to use strict priority. 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')
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 3694226462da..3ce0f4f956df 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -4606,7 +4606,10 @@ int ixgbe_setup_tc(struct net_device *dev, u8 tc)
4606 if (!tc) { 4606 if (!tc) {
4607 netdev_reset_tc(dev); 4607 netdev_reset_tc(dev);
4608 } else { 4608 } else {
4609 if (netdev_set_num_tc(dev, tc)) 4609 struct ixgbe_adapter *adapter = netdev_priv(dev);
4610
4611 /* Hardware supports up to 8 traffic classes */
4612 if (tc > MAX_TRAFFIC_CLASS || netdev_set_num_tc(dev, tc))
4610 return -EINVAL; 4613 return -EINVAL;
4611 4614
4612 /* Partition Tx queues evenly amongst traffic classes */ 4615 /* Partition Tx queues evenly amongst traffic classes */
@@ -4616,6 +4619,22 @@ int ixgbe_setup_tc(struct net_device *dev, u8 tc)
4616 netdev_set_tc_queue(dev, i, q, offset); 4619 netdev_set_tc_queue(dev, i, q, offset);
4617 offset += q; 4620 offset += q;
4618 } 4621 }
4622
4623 /* This enables multiple traffic class support in the hardware
4624 * which defaults to strict priority transmission by default.
4625 * If traffic classes are already enabled perhaps through DCB
4626 * code path then existing configuration will be used.
4627 */
4628 if (!(adapter->flags & IXGBE_FLAG_DCB_ENABLED) &&
4629 dev->dcbnl_ops && dev->dcbnl_ops->setdcbx) {
4630 struct ieee_ets ets = {
4631 .prio_tc = {0, 1, 2, 3, 4, 5, 6, 7},
4632 };
4633 u8 mode = DCB_CAP_DCBX_HOST | DCB_CAP_DCBX_VER_IEEE;
4634
4635 dev->dcbnl_ops->setdcbx(dev, mode);
4636 dev->dcbnl_ops->ieee_setets(dev, &ets);
4637 }
4619 } 4638 }
4620 return 0; 4639 return 0;
4621} 4640}
@@ -7022,6 +7041,9 @@ static const struct net_device_ops ixgbe_netdev_ops = {
7022 .ndo_set_vf_tx_rate = ixgbe_ndo_set_vf_bw, 7041 .ndo_set_vf_tx_rate = ixgbe_ndo_set_vf_bw,
7023 .ndo_get_vf_config = ixgbe_ndo_get_vf_config, 7042 .ndo_get_vf_config = ixgbe_ndo_get_vf_config,
7024 .ndo_get_stats64 = ixgbe_get_stats64, 7043 .ndo_get_stats64 = ixgbe_get_stats64,
7044#ifdef CONFIG_IXGBE_DCB
7045 .ndo_setup_tc = ixgbe_setup_tc,
7046#endif
7025#ifdef CONFIG_NET_POLL_CONTROLLER 7047#ifdef CONFIG_NET_POLL_CONTROLLER
7026 .ndo_poll_controller = ixgbe_netpoll, 7048 .ndo_poll_controller = ixgbe_netpoll,
7027#endif 7049#endif