diff mbox series

[net-next,v2] ipvlan: handle NETDEV_DOWN event

Message ID 1712340972-13643-1-git-send-email-venkat.x.venkatsubra@oracle.com (mailing list archive)
State Accepted
Commit 229783970838887e72083820efb9270b7f276a11
Delegated to: Netdev Maintainers
Headers show
Series [net-next,v2] ipvlan: handle NETDEV_DOWN event | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 942 this patch: 942
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 2 maintainers not CCed: pabeni@redhat.com christophe.jaillet@wanadoo.fr
netdev/build_clang success Errors and warnings before: 953 this patch: 953
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 No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 953 this patch: 953
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-04-07--00-00 (tests: 956)

Commit Message

Venkat Venkatsubra April 5, 2024, 6:16 p.m. UTC
In case of stacked devices, to help propagate the down
link state from the parent/root device (to this leaf device),
handle NETDEV_DOWN event like it is done now for NETDEV_UP.

In the below example, ens5 is the host interface which is the
parent of the ipvlan interface eth0 in the container.

Host:

[root@gkn-podman-x64 ~]# ip link set ens5 down
[root@gkn-podman-x64 ~]# ip -d link show dev ens5
3: ens5: <BROADCAST,MULTICAST> mtu 9000 qdisc mq state DOWN
      ...
[root@gkn-podman-x64 ~]#

Container:

[root@testnode-ol8 /]# ip -d link show dev eth0
2: eth0@if3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 state UNKNOWN
        ...
    ipvlan mode l2 bridge
        ...
[root@testnode-ol8 /]#

eth0's state continues to show up as UP even though ens5 is now DOWN.

For macvlan the handling of NETDEV_DOWN event was added in
commit 80fd2d6ca546 ("macvlan: Change status when lower device goes down").

Reported-by: Gia-Khanh Nguyen <gia-khanh.nguyen@oracle.com>
Signed-off-by: Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com>
---
 drivers/net/ipvlan/ipvlan_main.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Eric Dumazet April 5, 2024, 6:21 p.m. UTC | #1
On Fri, Apr 5, 2024 at 8:16 PM Venkat Venkatsubra
<venkat.x.venkatsubra@oracle.com> wrote:
>
> In case of stacked devices, to help propagate the down
> link state from the parent/root device (to this leaf device),
> handle NETDEV_DOWN event like it is done now for NETDEV_UP.
>
> In the below example, ens5 is the host interface which is the
> parent of the ipvlan interface eth0 in the container.
>

Reviewed-by: Eric Dumazet <edumazet@google.com>
Thanks.
patchwork-bot+netdevbpf@kernel.org April 8, 2024, 12:21 p.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Fri,  5 Apr 2024 11:16:12 -0700 you wrote:
> In case of stacked devices, to help propagate the down
> link state from the parent/root device (to this leaf device),
> handle NETDEV_DOWN event like it is done now for NETDEV_UP.
> 
> In the below example, ens5 is the host interface which is the
> parent of the ipvlan interface eth0 in the container.
> 
> [...]

Here is the summary with links:
  - [net-next,v2] ipvlan: handle NETDEV_DOWN event
    https://git.kernel.org/netdev/net-next/c/229783970838

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c
index 5920f7e63352..094f44dac5c8 100644
--- a/drivers/net/ipvlan/ipvlan_main.c
+++ b/drivers/net/ipvlan/ipvlan_main.c
@@ -735,6 +735,7 @@  static int ipvlan_device_event(struct notifier_block *unused,
 
 	switch (event) {
 	case NETDEV_UP:
+	case NETDEV_DOWN:
 	case NETDEV_CHANGE:
 		list_for_each_entry(ipvlan, &port->ipvlans, pnode)
 			netif_stacked_transfer_operstate(ipvlan->phy_dev,