netdevsim: Add devlink-trap support
authorIdo Schimmel <idosch@mellanox.com>
Sat, 17 Aug 2019 13:28:20 +0000 (16:28 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 17 Aug 2019 19:40:09 +0000 (12:40 -0700)
commitda58f90f11f597520f226caff1d3cfc115abedc9
tree695f3717a6b09ea96bcae914ee9607b5b767b883
parentf3047ca01f12bf997ef199710b51490b0f750b34
netdevsim: Add devlink-trap support

Have netdevsim register its trap groups and traps with devlink during
initialization and periodically report trapped packets to devlink core.

Since netdevsim is not a real device, the trapped packets are emulated
using a workqueue that periodically reports a UDP packet with a random
5-tuple from each active packet trap and from each running netdev.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/netdevsim/dev.c
drivers/net/netdevsim/netdevsim.h