diff mbox series

[net] ipv4: Set offload_failed flag in fibmatch results

Message ID 20230926182730.231208-1-bpoirier@nvidia.com (mailing list archive)
State Accepted
Commit 0add5c597f3253a9c6108a0a81d57f44ab0d9d30
Delegated to: Netdev Maintainers
Headers show
Series [net] ipv4: Set offload_failed flag in fibmatch results | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1343 this patch: 1343
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 1364 this patch: 1364
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 1366 this patch: 1366
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Benjamin Poirier Sept. 26, 2023, 6:27 p.m. UTC
Due to a small omission, the offload_failed flag is missing from ipv4
fibmatch results. Make sure it is set correctly.

The issue can be witnessed using the following commands:
echo "1 1" > /sys/bus/netdevsim/new_device
ip link add dummy1 up type dummy
ip route add 192.0.2.0/24 dev dummy1
echo 1 > /sys/kernel/debug/netdevsim/netdevsim1/fib/fail_route_offload
ip route add 198.51.100.0/24 dev dummy1
ip route
	# 192.168.15.0/24 has rt_trap
	# 198.51.100.0/24 has rt_offload_failed
ip route get 192.168.15.1 fibmatch
	# Result has rt_trap
ip route get 198.51.100.1 fibmatch
	# Result differs from the route shown by `ip route`, it is missing
	# rt_offload_failed
ip link del dev dummy1
echo 1 > /sys/bus/netdevsim/del_device

Fixes: 36c5100e859d ("IPv4: Add "offload failed" indication to routes")
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
---
 net/ipv4/route.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Simon Horman Oct. 2, 2023, 12:59 p.m. UTC | #1
On Tue, Sep 26, 2023 at 02:27:30PM -0400, Benjamin Poirier wrote:
> Due to a small omission, the offload_failed flag is missing from ipv4
> fibmatch results. Make sure it is set correctly.
> 
> The issue can be witnessed using the following commands:
> echo "1 1" > /sys/bus/netdevsim/new_device
> ip link add dummy1 up type dummy
> ip route add 192.0.2.0/24 dev dummy1
> echo 1 > /sys/kernel/debug/netdevsim/netdevsim1/fib/fail_route_offload
> ip route add 198.51.100.0/24 dev dummy1
> ip route
> 	# 192.168.15.0/24 has rt_trap
> 	# 198.51.100.0/24 has rt_offload_failed
> ip route get 192.168.15.1 fibmatch
> 	# Result has rt_trap
> ip route get 198.51.100.1 fibmatch
> 	# Result differs from the route shown by `ip route`, it is missing
> 	# rt_offload_failed
> ip link del dev dummy1
> echo 1 > /sys/bus/netdevsim/del_device
> 
> Fixes: 36c5100e859d ("IPv4: Add "offload failed" indication to routes")
> Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
> Reviewed-by: Ido Schimmel <idosch@nvidia.com>

Reviewed-by: Simon Horman <horms@kernel.org>
David Ahern Oct. 2, 2023, 2:15 p.m. UTC | #2
On 9/26/23 12:27 PM, Benjamin Poirier wrote:
> Due to a small omission, the offload_failed flag is missing from ipv4
> fibmatch results. Make sure it is set correctly.
> 
> The issue can be witnessed using the following commands:
> echo "1 1" > /sys/bus/netdevsim/new_device
> ip link add dummy1 up type dummy
> ip route add 192.0.2.0/24 dev dummy1
> echo 1 > /sys/kernel/debug/netdevsim/netdevsim1/fib/fail_route_offload
> ip route add 198.51.100.0/24 dev dummy1
> ip route
> 	# 192.168.15.0/24 has rt_trap
> 	# 198.51.100.0/24 has rt_offload_failed
> ip route get 192.168.15.1 fibmatch
> 	# Result has rt_trap
> ip route get 198.51.100.1 fibmatch
> 	# Result differs from the route shown by `ip route`, it is missing
> 	# rt_offload_failed
> ip link del dev dummy1
> echo 1 > /sys/bus/netdevsim/del_device
> 
> Fixes: 36c5100e859d ("IPv4: Add "offload failed" indication to routes")
> Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
> Reviewed-by: Ido Schimmel <idosch@nvidia.com>
> ---
>  net/ipv4/route.c | 2 ++
>  1 file changed, 2 insertions(+)
> 

Reviewed-by: David Ahern <dsahern@kernel.org>
patchwork-bot+netdevbpf@kernel.org Oct. 4, 2023, 6:50 p.m. UTC | #3
Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 26 Sep 2023 14:27:30 -0400 you wrote:
> Due to a small omission, the offload_failed flag is missing from ipv4
> fibmatch results. Make sure it is set correctly.
> 
> The issue can be witnessed using the following commands:
> echo "1 1" > /sys/bus/netdevsim/new_device
> ip link add dummy1 up type dummy
> ip route add 192.0.2.0/24 dev dummy1
> echo 1 > /sys/kernel/debug/netdevsim/netdevsim1/fib/fail_route_offload
> ip route add 198.51.100.0/24 dev dummy1
> ip route
> 	# 192.168.15.0/24 has rt_trap
> 	# 198.51.100.0/24 has rt_offload_failed
> ip route get 192.168.15.1 fibmatch
> 	# Result has rt_trap
> ip route get 198.51.100.1 fibmatch
> 	# Result differs from the route shown by `ip route`, it is missing
> 	# rt_offload_failed
> ip link del dev dummy1
> echo 1 > /sys/bus/netdevsim/del_device
> 
> [...]

Here is the summary with links:
  - [net] ipv4: Set offload_failed flag in fibmatch results
    https://git.kernel.org/netdev/net/c/0add5c597f32

You are awesome, thank you!
diff mbox series

Patch

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index a57062283219..b214b5a2e045 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -3417,6 +3417,8 @@  static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh,
 				    fa->fa_type == fri.type) {
 					fri.offload = READ_ONCE(fa->offload);
 					fri.trap = READ_ONCE(fa->trap);
+					fri.offload_failed =
+						READ_ONCE(fa->offload_failed);
 					break;
 				}
 			}