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

longli@linuxonhyperv.com posted 3 patches 1 year ago
drivers/infiniband/core/roce_gid_mgmt.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
[Patch v2 0/3] IB/core: Fix GID cache for bonded net devices
Posted by longli@linuxonhyperv.com 1 year ago
From: Long Li <longli@microsoft.com>

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.

The patchset fixes those issues.

Changes log:
v2: Added cover letter explaining the overall problem and current behaviors.

Long Li (3):
  IB/core: Do not use netdev IP if it is a bonded slave
  IB/core: Use upper_device_filter to add upper ips
  IB/core: Add default IP when a slave is unlinked

 drivers/infiniband/core/roce_gid_mgmt.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

-- 
2.34.1
Re: [Patch v2 0/3] IB/core: Fix GID cache for bonded net devices
Posted by Leon Romanovsky 12 months ago
On Fri, Feb 07, 2025 at 01:36:15PM -0800, longli@linuxonhyperv.com wrote:
> From: Long Li <longli@microsoft.com>
> 
> 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


> 
> The patchset fixes those issues.
> 
> Changes log:
> v2: Added cover letter explaining the overall problem and current behaviors.
> 
> Long Li (3):
>   IB/core: Do not use netdev IP if it is a bonded slave
>   IB/core: Use upper_device_filter to add upper ips
>   IB/core: Add default IP when a slave is unlinked
> 
>  drivers/infiniband/core/roce_gid_mgmt.c | 17 +++++++++--------
>  1 file changed, 9 insertions(+), 8 deletions(-)
> 
> -- 
> 2.34.1
>