summaryrefslogtreecommitdiffstats
path: root/drivers/net/netdevsim/netdevsim.h
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2020-09-25 17:56:42 -0700
committerDavid S. Miller <davem@davemloft.net>2020-09-28 12:50:12 -0700
commitdc9c07537cf200279c357b444a49df8c11f006fd (patch)
tree0e733c40c00af2e2eaf6760a911f25d12a2d729d /drivers/net/netdevsim/netdevsim.h
parent860e9d328fa585aafda2ef09aa1b13986279cbe7 (diff)
netdevsim: shared UDP tunnel port table support
Add the ability to simulate a device with a shared UDP tunnel port table. Try to reject the configurations and actions which are not supported by the core, so we don't get syzcaller etc. warning reports. Signed-off-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.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/netdevsim/netdevsim.h b/drivers/net/netdevsim/netdevsim.h
index 0a1b28aea894..7cf2220b050f 100644
--- a/drivers/net/netdevsim/netdevsim.h
+++ b/drivers/net/netdevsim/netdevsim.h
@@ -20,6 +20,7 @@
#include <linux/netdevice.h>
#include <linux/u64_stats_sync.h>
#include <net/devlink.h>
+#include <net/udp_tunnel.h>
#include <net/xdp.h>
#define DRV_NAME "netdevsim"
@@ -84,7 +85,8 @@ struct netdevsim {
struct {
u32 inject_error;
u32 sleep;
- u32 ports[2][NSIM_UDP_TUNNEL_N_PORTS];
+ u32 __ports[2][NSIM_UDP_TUNNEL_N_PORTS];
+ u32 (*ports)[NSIM_UDP_TUNNEL_N_PORTS];
struct debugfs_u32_array dfs_ports[2];
} udp_ports;
@@ -209,9 +211,12 @@ struct nsim_dev {
bool fail_trap_policer_set;
bool fail_trap_policer_counter_get;
struct {
+ struct udp_tunnel_nic_shared utn_shared;
+ u32 __ports[2][NSIM_UDP_TUNNEL_N_PORTS];
bool sync_all;
bool open_only;
bool ipv4_only;
+ bool shared;
u32 sleep;
} udp_ports;
};