RE: [EXTERNAL] Re: [Patch v2 0/3] IB/core: Fix GID cache for bonded net devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Subject: [EXTERNAL] Re: [Patch v2 0/3] IB/core: Fix GID cache for bonded net
> devices
> 
> On Fri, Feb 07, 2025 at 01:36:15PM -0800, longli@xxxxxxxxxxxxxxxxx wrote:
> > From: Long Li <longli@xxxxxxxxxxxxx>
> >
> > When populating GID cache for net devices in a bonded setup, it should
> > use the master device's address whenever applicable.
> >
> > The current code has some incorrect behaviors when dealing with bonded
> devices:
> > 1. It adds IP of bonded slave to the GID cache when the device is
> > already bonded 2. It adds IP of bonded slave to the GID cache when the
> > device becomes bonded (via NETDEV_CHANGEUPPER notifier) 3. When a
> bonded slave device is unbonded, it doesn't add its IP to the default table in GID
> cache.
> 
> I took a look at the patches and would like to see the reasoning why current
> behaviour is incorrect and need to be changed. In addition, there is a need to add
> examples of what is "broken" now and will start to work after the fixes.
> 
> Thanks


Thanks for looking. I will work on another set of patches based on feedback from:
https://lore.kernel.org/lkml/20250211163735.18d0fd02@hermes.local/

I have some questions on the RDMA GID cache code determining GID cache based on bonded device states. Please see following.

For an IB device, the RDMA GID cache code (rdma_roce_rescan_device() in drivers/infiniband/core/roce_gid_mgmt.c) looks at the following devices for its default GIDs:
1. This IB device if it is not a bonded slave (if this IB device is a slave but not bonded, it will be used for default GIDs)
2. This IB device's bonded master devices
Please see is_ndev_for_default_gid_filter() as its filtering function

And for those devices for this IB device's non-default GIDs:
1. An upper device to this IB device that is not bonded
2. An upper device to this IB device that is bonded to this IB device, and this IB device is the current active bonded slave
3. This IB device if it's not a VLAN type
See is_eth_port_of_netdev_filter() as its filtering function

To summarize, the GID caching behavior for an IB device which is also a slave device, looks like below:
1. It seems all upper devices (bonded or not) to this IB device will be used in the GID cache, but only its bonding master is used for the default GID cache
2. The IB device will not be used in default GID cache if it's bonded
3. The IB device will always be used in non-default GID caches. (assuming it's not VLAN)

My understanding is that the default GID cache will look for bonded master when checking on a slave device and its upper devices. The non-default GID cache just takes this IB device and all its upper devices.

Why the default GID cache needs to check bonded devices?

Thanks,
Long





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux