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

Guangguan Wang
2025-03-04T02:39:18Z

On 2025/3/3 22:24, Halil Pasic wrote:
> On Tue, 11 Feb 2025 11:44:32 +0800
> Guangguan Wang <guangguan.wang@linux.alibaba.com> wrote:
>
>>> Can you please help me reason about this? I'm unfortunately lacking
>>> Kubernetes skills here, and it is difficult for me to think along.
>>
>> Yes, it is also a problem that not being able to set eth0 (veth/POD)'s PNEDID from the host.
>> Even if the eth1(host) have hardware PNETID, the eth0 (veth/POD) can not search the hardware
>> PNETID. Because the eth0 (veth/POD) and eth1(host) are not in one netdev hierarchy.
>> But the two netdev hierarchies have relationship. Maybe search PNETID in all related netdev
>> hierarchies can help resolve this. For example when finding the base_ndev, if the base_ndev
>> is a netdev has relationship with other netdev(veth .etc) then jump to the related netdev
>> hierarchy through the relationship to iteratively find the base_ndev.
>> It is an idea now. I have not do any research about it yet and I am not sure if it is feasible.
>
> I did a fair amount of thinking and I've talked to Wenjia and Sandy as
> well, and now I'm fine with moving forward with a variant that
> prioritizes compatibility but makes the scenarios you have pointed out
> work by enabling taking the SW PNETID of the non-leaf netdev(s) if the
> base_dev has no PNETID (neither hw nor sw).
>
> Regards,
> Halil

Thanks Halil, Wenjia and Alexandra.

I will send a v2 patch soon, in which software pnetid will be searched in both base_ndev and ndev,
and base_ndev will take precedence over ndev.

Regards,
Guangguan Wang