netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 20/29] netfilter: nft_tunnel: Add dst_cache support
@ 2019-03-02 18:37 Pablo Neira Ayuso
  2019-03-02 18:37 ` [PATCH 21/29] netfilter: convert the proto argument from u8 to u16 Pablo Neira Ayuso
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: Pablo Neira Ayuso @ 2019-03-02 18:37 UTC (permalink / raw)
  To: netfilter-devel; +Cc: davem, netdev

From: wenxu <wenxu@ucloud.cn>

The metadata_dst does not initialize the dst_cache field, this causes
problems to ip_md_tunnel_xmit() since it cannot use this cache, hence,
Triggering a route lookup for every packet.

Signed-off-by: wenxu <wenxu@ucloud.cn>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 net/netfilter/nft_tunnel.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/net/netfilter/nft_tunnel.c b/net/netfilter/nft_tunnel.c
index ea28588c5eed..b113fcac94e1 100644
--- a/net/netfilter/nft_tunnel.c
+++ b/net/netfilter/nft_tunnel.c
@@ -406,6 +406,13 @@ static int nft_tunnel_obj_init(const struct nft_ctx *ctx,
 		return -ENOMEM;
 
 	memcpy(&md->u.tun_info, &info, sizeof(info));
+#ifdef CONFIG_DST_CACHE
+	err = dst_cache_init(&md->u.tun_info.dst_cache, GFP_KERNEL);
+	if (err < 0) {
+		metadata_dst_free(md);
+		return err;
+	}
+#endif
 	ip_tunnel_info_opts_set(&md->u.tun_info, &priv->opts.u, priv->opts.len,
 				priv->opts.flags);
 	priv->md = md;
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-07-05 12:38 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-02 18:37 [PATCH 20/29] netfilter: nft_tunnel: Add dst_cache support Pablo Neira Ayuso
2019-03-02 18:37 ` [PATCH 21/29] netfilter: convert the proto argument from u8 to u16 Pablo Neira Ayuso
2019-03-02 18:37 ` [PATCH 22/29] ipvs: get sctphdr by sctphoff in sctp_csum_check Pablo Neira Ayuso
2019-03-02 18:37 ` [PATCH 23/29] netfilter: bridge: Don't sabotage nf_hook calls for an l3mdev slave Pablo Neira Ayuso
2019-03-02 18:37 ` [PATCH 24/29] netfilter: nf_tables: check the result of dereferencing base_chain->stats Pablo Neira Ayuso
2019-03-02 18:37 ` [PATCH 25/29] netfilter: nf_conntrack: ensure that CONNTRACK_LOCKS is power of 2 Pablo Neira Ayuso
2019-03-03  8:27   ` Sergei Shtylyov
2019-03-02 18:37 ` [PATCH 26/29] netfilter: xt_IDLETIMER: fix sysfs callback function type Pablo Neira Ayuso
2019-03-02 18:37 ` [PATCH 27/29] netfilter: nf_tables: nat: merge nft_redir protocol specific modules Pablo Neira Ayuso
2019-03-02 18:37 ` [PATCH 28/29] netfilter: nf_tables: nat: merge nft_masq " Pablo Neira Ayuso
2019-03-02 18:37 ` [PATCH 29/29] netfilter: nf_tables: merge ipv4 and ipv6 nat chain types Pablo Neira Ayuso
2020-07-05 12:38   ` Reindl Harald

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).