mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-03 21:01:50 +00:00
net: sched: add an offload dump helper
Qdisc dump operation of offload-capable qdiscs performs a few extra steps which are identical among all the qdiscs. Add a helper to share this code. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: John Hurley <john.hurley@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
80b6265c0f
commit
b592843c67
4 changed files with 35 additions and 31 deletions
|
@ -810,6 +810,27 @@ void qdisc_tree_reduce_backlog(struct Qdisc *sch, unsigned int n,
|
|||
}
|
||||
EXPORT_SYMBOL(qdisc_tree_reduce_backlog);
|
||||
|
||||
int qdisc_offload_dump_helper(struct Qdisc *sch, enum tc_setup_type type,
|
||||
void *type_data)
|
||||
{
|
||||
struct net_device *dev = qdisc_dev(sch);
|
||||
int err;
|
||||
|
||||
sch->flags &= ~TCQ_F_OFFLOADED;
|
||||
if (!tc_can_offload(dev) || !dev->netdev_ops->ndo_setup_tc)
|
||||
return 0;
|
||||
|
||||
err = dev->netdev_ops->ndo_setup_tc(dev, type, type_data);
|
||||
if (err == -EOPNOTSUPP)
|
||||
return 0;
|
||||
|
||||
if (!err)
|
||||
sch->flags |= TCQ_F_OFFLOADED;
|
||||
|
||||
return err;
|
||||
}
|
||||
EXPORT_SYMBOL(qdisc_offload_dump_helper);
|
||||
|
||||
static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid,
|
||||
u32 portid, u32 seq, u16 flags, int event)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue