Commit 58f89273 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

net: sched: set TCQ_F_OFFLOADED flag for MQ

PRIO and RED mark the qdisc with TCQ_F_OFFLOADED upon successful offload,
make MQ do the same.  The consistency will help with consistent
graft callback behaviour.
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: default avatarJohn Hurley <john.hurley@netronome.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dad54c0f
...@@ -38,9 +38,8 @@ static int mq_offload(struct Qdisc *sch, enum tc_mq_command cmd) ...@@ -38,9 +38,8 @@ static int mq_offload(struct Qdisc *sch, enum tc_mq_command cmd)
return dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_QDISC_MQ, &opt); return dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_QDISC_MQ, &opt);
} }
static void mq_offload_stats(struct Qdisc *sch) static int mq_offload_stats(struct Qdisc *sch)
{ {
struct net_device *dev = qdisc_dev(sch);
struct tc_mq_qopt_offload opt = { struct tc_mq_qopt_offload opt = {
.command = TC_MQ_STATS, .command = TC_MQ_STATS,
.handle = sch->handle, .handle = sch->handle,
...@@ -50,8 +49,7 @@ static void mq_offload_stats(struct Qdisc *sch) ...@@ -50,8 +49,7 @@ static void mq_offload_stats(struct Qdisc *sch)
}, },
}; };
if (tc_can_offload(dev) && dev->netdev_ops->ndo_setup_tc) return qdisc_offload_dump_helper(sch, TC_SETUP_QDISC_MQ, &opt);
dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_QDISC_MQ, &opt);
} }
static void mq_destroy(struct Qdisc *sch) static void mq_destroy(struct Qdisc *sch)
...@@ -171,9 +169,8 @@ static int mq_dump(struct Qdisc *sch, struct sk_buff *skb) ...@@ -171,9 +169,8 @@ static int mq_dump(struct Qdisc *sch, struct sk_buff *skb)
spin_unlock_bh(qdisc_lock(qdisc)); spin_unlock_bh(qdisc_lock(qdisc));
} }
mq_offload_stats(sch);
return 0; return mq_offload_stats(sch);
} }
static struct netdev_queue *mq_queue_get(struct Qdisc *sch, unsigned long cl) static struct netdev_queue *mq_queue_get(struct Qdisc *sch, unsigned long cl)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment