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]

 



On Mon, Jan 22, 2018 at 01:39:19PM -0700, Parav Pandit wrote:

> > > -	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().

I think we should change it.

I tried to convince myself these patches were right, and that net and
bound_if_index are actually coherent and it was far too hard in
general.

The best I could do was to convince myself that the listen/accept path
was probably OK..

This whole thing seems so baroque these days, and now that ifindexes
can be aliased across net namespaces, and even changed during a single
netdevice lifetime, it seems dangerous..

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