OSDN Git Service

udp_tunnel: reshuffle NETIF_F_RX_UDP_TUNNEL_PORT checks
authorJakub Kicinski <kuba@kernel.org>
Wed, 6 Jan 2021 21:06:37 +0000 (13:06 -0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 7 Jan 2021 20:53:29 +0000 (12:53 -0800)
commitb9ef3fecd1403fc1c2dd146e67b366691394b80f
treec051eea4572b565e57efb775a26f51ecc14cc007
parent30bfce109420912f201d4f295f9130ff44f04b41
udp_tunnel: reshuffle NETIF_F_RX_UDP_TUNNEL_PORT checks

Move the NETIF_F_RX_UDP_TUNNEL_PORT feature check into
udp_tunnel_nic_*_port() helpers, since they're always
done right before the call.

Add similar checks before calling the notifier.
udp_tunnel_nic invokes the notifier without checking
features which could result in some wasted cycles.

Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/udp_tunnel.h
net/ipv4/udp_tunnel_core.c