* [PATCH net] xfrm: Pass flowi_oif or l3mdev as oif to xfrm_dst_lookup
@ 2022-04-01 1:53 David Ahern
2022-04-01 18:50 ` Jakub Kicinski
0 siblings, 1 reply; 5+ messages in thread
From: David Ahern @ 2022-04-01 1:53 UTC (permalink / raw)
To: netdev, kuba, davem, pabeni; +Cc: oliver.sang, David Ahern
The commit referenced in the Fixes tag no longer changes the
flow oif to the l3mdev ifindex. A xfrm use case was expecting
the flowi_oif to be the VRF if relevant and the change broke
that test. Update xfrm_bundle_create to pass oif if set and any
potential flowi_l3mdev if oif is not set.
Fixes: 40867d74c374 ("net: Add l3mdev index to flow struct and avoid oif reset for port devices")
Reported-by: kernel test robot <oliver.sang@intel.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
---
net/xfrm/xfrm_policy.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 19aa994f5d2c..00bd0ecff5a1 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -2593,12 +2593,14 @@ static struct dst_entry *xfrm_bundle_create(struct xfrm_policy *policy,
if (xfrm[i]->props.mode != XFRM_MODE_TRANSPORT) {
__u32 mark = 0;
+ int oif;
if (xfrm[i]->props.smark.v || xfrm[i]->props.smark.m)
mark = xfrm_smark_get(fl->flowi_mark, xfrm[i]);
family = xfrm[i]->props.family;
- dst = xfrm_dst_lookup(xfrm[i], tos, fl->flowi_oif,
+ oif = fl->flowi_oif ? : fl->flowi_l3mdev;
+ dst = xfrm_dst_lookup(xfrm[i], tos, oif,
&saddr, &daddr, family, mark);
err = PTR_ERR(dst);
if (IS_ERR(dst))
--
2.24.3 (Apple Git-128)
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net] xfrm: Pass flowi_oif or l3mdev as oif to xfrm_dst_lookup
2022-04-01 1:53 [PATCH net] xfrm: Pass flowi_oif or l3mdev as oif to xfrm_dst_lookup David Ahern
@ 2022-04-01 18:50 ` Jakub Kicinski
2022-04-01 18:54 ` David Ahern
0 siblings, 1 reply; 5+ messages in thread
From: Jakub Kicinski @ 2022-04-01 18:50 UTC (permalink / raw)
To: David Ahern; +Cc: netdev, davem, pabeni, oliver.sang
On Thu, 31 Mar 2022 19:53:34 -0600 David Ahern wrote:
> To: netdev@vger.kernel.org, kuba@kernel.org, davem@davemloft.net, pabeni@redhat.com
> Cc: oliver.sang@intel.com, David Ahern <dsahern@kernel.org>
> Subject: [PATCH net] xfrm: Pass flowi_oif or l3mdev as oif to xfrm_dst_lookup
This needs Steffen and Herbert on CC. I'd just CC them in but
patch was marked as Awaiting upstream in our PW already, so
repost would be better. Regardless which tree it ends up getting
applied to.
> The commit referenced in the Fixes tag no longer changes the
> flow oif to the l3mdev ifindex. A xfrm use case was expecting
> the flowi_oif to be the VRF if relevant and the change broke
> that test. Update xfrm_bundle_create to pass oif if set and any
> potential flowi_l3mdev if oif is not set.
>
> Fixes: 40867d74c374 ("net: Add l3mdev index to flow struct and avoid oif reset for port devices")
> Reported-by: kernel test robot <oliver.sang@intel.com>
> Signed-off-by: David Ahern <dsahern@kernel.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net] xfrm: Pass flowi_oif or l3mdev as oif to xfrm_dst_lookup
2022-04-01 18:50 ` Jakub Kicinski
@ 2022-04-01 18:54 ` David Ahern
0 siblings, 0 replies; 5+ messages in thread
From: David Ahern @ 2022-04-01 18:54 UTC (permalink / raw)
To: Jakub Kicinski; +Cc: netdev, davem, pabeni, oliver.sang
On 4/1/22 12:50 PM, Jakub Kicinski wrote:
> On Thu, 31 Mar 2022 19:53:34 -0600 David Ahern wrote:
>> To: netdev@vger.kernel.org, kuba@kernel.org, davem@davemloft.net, pabeni@redhat.com
>> Cc: oliver.sang@intel.com, David Ahern <dsahern@kernel.org>
>> Subject: [PATCH net] xfrm: Pass flowi_oif or l3mdev as oif to xfrm_dst_lookup
>
> This needs Steffen and Herbert on CC. I'd just CC them in but
> patch was marked as Awaiting upstream in our PW already, so
> repost would be better. Regardless which tree it ends up getting
> applied to.
Prior l3mdev stuff went in through net/net-next, hence the cc list for
this one. I will re-send adding them.
>
>> The commit referenced in the Fixes tag no longer changes the
>> flow oif to the l3mdev ifindex. A xfrm use case was expecting
>> the flowi_oif to be the VRF if relevant and the change broke
>> that test. Update xfrm_bundle_create to pass oif if set and any
>> potential flowi_l3mdev if oif is not set.
>>
>> Fixes: 40867d74c374 ("net: Add l3mdev index to flow struct and avoid oif reset for port devices")
>> Reported-by: kernel test robot <oliver.sang@intel.com>
>> Signed-off-by: David Ahern <dsahern@kernel.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH net] xfrm: Pass flowi_oif or l3mdev as oif to xfrm_dst_lookup
@ 2022-04-01 18:58 David Ahern
2022-04-05 9:29 ` Steffen Klassert
0 siblings, 1 reply; 5+ messages in thread
From: David Ahern @ 2022-04-01 18:58 UTC (permalink / raw)
To: netdev, kuba, davem, pabeni
Cc: oliver.sang, steffen.klassert, herbert, David Ahern
The commit referenced in the Fixes tag no longer changes the
flow oif to the l3mdev ifindex. A xfrm use case was expecting
the flowi_oif to be the VRF if relevant and the change broke
that test. Update xfrm_bundle_create to pass oif if set and any
potential flowi_l3mdev if oif is not set.
Fixes: 40867d74c374 ("net: Add l3mdev index to flow struct and avoid oif reset for port devices")
Reported-by: kernel test robot <oliver.sang@intel.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
---
net/xfrm/xfrm_policy.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 19aa994f5d2c..00bd0ecff5a1 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -2593,12 +2593,14 @@ static struct dst_entry *xfrm_bundle_create(struct xfrm_policy *policy,
if (xfrm[i]->props.mode != XFRM_MODE_TRANSPORT) {
__u32 mark = 0;
+ int oif;
if (xfrm[i]->props.smark.v || xfrm[i]->props.smark.m)
mark = xfrm_smark_get(fl->flowi_mark, xfrm[i]);
family = xfrm[i]->props.family;
- dst = xfrm_dst_lookup(xfrm[i], tos, fl->flowi_oif,
+ oif = fl->flowi_oif ? : fl->flowi_l3mdev;
+ dst = xfrm_dst_lookup(xfrm[i], tos, oif,
&saddr, &daddr, family, mark);
err = PTR_ERR(dst);
if (IS_ERR(dst))
--
2.24.3 (Apple Git-128)
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net] xfrm: Pass flowi_oif or l3mdev as oif to xfrm_dst_lookup
2022-04-01 18:58 David Ahern
@ 2022-04-05 9:29 ` Steffen Klassert
0 siblings, 0 replies; 5+ messages in thread
From: Steffen Klassert @ 2022-04-05 9:29 UTC (permalink / raw)
To: David Ahern; +Cc: netdev, kuba, davem, pabeni, oliver.sang, herbert
On Fri, Apr 01, 2022 at 12:58:37PM -0600, David Ahern wrote:
> The commit referenced in the Fixes tag no longer changes the
> flow oif to the l3mdev ifindex. A xfrm use case was expecting
> the flowi_oif to be the VRF if relevant and the change broke
> that test. Update xfrm_bundle_create to pass oif if set and any
> potential flowi_l3mdev if oif is not set.
>
> Fixes: 40867d74c374 ("net: Add l3mdev index to flow struct and avoid oif reset for port devices")
> Reported-by: kernel test robot <oliver.sang@intel.com>
> Signed-off-by: David Ahern <dsahern@kernel.org>
Applied to the ipsec tree, thanks David!
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-04-05 10:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-01 1:53 [PATCH net] xfrm: Pass flowi_oif or l3mdev as oif to xfrm_dst_lookup David Ahern
2022-04-01 18:50 ` Jakub Kicinski
2022-04-01 18:54 ` David Ahern
-- strict thread matches above, loose matches on Subject: below --
2022-04-01 18:58 David Ahern
2022-04-05 9:29 ` Steffen Klassert
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).