Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next] net: ipip: use tunnel parameters for fill_forward_path route lookup
@ 2026-07-08 11:25 Lorenzo Bianconi
  2026-07-08 15:34 ` David Ahern
  2026-07-08 15:42 ` David Ahern
  0 siblings, 2 replies; 4+ messages in thread
From: Lorenzo Bianconi @ 2026-07-08 11:25 UTC (permalink / raw)
  To: David Ahern, Ido Schimmel, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Pablo Neira Ayuso,
	Florian Westphal
  Cc: netdev, netfilter-devel, Lorenzo Bianconi

Pass source address, DSCP and output interface from the tunnel
configuration to ip_route_output() in ipip_fill_forward_path(), aligning
the route lookup with the slow path in ipip_tunnel_xmit().

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 net/ipv4/ipip.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index b643194f57d2..d1aa048a6099 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -360,8 +360,9 @@ static int ipip_fill_forward_path(struct net_device_path_ctx *ctx,
 	const struct iphdr *tiph = &tunnel->parms.iph;
 	struct rtable *rt;
 
-	rt = ip_route_output(dev_net(ctx->dev), tiph->daddr, 0, 0, 0,
-			     RT_SCOPE_UNIVERSE);
+	rt = ip_route_output(dev_net(ctx->dev), tiph->daddr, tiph->saddr,
+			     inet_dsfield_to_dscp(tiph->tos),
+			     tunnel->parms.link, RT_SCOPE_UNIVERSE);
 	if (IS_ERR(rt))
 		return PTR_ERR(rt);
 

---
base-commit: 155c68aef2397f8c5d72ef10acf48ae159bf1869
change-id: 20260708-ipip-route-lookup-fill_forward_path-6a8a1f45084c

Best regards,
-- 
Lorenzo Bianconi <lorenzo@kernel.org>


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

* Re: [PATCH net-next] net: ipip: use tunnel parameters for fill_forward_path route lookup
  2026-07-08 11:25 [PATCH net-next] net: ipip: use tunnel parameters for fill_forward_path route lookup Lorenzo Bianconi
@ 2026-07-08 15:34 ` David Ahern
  2026-07-08 15:39   ` Lorenzo Bianconi
  2026-07-08 15:42 ` David Ahern
  1 sibling, 1 reply; 4+ messages in thread
From: David Ahern @ 2026-07-08 15:34 UTC (permalink / raw)
  To: Lorenzo Bianconi, Ido Schimmel, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Pablo Neira Ayuso,
	Florian Westphal
  Cc: netdev, netfilter-devel

On 7/8/26 5:25 AM, Lorenzo Bianconi wrote:
> Pass source address, DSCP and output interface from the tunnel
> configuration to ip_route_output() in ipip_fill_forward_path(), aligning
> the route lookup with the slow path in ipip_tunnel_xmit().
> 
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
>  net/ipv4/ipip.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
> index b643194f57d2..d1aa048a6099 100644
> --- a/net/ipv4/ipip.c
> +++ b/net/ipv4/ipip.c
> @@ -360,8 +360,9 @@ static int ipip_fill_forward_path(struct net_device_path_ctx *ctx,
>  	const struct iphdr *tiph = &tunnel->parms.iph;
>  	struct rtable *rt;
>  
> -	rt = ip_route_output(dev_net(ctx->dev), tiph->daddr, 0, 0, 0,
> -			     RT_SCOPE_UNIVERSE);
> +	rt = ip_route_output(dev_net(ctx->dev), tiph->daddr, tiph->saddr,
> +			     inet_dsfield_to_dscp(tiph->tos),
> +			     tunnel->parms.link, RT_SCOPE_UNIVERSE);
>  	if (IS_ERR(rt))
>  		return PTR_ERR(rt);
>  
> 
> ---
> base-commit: 155c68aef2397f8c5d72ef10acf48ae159bf1869
> change-id: 20260708-ipip-route-lookup-fill_forward_path-6a8a1f45084c
> 
> Best regards,

This and the ipv6 version seem correct to me. Please add test cases for
both.

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

* Re: [PATCH net-next] net: ipip: use tunnel parameters for fill_forward_path route lookup
  2026-07-08 15:34 ` David Ahern
@ 2026-07-08 15:39   ` Lorenzo Bianconi
  0 siblings, 0 replies; 4+ messages in thread
From: Lorenzo Bianconi @ 2026-07-08 15:39 UTC (permalink / raw)
  To: David Ahern
  Cc: Ido Schimmel, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman, Pablo Neira Ayuso, Florian Westphal,
	netdev, netfilter-devel

[-- Attachment #1: Type: text/plain, Size: 1558 bytes --]

On Jul 08, David Ahern wrote:
> On 7/8/26 5:25 AM, Lorenzo Bianconi wrote:
> > Pass source address, DSCP and output interface from the tunnel
> > configuration to ip_route_output() in ipip_fill_forward_path(), aligning
> > the route lookup with the slow path in ipip_tunnel_xmit().
> > 
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > ---
> >  net/ipv4/ipip.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
> > index b643194f57d2..d1aa048a6099 100644
> > --- a/net/ipv4/ipip.c
> > +++ b/net/ipv4/ipip.c
> > @@ -360,8 +360,9 @@ static int ipip_fill_forward_path(struct net_device_path_ctx *ctx,
> >  	const struct iphdr *tiph = &tunnel->parms.iph;
> >  	struct rtable *rt;
> >  
> > -	rt = ip_route_output(dev_net(ctx->dev), tiph->daddr, 0, 0, 0,
> > -			     RT_SCOPE_UNIVERSE);
> > +	rt = ip_route_output(dev_net(ctx->dev), tiph->daddr, tiph->saddr,
> > +			     inet_dsfield_to_dscp(tiph->tos),
> > +			     tunnel->parms.link, RT_SCOPE_UNIVERSE);
> >  	if (IS_ERR(rt))
> >  		return PTR_ERR(rt);
> >  
> > 
> > ---
> > base-commit: 155c68aef2397f8c5d72ef10acf48ae159bf1869
> > change-id: 20260708-ipip-route-lookup-fill_forward_path-6a8a1f45084c
> > 
> > Best regards,
> 
> This and the ipv6 version seem correct to me. Please add test cases for
> both.

I guess we already have selftests for them in:
https://github.com/torvalds/linux/blob/master/tools/testing/selftests/net/netfilter/nft_flowtable.sh#L584

Regards,
Lorenzo


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH net-next] net: ipip: use tunnel parameters for fill_forward_path route lookup
  2026-07-08 11:25 [PATCH net-next] net: ipip: use tunnel parameters for fill_forward_path route lookup Lorenzo Bianconi
  2026-07-08 15:34 ` David Ahern
@ 2026-07-08 15:42 ` David Ahern
  1 sibling, 0 replies; 4+ messages in thread
From: David Ahern @ 2026-07-08 15:42 UTC (permalink / raw)
  To: Lorenzo Bianconi, Ido Schimmel, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Pablo Neira Ayuso,
	Florian Westphal
  Cc: netdev, netfilter-devel

On 7/8/26 5:25 AM, Lorenzo Bianconi wrote:
> Pass source address, DSCP and output interface from the tunnel
> configuration to ip_route_output() in ipip_fill_forward_path(), aligning
> the route lookup with the slow path in ipip_tunnel_xmit().
> 
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
>  net/ipv4/ipip.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
> index b643194f57d2..d1aa048a6099 100644
> --- a/net/ipv4/ipip.c
> +++ b/net/ipv4/ipip.c
> @@ -360,8 +360,9 @@ static int ipip_fill_forward_path(struct net_device_path_ctx *ctx,
>  	const struct iphdr *tiph = &tunnel->parms.iph;
>  	struct rtable *rt;
>  
> -	rt = ip_route_output(dev_net(ctx->dev), tiph->daddr, 0, 0, 0,
> -			     RT_SCOPE_UNIVERSE);
> +	rt = ip_route_output(dev_net(ctx->dev), tiph->daddr, tiph->saddr,
> +			     inet_dsfield_to_dscp(tiph->tos),
> +			     tunnel->parms.link, RT_SCOPE_UNIVERSE);
>  	if (IS_ERR(rt))
>  		return PTR_ERR(rt);
>  
> 
> ---
> base-commit: 155c68aef2397f8c5d72ef10acf48ae159bf1869
> change-id: 20260708-ipip-route-lookup-fill_forward_path-6a8a1f45084c
> 
> Best regards,

Reviewed-by: David Ahern <dsahern@kernel.org>


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

end of thread, other threads:[~2026-07-08 15:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-08 11:25 [PATCH net-next] net: ipip: use tunnel parameters for fill_forward_path route lookup Lorenzo Bianconi
2026-07-08 15:34 ` David Ahern
2026-07-08 15:39   ` Lorenzo Bianconi
2026-07-08 15:42 ` David Ahern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox