Subject: Re: [PATCH net] net/smc: use the correct ndev to find pnetid by pnetid table

From: Halil Pasic <[email-masked]>
Date: Mon, 10 Feb 2025 15:19:17 +0100

On Wed, 15 Jan 2025 19:53:15 +0800
Guangguan Wang <[email-masked]> wrote:

> > Imagine the following you have your nice little setup with a PNETID on
> > a non-leaf and a base_ndev that has no PNETID. Then your HW admin
> > configures a PNETID to your base_ndev, a different one. Suddenly
> > your ndev PNETID is ignored for reasons not obvious to you. Yes it is
> > similar to having a software PNETID on the base_ndev and getting it
> > overruled by a HW PNETID, but much less obvious IMHO. I am wondering if there are any scenarios that require setting different  
> pnetids for different net devices in one netdev hierarchy. If no, maybe
> we should limit that only one pnetid can be set to one netdev hierarchy.

I wonder what topologies and changes to topologies are possible. If
changes to a topology are possible then making sure there is only one
PNETID within a netdev hierarchy can be difficult, as we would need
to prevent changing the topology if a device has a not PNETID. (E.g.
we first set a pnetid when the netdev is still not in a hierarchy
and then try to put it into the hierarchy that already has a different
PNETID within). Regarding allowable topologies, using your ASCII-art.

I think you could add 2 Pods with an IPVLAN eth0 (Pod) on top of eth1
(host) each. Those would be in a single hierarchy I guess, but I guess
you would still want to be able to set (most likely the same) PNETID
on each.

Bottom line is, this approach looks tricky to me. Maybe with a crisper
explanation on what are these upper-lower links for. Maybe I am
overgeneralizing here.

Regards,
Halil