From: Jakub Kicinski <kuba@kernel.org>
To: saeedm@mellanox.com
Cc: netdev@vger.kernel.org, mkubecek@suse.cz,
Jakub Kicinski <kuba@kernel.org>
Subject: [RFC 3/4] netdevsim: support the static IANA VXLAN port flag
Date: Wed, 22 Jul 2020 16:48:37 -0700 [thread overview]
Message-ID: <20200722234838.3200228-4-kuba@kernel.org> (raw)
In-Reply-To: <20200722234838.3200228-1-kuba@kernel.org>
Allow setting UDP_TUNNEL_NIC_INFO_STATIC_IANA_VXLAN.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
drivers/net/netdevsim/netdevsim.h | 1 +
drivers/net/netdevsim/udp_tunnels.c | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/drivers/net/netdevsim/netdevsim.h b/drivers/net/netdevsim/netdevsim.h
index 4335ab4e5ce0..8a8ba687cc59 100644
--- a/drivers/net/netdevsim/netdevsim.h
+++ b/drivers/net/netdevsim/netdevsim.h
@@ -205,6 +205,7 @@ struct nsim_dev {
bool open_only;
bool ipv4_only;
bool shared;
+ bool static_iana_vxlan;
u32 sleep;
} udp_ports;
};
diff --git a/drivers/net/netdevsim/udp_tunnels.c b/drivers/net/netdevsim/udp_tunnels.c
index 6b98e6d1188f..6ab023acefd6 100644
--- a/drivers/net/netdevsim/udp_tunnels.c
+++ b/drivers/net/netdevsim/udp_tunnels.c
@@ -186,6 +186,8 @@ int nsim_udp_tunnels_info_create(struct nsim_dev *nsim_dev,
info->flags |= UDP_TUNNEL_NIC_INFO_IPV4_ONLY;
if (nsim_dev->udp_ports.shared)
info->shared = &nsim_dev->udp_ports.utn_shared;
+ if (nsim_dev->udp_ports.static_iana_vxlan)
+ info->flags |= UDP_TUNNEL_NIC_INFO_STATIC_IANA_VXLAN;
dev->udp_tunnel_nic_info = info;
return 0;
@@ -207,6 +209,8 @@ void nsim_udp_tunnels_debugfs_create(struct nsim_dev *nsim_dev)
&nsim_dev->udp_ports.ipv4_only);
debugfs_create_bool("udp_ports_shared", 0600, nsim_dev->ddir,
&nsim_dev->udp_ports.shared);
+ debugfs_create_bool("udp_ports_static_iana_vxlan", 0600, nsim_dev->ddir,
+ &nsim_dev->udp_ports.static_iana_vxlan);
debugfs_create_u32("udp_ports_sleep", 0600, nsim_dev->ddir,
&nsim_dev->udp_ports.sleep);
}
--
2.26.2
next prev parent reply other threads:[~2020-07-22 23:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-22 23:48 [RFC 0/4] udp_tunnel: convert mlx5 to the new udp_tunnel infrastructure Jakub Kicinski
2020-07-22 23:48 ` [RFC 1/4] udp_tunnel: add the ability to hard-code IANA VXLAN Jakub Kicinski
2020-07-22 23:48 ` [RFC 2/4] mlx5: convert to new udp_tunnel infrastructure Jakub Kicinski
2020-07-22 23:48 ` Jakub Kicinski [this message]
2020-07-22 23:48 ` [RFC 4/4] selftests: net: add a test for static UDP tunnel ports Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200722234838.3200228-4-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=mkubecek@suse.cz \
--cc=netdev@vger.kernel.org \
--cc=saeedm@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).