diff options
author | Ido Schimmel <idosch@nvidia.com> | 2021-03-14 13:19:32 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-03-14 23:00:43 +0100 |
commit | a8700c3dd0a48f379d269ac6ddcf8bd857042771 (patch) | |
tree | a8abac5b59155b2ac476a33c7641ac2b1d59fdcd /drivers/net/netdevsim/netdevsim.h | |
parent | psample: Add additional metadata attributes (diff) | |
download | linux-a8700c3dd0a48f379d269ac6ddcf8bd857042771.tar.xz linux-a8700c3dd0a48f379d269ac6ddcf8bd857042771.zip |
netdevsim: Add dummy psample implementation
Allow netdevsim to report "sampled" packets to the psample module by
periodically generating packets from a work queue. The behavior can be
enabled / disabled (default) and the various meta data attributes can be
controlled via debugfs knobs.
This implementation enables both testing of the psample module with all
the optional attributes as well as development of user space
applications on top of psample such as hsflowd and a Wireshark dissector
for psample generic netlink packets.
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netdevsim/netdevsim.h')
-rw-r--r-- | drivers/net/netdevsim/netdevsim.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/netdevsim/netdevsim.h b/drivers/net/netdevsim/netdevsim.h index 48163c5f2ec9..d735c21def4b 100644 --- a/drivers/net/netdevsim/netdevsim.h +++ b/drivers/net/netdevsim/netdevsim.h @@ -180,6 +180,20 @@ struct nsim_dev_health { int nsim_dev_health_init(struct nsim_dev *nsim_dev, struct devlink *devlink); void nsim_dev_health_exit(struct nsim_dev *nsim_dev); +#if IS_ENABLED(CONFIG_PSAMPLE) +int nsim_dev_psample_init(struct nsim_dev *nsim_dev); +void nsim_dev_psample_exit(struct nsim_dev *nsim_dev); +#else +static inline int nsim_dev_psample_init(struct nsim_dev *nsim_dev) +{ + return 0; +} + +static inline void nsim_dev_psample_exit(struct nsim_dev *nsim_dev) +{ +} +#endif + struct nsim_dev_port { struct list_head list; struct devlink_port devlink_port; @@ -229,6 +243,7 @@ struct nsim_dev { bool static_iana_vxlan; u32 sleep; } udp_ports; + struct nsim_dev_psample *psample; }; static inline struct net *nsim_dev_net(struct nsim_dev *nsim_dev) |