RE: [PATCH rdma-next 1/6] RDMA/cma: Check existence of netdevice during port validation

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

 




> -----Original Message-----
> From: Jason Gunthorpe
> Sent: Monday, January 22, 2018 12:48 PM
> To: Leon Romanovsky <leon@xxxxxxxxxx>
> Cc: Doug Ledford <dledford@xxxxxxxxxx>; RDMA mailing list <linux-
> rdma@xxxxxxxxxxxxxxx>; Daniel Jurgens <danielj@xxxxxxxxxxxx>; Mark Bloch
> <markb@xxxxxxxxxxxx>; Parav Pandit <parav@xxxxxxxxxxxx>
> Subject: Re: [PATCH rdma-next 1/6] RDMA/cma: Check existence of netdevice
> during port validation
> 
> On Tue, Jan 09, 2018 at 03:58:54PM +0200, Leon Romanovsky wrote:
> > From: Parav Pandit <parav@xxxxxxxxxxxx>
> >
> > If valid netdevice is not found for RoCE, GID table should not be
> > searched with NULL netdevice.
> >
> > Fixes: abae1b71dd37 ("IB/cma: cma_validate_port should verify the port
> > and netdevice")
> > Signed-off-by: Parav Pandit <parav@xxxxxxxxxxxx>
> > Reviewed-by: Mark Bloch <markb@xxxxxxxxxxxx>
> > Signed-off-by: Leon Romanovsky <leon@xxxxxxxxxx>
> > drivers/infiniband/core/cma.c | 8 +++++---
> >  1 file changed, 5 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/infiniband/core/cma.c
> > b/drivers/infiniband/core/cma.c index 169d3a3bbf71..683428cffd54
> > 100644
> > +++ b/drivers/infiniband/core/cma.c
> > @@ -624,11 +624,13 @@ static inline int cma_validate_port(struct ib_device
> *device, u8 port,
> >  	if ((dev_type != ARPHRD_INFINIBAND) && rdma_protocol_ib(device,
> port))
> >  		return ret;
> >
> > -	if (dev_type == ARPHRD_ETHER && rdma_protocol_roce(device, port))
> > +	if (dev_type == ARPHRD_ETHER && rdma_protocol_roce(device, port)) {
> >  		ndev = dev_get_by_index(&init_net, bound_if_index);
> 
> Why are we using indexes as a long term handle to netdevs? Is there some
> reason for this you know of?
I am not sure why index was used instead of netdev pointer in beginning.
I do prefer pointer. Sometime back I tried to look at this code but dropped the idea due to convoluted code of rdma_translate_ip() and rdma_copy_addr().

> 
> Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux