summaryrefslogtreecommitdiffstats
path: root/net/ethtool/strset.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2020-07-10 02:42:47 +0200
committerDavid S. Miller <davem@davemloft.net>2020-07-10 22:54:00 +0200
commitc7d759eb7b12f91a25f4d3cd03ff5209046ddfc2 (patch)
treef11b19ed2d80954df499dd87d3520784a3536157 /net/ethtool/strset.c
parentudp_tunnel: add central NIC RX port offload infrastructure (diff)
downloadlinux-c7d759eb7b12f91a25f4d3cd03ff5209046ddfc2.tar.xz
linux-c7d759eb7b12f91a25f4d3cd03ff5209046ddfc2.zip
ethtool: add tunnel info interface
Add an interface to report offloaded UDP ports via ethtool netlink. Now that core takes care of tracking which UDP tunnel ports the NICs are aware of we can quite easily export this information out to user space. The responsibility of writing the netlink dumps is split between ethtool code and udp_tunnel_nic.c - since udp_tunnel module may not always be loaded, yet we should always report the capabilities of the NIC. $ ethtool --show-tunnels eth0 Tunnel information for eth0: UDP port table 0: Size: 4 Types: vxlan No entries UDP port table 1: Size: 4 Types: geneve, vxlan-gpe Entries (1): port 1230, vxlan-gpe v4: - back to v2, build fix is now directly in udp_tunnel.h v3: - don't compile ETHTOOL_MSG_TUNNEL_INFO_GET in if CONFIG_INET not set. v2: - fix string set count, - reorder enums in the uAPI, - fix type of ETHTOOL_A_TUNNEL_UDP_TABLE_TYPES to bitset in docs and comments. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ethtool/strset.c')
-rw-r--r--net/ethtool/strset.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/ethtool/strset.c b/net/ethtool/strset.c
index 773634b6b048..82707b662fe4 100644
--- a/net/ethtool/strset.c
+++ b/net/ethtool/strset.c
@@ -75,6 +75,11 @@ static const struct strset_info info_template[] = {
.count = __HWTSTAMP_FILTER_CNT,
.strings = ts_rx_filter_names,
},
+ [ETH_SS_UDP_TUNNEL_TYPES] = {
+ .per_dev = false,
+ .count = __ETHTOOL_UDP_TUNNEL_TYPE_CNT,
+ .strings = udp_tunnel_type_names,
+ },
};
struct strset_req_info {