OSDN Git Service

net: psample: Add tunnel support
authorChris Mi <chrism@mellanox.com>
Tue, 19 May 2020 14:45:20 +0000 (22:45 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 May 2020 00:04:07 +0000 (17:04 -0700)
commitd8bed686ab96169ac80b497d1cbed89300d97f83
tree01d7ebfcbaa77f3303cdd711603b81bb0939cc9f
parentde1b99ef2aa1e982c86b15853e013c6e3dbc1e7a
net: psample: Add tunnel support

Currently, psample can only send the packet bits after decapsulation.
The tunnel information is lost. Add the tunnel support.

If the sampled packet has no tunnel info, the behavior is the same as
before. If it has, add a nested metadata field named PSAMPLE_ATTR_TUNNEL
and include the tunnel subfields if applicable.

Increase the metadata length for sampled packet with the tunnel info.
If new subfields of tunnel info should be included, update the metadata
length accordingly.

Signed-off-by: Chris Mi <chrism@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/uapi/linux/psample.h
net/psample/psample.c