* [PATCH net-next] Add handling of NETDEV_DOWN event
@ 2024-03-31 13:41 Venkat Venkatsubra
2024-03-31 13:41 ` [PATCH net-next] ipvlan: handle " Venkat Venkatsubra
2024-04-04 2:07 ` [PATCH net-next] Add handling of " Jakub Kicinski
0 siblings, 2 replies; 4+ messages in thread
From: Venkat Venkatsubra @ 2024-03-31 13:41 UTC (permalink / raw)
To: davem, netdev, linux-kernel, maheshb, edumazet; +Cc: gia-khanh.nguyen
When ethP is the parent interface of ipvlan interface ethC,
and you do
# ip link set ethP down
ethC's link state is not brought down.
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 continues to remain UP.
macvlan already addresses this handling of NETDEV_DOWN event.
Adding the same functionality to ipvlan.
Venkat Venkatsubra (1):
ipvlan: handle NETDEV_DOWN event
drivers/net/ipvlan/ipvlan_main.c | 1 +
1 file changed, 1 insertion(+)
--
1.8.3.1
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH net-next] ipvlan: handle NETDEV_DOWN event
2024-03-31 13:41 [PATCH net-next] Add handling of NETDEV_DOWN event Venkat Venkatsubra
@ 2024-03-31 13:41 ` Venkat Venkatsubra
2024-04-04 2:08 ` Jakub Kicinski
2024-04-04 2:07 ` [PATCH net-next] Add handling of " Jakub Kicinski
1 sibling, 1 reply; 4+ messages in thread
From: Venkat Venkatsubra @ 2024-03-31 13:41 UTC (permalink / raw)
To: davem, netdev, linux-kernel, maheshb, edumazet; +Cc: gia-khanh.nguyen
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.
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..724d660904a2 100644
--- a/drivers/net/ipvlan/ipvlan_main.c
+++ b/drivers/net/ipvlan/ipvlan_main.c
@@ -736,6 +736,7 @@ static int ipvlan_device_event(struct notifier_block *unused,
switch (event) {
case NETDEV_UP:
case NETDEV_CHANGE:
+ case NETDEV_DOWN:
list_for_each_entry(ipvlan, &port->ipvlans, pnode)
netif_stacked_transfer_operstate(ipvlan->phy_dev,
ipvlan->dev);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH net-next] ipvlan: handle NETDEV_DOWN event
2024-03-31 13:41 ` [PATCH net-next] ipvlan: handle " Venkat Venkatsubra
@ 2024-04-04 2:08 ` Jakub Kicinski
0 siblings, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2024-04-04 2:08 UTC (permalink / raw)
To: Venkat Venkatsubra
Cc: davem, netdev, linux-kernel, maheshb, edumazet, gia-khanh.nguyen
On Sun, 31 Mar 2024 06:41:29 -0700 Venkat Venkatsubra 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.
>
> 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.
When you squash the cover letter in, please add say that for macvlan
the handling 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..724d660904a2 100644
> --- a/drivers/net/ipvlan/ipvlan_main.c
> +++ b/drivers/net/ipvlan/ipvlan_main.c
> @@ -736,6 +736,7 @@ static int ipvlan_device_event(struct notifier_block *unused,
> switch (event) {
> case NETDEV_UP:
> case NETDEV_CHANGE:
> + case NETDEV_DOWN:
Maybe put these in the same order they are in macvlan?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] Add handling of NETDEV_DOWN event
2024-03-31 13:41 [PATCH net-next] Add handling of NETDEV_DOWN event Venkat Venkatsubra
2024-03-31 13:41 ` [PATCH net-next] ipvlan: handle " Venkat Venkatsubra
@ 2024-04-04 2:07 ` Jakub Kicinski
1 sibling, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2024-04-04 2:07 UTC (permalink / raw)
To: Venkat Venkatsubra
Cc: davem, netdev, linux-kernel, maheshb, edumazet, gia-khanh.nguyen
On Sun, 31 Mar 2024 06:41:28 -0700 Venkat Venkatsubra wrote:
> When ethP is the parent interface of ipvlan interface ethC,
> and you do
>
> # ip link set ethP down
>
> ethC's link state is not brought down.
>
> 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 continues to remain UP.
No need to add a cover letter for a single patch.
Add what's relevant to the main commit message.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-04-04 2:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-31 13:41 [PATCH net-next] Add handling of NETDEV_DOWN event Venkat Venkatsubra
2024-03-31 13:41 ` [PATCH net-next] ipvlan: handle " Venkat Venkatsubra
2024-04-04 2:08 ` Jakub Kicinski
2024-04-04 2:07 ` [PATCH net-next] Add handling of " Jakub Kicinski
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).