|
@@ -1835,25 +1835,26 @@ static u16 netcp_select_queue(struct net_device *dev, struct sk_buff *skb,
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-static int netcp_setup_tc(struct net_device *dev, u32 handle, u8 num_tc)
|
|
|
+static int netcp_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
|
|
|
+ struct tc_to_netdev tc)
|
|
|
{
|
|
|
int i;
|
|
|
|
|
|
/* setup tc must be called under rtnl lock */
|
|
|
ASSERT_RTNL();
|
|
|
|
|
|
- if (handle != TC_H_ROOT)
|
|
|
+ if (handle != TC_H_ROOT || tc->type != TC_SETUP_MQPRIO)
|
|
|
return -EINVAL;
|
|
|
|
|
|
/* Sanity-check the number of traffic classes requested */
|
|
|
if ((dev->real_num_tx_queues <= 1) ||
|
|
|
- (dev->real_num_tx_queues < num_tc))
|
|
|
+ (dev->real_num_tx_queues < tc->tc))
|
|
|
return -EINVAL;
|
|
|
|
|
|
/* Configure traffic class to queue mappings */
|
|
|
- if (num_tc) {
|
|
|
- netdev_set_num_tc(dev, num_tc);
|
|
|
- for (i = 0; i < num_tc; i++)
|
|
|
+ if (tc->tc) {
|
|
|
+ netdev_set_num_tc(dev, tc->tc);
|
|
|
+ for (i = 0; i < tc->tc; i++)
|
|
|
netdev_set_tc_queue(dev, i, 1, i);
|
|
|
} else {
|
|
|
netdev_reset_tc(dev);
|