mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
netdevsim: support tc-ets offload
Extend netdevsim to accept ndo_setup_tc(TC_SETUP_QDISC_ETS) calls, so that it's possible to run tdc on ETS offload code path. Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: Davide Caratti <dcaratti@redhat.com> Link: https://patch.msgid.link/d04086cd0204d4aaf6524e972198faa1a4e5d657.1773945414.git.dcaratti@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
544921efd4
commit
abdf5133bf
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include <linux/netdevice.h>
|
||||
#include <net/pkt_sched.h>
|
||||
#include <net/pkt_cls.h>
|
||||
|
||||
#include "netdevsim.h"
|
||||
|
||||
|
|
@ -36,6 +37,25 @@ static int nsim_setup_tc_taprio(struct net_device *dev,
|
|||
return err;
|
||||
}
|
||||
|
||||
static int nsim_setup_tc_ets(struct net_device *dev,
|
||||
struct tc_ets_qopt_offload *offload)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
switch (offload->command) {
|
||||
case TC_ETS_REPLACE:
|
||||
case TC_ETS_DESTROY:
|
||||
break;
|
||||
case TC_ETS_STATS:
|
||||
_bstats_update(offload->stats.bstats, 0, 0);
|
||||
break;
|
||||
default:
|
||||
err = -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static LIST_HEAD(nsim_block_cb_list);
|
||||
|
||||
int
|
||||
|
|
@ -46,6 +66,8 @@ nsim_setup_tc(struct net_device *dev, enum tc_setup_type type, void *type_data)
|
|||
switch (type) {
|
||||
case TC_SETUP_QDISC_TAPRIO:
|
||||
return nsim_setup_tc_taprio(dev, type_data);
|
||||
case TC_SETUP_QDISC_ETS:
|
||||
return nsim_setup_tc_ets(dev, type_data);
|
||||
case TC_SETUP_BLOCK:
|
||||
return flow_block_cb_setup_simple(type_data,
|
||||
&nsim_block_cb_list,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user