> -----Original Message----- > From: Leon Romanovsky <leon@xxxxxxxxxx> > Sent: Thursday, December 6, 2018 12:48 PM > To: Doug Ledford <dledford@xxxxxxxxxx> > Cc: Jason Gunthorpe <jgg@xxxxxxxxxxxx>; Mark Zhang > <markz@xxxxxxxxxxxx>; RDMA mailing list <linux-rdma@xxxxxxxxxxxxxxx>; > Parav Pandit <parav@xxxxxxxxxxxx> > Subject: Re: [PATCH rdma-rc] IB/core: Don't match bond master filter for > closed slaves > > On Thu, Dec 06, 2018 at 12:19:30PM -0500, Doug Ledford wrote: > > On Wed, 2018-12-05 at 15:50 +0200, Leon Romanovsky wrote: > > > From: Mark Zhang <markz@xxxxxxxxxxxx> > > > > > > The "modprobe -r mlx4_en" will close bond slaves and in such case > > > the rdma_dev would be NULL, so no match should be returned. > > > > I'm not groking your commit message. What happens without this patch? > > We will see calltrace due to the fact that NULL is passed down the stack > through rdma_is_upper_dev_rcu() upto netdev_walk_all_upper_dev_rcu(). > I see this patch being sent for -rc which I was not sure when I reviewed. Commit message needs to change as below. When mlx4_en driver is unloaded, and configured to use bond devices, get_netdev() callback returns NULL because associated netdev is unregistered. Therefore, similar to other filter() routines, fix is_upper_ndev_bond_master_filter() to handle NULL netdev. Without this check, a call trace is observed. > > > Fixes: 408f1242d940 ("IB/core: Delete lower netdevice default GID > > > entries in bonding scenario") > > > Signed-off-by: Mark Zhang <markz@xxxxxxxxxxxx> > > > Reviewed-by: Parav Pandit <parav@xxxxxxxxxxxx> > > > Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx> > > > --- > > > drivers/infiniband/core/roce_gid_mgmt.c | 3 +++ > > > 1 file changed, 3 insertions(+) > > > > > > diff --git a/drivers/infiniband/core/roce_gid_mgmt.c > > > b/drivers/infiniband/core/roce_gid_mgmt.c > > > index 25d43c8f1c2a..558de0b9895c 100644 > > > --- a/drivers/infiniband/core/roce_gid_mgmt.c > > > +++ b/drivers/infiniband/core/roce_gid_mgmt.c > > > @@ -267,6 +267,9 @@ is_upper_ndev_bond_master_filter(struct > ib_device *ib_dev, u8 port, > > > struct net_device *cookie_ndev = cookie; > > > bool match = false; > > > > > > + if (!rdma_ndev) > > > + return false; > > > + > > > rcu_read_lock(); > > > if (netif_is_bond_master(cookie_ndev) && > > > rdma_is_upper_dev_rcu(rdma_ndev, cookie_ndev)) > > > > -- > > Doug Ledford <dledford@xxxxxxxxxx> > > GPG KeyID: B826A3330E572FDD > > Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 > > 2FDD >