|
@@ -2173,6 +2173,35 @@ error:
|
|
EXPORT_SYMBOL(netif_set_xps_queue);
|
|
EXPORT_SYMBOL(netif_set_xps_queue);
|
|
|
|
|
|
#endif
|
|
#endif
|
|
|
|
+void netdev_reset_tc(struct net_device *dev)
|
|
|
|
+{
|
|
|
|
+ dev->num_tc = 0;
|
|
|
|
+ memset(dev->tc_to_txq, 0, sizeof(dev->tc_to_txq));
|
|
|
|
+ memset(dev->prio_tc_map, 0, sizeof(dev->prio_tc_map));
|
|
|
|
+}
|
|
|
|
+EXPORT_SYMBOL(netdev_reset_tc);
|
|
|
|
+
|
|
|
|
+int netdev_set_tc_queue(struct net_device *dev, u8 tc, u16 count, u16 offset)
|
|
|
|
+{
|
|
|
|
+ if (tc >= dev->num_tc)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
|
|
+ dev->tc_to_txq[tc].count = count;
|
|
|
|
+ dev->tc_to_txq[tc].offset = offset;
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+EXPORT_SYMBOL(netdev_set_tc_queue);
|
|
|
|
+
|
|
|
|
+int netdev_set_num_tc(struct net_device *dev, u8 num_tc)
|
|
|
|
+{
|
|
|
|
+ if (num_tc > TC_MAX_QUEUE)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
|
|
+ dev->num_tc = num_tc;
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+EXPORT_SYMBOL(netdev_set_num_tc);
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* Routine to help set real_num_tx_queues. To avoid skbs mapped to queues
|
|
* Routine to help set real_num_tx_queues. To avoid skbs mapped to queues
|
|
* greater then real_num_tx_queues stale skbs on the qdisc must be flushed.
|
|
* greater then real_num_tx_queues stale skbs on the qdisc must be flushed.
|