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

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>

authored by

John Fastabend and committed by
Jeff Kirsher
24095aa3 e5b64635

+23 -1
+23 -1
drivers/net/ixgbe/ixgbe_main.c
··· 4606 4606 if (!tc) { 4607 4607 netdev_reset_tc(dev); 4608 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 4613 return -EINVAL; 4611 4614 4612 4615 /* Partition Tx queues evenly amongst traffic classes */ ··· 4618 4615 netdev_set_prio_tc_map(dev, i, i); 4619 4616 netdev_set_tc_queue(dev, i, q, offset); 4620 4617 offset += q; 4618 + } 4619 + 4620 + /* This enables multiple traffic class support in the hardware 4621 + * which defaults to strict priority transmission by default. 4622 + * If traffic classes are already enabled perhaps through DCB 4623 + * code path then existing configuration will be used. 4624 + */ 4625 + if (!(adapter->flags & IXGBE_FLAG_DCB_ENABLED) && 4626 + dev->dcbnl_ops && dev->dcbnl_ops->setdcbx) { 4627 + struct ieee_ets ets = { 4628 + .prio_tc = {0, 1, 2, 3, 4, 5, 6, 7}, 4629 + }; 4630 + u8 mode = DCB_CAP_DCBX_HOST | DCB_CAP_DCBX_VER_IEEE; 4631 + 4632 + dev->dcbnl_ops->setdcbx(dev, mode); 4633 + dev->dcbnl_ops->ieee_setets(dev, &ets); 4621 4634 } 4622 4635 } 4623 4636 return 0; ··· 7041 7022 .ndo_set_vf_tx_rate = ixgbe_ndo_set_vf_bw, 7042 7023 .ndo_get_vf_config = ixgbe_ndo_get_vf_config, 7043 7024 .ndo_get_stats64 = ixgbe_get_stats64, 7025 + #ifdef CONFIG_IXGBE_DCB 7026 + .ndo_setup_tc = ixgbe_setup_tc, 7027 + #endif 7044 7028 #ifdef CONFIG_NET_POLL_CONTROLLER 7045 7029 .ndo_poll_controller = ixgbe_netpoll, 7046 7030 #endif