Re: [PATCH rdma-next 01/11] RDMA/core Introduce and use rdma_find_ndev_for_src_ip_rcu

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

 



On Wed, Sep 05, 2018 at 04:07:48PM -0600, Parav Pandit wrote:

> > Is taking it before calling  rdma_find_ndev_for_src_ip_rcu() the right thing to do?
> Likely because rcu_read_lock can be nested as per [1].

> If we do rcu_read_lock() inside rdma_find_ndev_for_src_ip_rcu(), we
> need to dev_hold and dev_put() and handle code differently between
> ipv4 and v6. 

?? We already have dev_hold in both and we already dev_put, if we move
the read_lock it would be just to put it in the ipv6 leg of that switch..

> However, dev_hold() and dev_put() doesn't guarantee that netdev
> fields won't change such as ifindex. It just ensures that netdev
> exist.

That explanation would make more sense if we didn't immediately drop
the rcu after copying the if_index into a struct. 

Nothing can safely read that structure member, so why did we do it?

I thought we got rid of all the ifindex stuff? Is this just a
weirdness in-between patches in the series? I haven't got to look at
these patches yet..

There is definately something wonky here..

Jason



[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