2025-04-03, 13:09:02 +0000, Hangbin Liu wrote:
> Hi Sabrina,
> On Thu, Apr 03, 2025 at 12:28:54PM +0200, Sabrina Dubroca wrote:
> > Hello Hangbin,
> > 
> > 2025-04-03, 08:58:55 +0000, Hangbin Liu wrote:
> > > When setting the lower-layer link up/down, the ipvlan device synchronizes
> > > its state via netif_stacked_transfer_operstate(), which only checks the
> > > carrier state. However, setting the link down does not necessarily change
> > > the carrier state for virtual interfaces like bonding. This causes the
> > > ipvlan state to become out of sync with the lower-layer link state.
> > > 
> > > If the lower link and ipvlan are in the same namespace, this issue is
> > > hidden because ip link show checks the link state in IFLA_LINK and has
> > > a m_flag to control the state, displaying M-DOWN in the flags. However,
> > > if the ipvlan and the lower link are in different namespaces, this
> > > information is not available, and the ipvlan link state remains unchanged.
> > 
> > Is the issue with the actual behavior (sending/receiving packets,
> > etc), or just in how it's displayed by iproute?
> 
> The upper link in netns up while lower link down will cause the traffic break
> in the pod.

That seems like the correct behavior based on the actual (not
displayed) state of the links.


I wonder if netif_stacked_transfer_operstate should consider the admin
state of the lower device as well as link state:

@@ -10724,7 +10724,7 @@ void netif_stacked_transfer_operstate(const struct 
net_device *rootdev,
        else
                netif_testing_off(dev);
 
-       if (netif_carrier_ok(rootdev))
+       if (netif_carrier_ok(rootdev) && rootdev->flags & IFF_UP)
                netif_carrier_on(dev);
        else
                netif_carrier_off(dev);


but I haven't looked at all the consequences and possible side
effects.

-- 
Sabrina

Reply via email to