aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_generic.c
diff options
context:
space:
mode:
authorJohn Fastabend <john.r.fastabend@intel.com>2011-01-17 03:06:09 -0500
committerDavid S. Miller <davem@davemloft.net>2011-01-20 02:31:11 -0500
commitb8970f0bfc78103cb74c66055de7379b15097840 (patch)
treea85578cddfd506e049af0c78a56dd0ee342fc93b /net/sched/sch_generic.c
parent4f57c087de9b46182545676d2c594120a20f2e58 (diff)
net_sched: implement a root container qdisc sch_mqprio
This implements a mqprio queueing discipline that by default creates a pfifo_fast qdisc per tx queue and provides the needed configuration interface. Using the mqprio qdisc the number of tcs currently in use along with the range of queues alloted to each class can be configured. By default skbs are mapped to traffic classes using the skb priority. This mapping is configurable. Configurable parameters, struct tc_mqprio_qopt { __u8 num_tc; __u8 prio_tc_map[TC_BITMASK + 1]; __u8 hw; __u16 count[TC_MAX_QUEUE]; __u16 offset[TC_MAX_QUEUE]; }; Here the count/offset pairing give the queue alignment and the prio_tc_map gives the mapping from skb->priority to tc. The hw bit determines if the hardware should configure the count and offset values. If the hardware bit is set then the operation will fail if the hardware does not implement the ndo_setup_tc operation. This is to avoid undetermined states where the hardware may or may not control the queue mapping. Also minimal bounds checking is done on the count/offset to verify a queue does not exceed num_tx_queues and that queue ranges do not overlap. Otherwise it is left to user policy or hardware configuration to create useful mappings. It is expected that hardware QOS schemes can be implemented by creating appropriate mappings of queues in ndo_tc_setup(). One expected use case is drivers will use the ndo_setup_tc to map queue ranges onto 802.1Q traffic classes. This provides a generic mechanism to map network traffic onto these traffic classes and removes the need for lower layer drivers to know specifics about traffic types. Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_generic.c')
-rw-r--r--net/sched/sch_generic.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 34dc598440a2..723b27849a50 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -540,6 +540,7 @@ struct Qdisc_ops pfifo_fast_ops __read_mostly = {
540 .dump = pfifo_fast_dump, 540 .dump = pfifo_fast_dump,
541 .owner = THIS_MODULE, 541 .owner = THIS_MODULE,
542}; 542};
543EXPORT_SYMBOL(pfifo_fast_ops);
543 544
544struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue, 545struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
545 struct Qdisc_ops *ops) 546 struct Qdisc_ops *ops)
@@ -674,6 +675,7 @@ struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue,
674 675
675 return oqdisc; 676 return oqdisc;
676} 677}
678EXPORT_SYMBOL(dev_graft_qdisc);
677 679
678static void attach_one_default_qdisc(struct net_device *dev, 680static void attach_one_default_qdisc(struct net_device *dev,
679 struct netdev_queue *dev_queue, 681 struct netdev_queue *dev_queue,
@@ -761,6 +763,7 @@ void dev_activate(struct net_device *dev)
761 dev_watchdog_up(dev); 763 dev_watchdog_up(dev);
762 } 764 }
763} 765}
766EXPORT_SYMBOL(dev_activate);
764 767
765static void dev_deactivate_queue(struct net_device *dev, 768static void dev_deactivate_queue(struct net_device *dev,
766 struct netdev_queue *dev_queue, 769 struct netdev_queue *dev_queue,
@@ -840,6 +843,7 @@ void dev_deactivate(struct net_device *dev)
840 list_add(&dev->unreg_list, &single); 843 list_add(&dev->unreg_list, &single);
841 dev_deactivate_many(&single); 844 dev_deactivate_many(&single);
842} 845}
846EXPORT_SYMBOL(dev_deactivate);
843 847
844static void dev_init_scheduler_queue(struct net_device *dev, 848static void dev_init_scheduler_queue(struct net_device *dev,
845 struct netdev_queue *dev_queue, 849 struct netdev_queue *dev_queue,