From: Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com>
To: davem@davemloft.net, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, maheshb@google.com,
edumazet@google.com, kuba@kernel.org
Cc: gia-khanh.nguyen@oracle.com
Subject: [PATCH net-next v2] ipvlan: handle NETDEV_DOWN event
Date: Fri, 5 Apr 2024 11:16:12 -0700 [thread overview]
Message-ID: <1712340972-13643-1-git-send-email-venkat.x.venkatsubra@oracle.com> (raw)
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(+)
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,
--
1.8.3.1
next reply other threads:[~2024-04-05 18:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-05 18:16 Venkat Venkatsubra [this message]
2024-04-05 18:21 ` [PATCH net-next v2] ipvlan: handle NETDEV_DOWN event Eric Dumazet
2024-04-08 12:21 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1712340972-13643-1-git-send-email-venkat.x.venkatsubra@oracle.com \
--to=venkat.x.venkatsubra@oracle.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gia-khanh.nguyen@oracle.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maheshb@google.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).