From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, thomas.lendacky@amd.com,
aelior@marvell.com, GR-everest-linux-l2@marvell.com,
michael.chan@broadcom.com, rajur@chelsio.com,
jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com,
tariqt@nvidia.com, saeedm@nvidia.com,
GR-Linux-NIC-Dev@marvell.com, ecree.xilinx@gmail.com,
simon.horman@netronome.com, alexander.duyck@gmail.com,
Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next 2/4] udp_tunnel: remove REGISTER/UNREGISTER handling from tunnel drivers
Date: Wed, 6 Jan 2021 13:06:35 -0800 [thread overview]
Message-ID: <20210106210637.1839662-3-kuba@kernel.org> (raw)
In-Reply-To: <20210106210637.1839662-1-kuba@kernel.org>
udp_tunnel_nic handles REGISTER and UNREGISTER event, now that all
drivers use that infra we can drop the event handling in the tunnel
drivers.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
drivers/net/geneve.c | 14 ++++----------
drivers/net/vxlan.c | 15 +++++----------
2 files changed, 9 insertions(+), 20 deletions(-)
diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
index 5523f069b9a5..6aa775d60c57 100644
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -1851,16 +1851,10 @@ static int geneve_netdevice_event(struct notifier_block *unused,
{
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
- if (event == NETDEV_UDP_TUNNEL_PUSH_INFO ||
- event == NETDEV_UDP_TUNNEL_DROP_INFO) {
- geneve_offload_rx_ports(dev, event == NETDEV_UDP_TUNNEL_PUSH_INFO);
- } else if (event == NETDEV_UNREGISTER) {
- if (!dev->udp_tunnel_nic_info)
- geneve_offload_rx_ports(dev, false);
- } else if (event == NETDEV_REGISTER) {
- if (!dev->udp_tunnel_nic_info)
- geneve_offload_rx_ports(dev, true);
- }
+ if (event == NETDEV_UDP_TUNNEL_PUSH_INFO)
+ geneve_offload_rx_ports(dev, true);
+ else if (event == NETDEV_UDP_TUNNEL_DROP_INFO)
+ geneve_offload_rx_ports(dev, false);
return NOTIFY_DONE;
}
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index a8ad710629e6..b9364433de8f 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -4521,17 +4521,12 @@ static int vxlan_netdevice_event(struct notifier_block *unused,
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
struct vxlan_net *vn = net_generic(dev_net(dev), vxlan_net_id);
- if (event == NETDEV_UNREGISTER) {
- if (!dev->udp_tunnel_nic_info)
- vxlan_offload_rx_ports(dev, false);
+ if (event == NETDEV_UNREGISTER)
vxlan_handle_lowerdev_unregister(vn, dev);
- } else if (event == NETDEV_REGISTER) {
- if (!dev->udp_tunnel_nic_info)
- vxlan_offload_rx_ports(dev, true);
- } else if (event == NETDEV_UDP_TUNNEL_PUSH_INFO ||
- event == NETDEV_UDP_TUNNEL_DROP_INFO) {
- vxlan_offload_rx_ports(dev, event == NETDEV_UDP_TUNNEL_PUSH_INFO);
- }
+ else if (event == NETDEV_UDP_TUNNEL_PUSH_INFO)
+ vxlan_offload_rx_ports(dev, true);
+ else if (event == NETDEV_UDP_TUNNEL_DROP_INFO)
+ vxlan_offload_rx_ports(dev, false);
return NOTIFY_DONE;
}
--
2.26.2
next prev parent reply other threads:[~2021-01-06 21:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-06 21:06 [PATCH net-next 0/4] udp_tunnel_nic: post conversion cleanup Jakub Kicinski
2021-01-06 21:06 ` [PATCH net-next 1/4] udp_tunnel: hard-wire NDOs to udp_tunnel_nic_*_port() helpers Jakub Kicinski
2021-01-06 21:06 ` Jakub Kicinski [this message]
2021-01-06 21:06 ` [PATCH net-next 3/4] net: remove ndo_udp_tunnel_* callbacks Jakub Kicinski
2021-01-06 21:06 ` [PATCH net-next 4/4] udp_tunnel: reshuffle NETIF_F_RX_UDP_TUNNEL_PORT checks Jakub Kicinski
2021-01-06 21:53 ` [PATCH net-next 0/4] udp_tunnel_nic: post conversion cleanup Alexander Duyck
2021-01-07 18:44 ` Jacob Keller
2021-01-07 22:34 ` 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=20210106210637.1839662-3-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=GR-Linux-NIC-Dev@marvell.com \
--cc=GR-everest-linux-l2@marvell.com \
--cc=aelior@marvell.com \
--cc=alexander.duyck@gmail.com \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=ecree.xilinx@gmail.com \
--cc=jesse.brandeburg@intel.com \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=rajur@chelsio.com \
--cc=saeedm@nvidia.com \
--cc=simon.horman@netronome.com \
--cc=tariqt@nvidia.com \
--cc=thomas.lendacky@amd.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).