aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netdevsim/netdevsim.h
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2020-03-30 22:38:20 +0300
committerDavid S. Miller <davem@davemloft.net>2020-03-30 17:54:58 -0700
commitad188458d0123d4e116f14f7eab73d644aed149f (patch)
tree8f18f217a1b333c68cfaaa8da3ce523b681b1767 /drivers/net/netdevsim/netdevsim.h
parentDocumentation: Add description of packet trap policers (diff)
downloadlinux-dev-ad188458d0123d4e116f14f7eab73d644aed149f.tar.xz
linux-dev-ad188458d0123d4e116f14f7eab73d644aed149f.zip
netdevsim: Add devlink-trap policer support
Register three dummy packet trap policers with devlink and implement callbacks to change their parameters and read their counters. This will be used later on in the series to test the devlink-trap policer infrastructure. v2: * Remove check about burst size being a power of 2 and instead add a debugfs knob to fail the operation * Provide max/min rate/burst size when registering policers and remove the validity checks from nsim_dev_devlink_trap_policer_set() Signed-off-by: Ido Schimmel <idosch@mellanox.com> Reviewed-by: Jiri Pirko <jiri@mellanox.com> Reviewed-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netdevsim/netdevsim.h')
-rw-r--r--drivers/net/netdevsim/netdevsim.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/netdevsim/netdevsim.h b/drivers/net/netdevsim/netdevsim.h
index e46fc565b981..3d37df5057e8 100644
--- a/drivers/net/netdevsim/netdevsim.h
+++ b/drivers/net/netdevsim/netdevsim.h
@@ -180,6 +180,8 @@ struct nsim_dev {
struct nsim_dev_health health;
struct flow_action_cookie *fa_cookie;
spinlock_t fa_cookie_lock; /* protects fa_cookie */
+ bool fail_trap_policer_set;
+ bool fail_trap_policer_counter_get;
};
static inline struct net *nsim_dev_net(struct nsim_dev *nsim_dev)