[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <baadce1c-7fd7-4756-9d4a-4a79483e576e@gmail.com>
Date: Sun, 10 Dec 2023 18:56:26 -0600
From: Bob Pearson <rpearsonhpe@...il.com>
To: David Ahern <dsahern@...nel.org>, jgg@...dia.com, yanjun.zhu@...ux.dev,
linux-rdma@...r.kernel.org, netdev@...r.kernel.org, rain.1986.08.12@...il.com
Subject: Re: [PATCH for-next v6 3/7] RDMA/rxe: Register IP mcast address
On 12/8/23 09:50, David Ahern wrote:
> On 12/7/23 12:29 PM, Bob Pearson wrote:
>> diff --git a/drivers/infiniband/sw/rxe/rxe_mcast.c b/drivers/infiniband/sw/rxe/rxe_mcast.c
>> index 86cc2e18a7fd..5236761892dd 100644
>> --- a/drivers/infiniband/sw/rxe/rxe_mcast.c
>> +++ b/drivers/infiniband/sw/rxe/rxe_mcast.c
>> @@ -19,38 +19,116 @@
>> * mcast packets in the rxe receive path.
>> */
>>
>> +#include <linux/igmp.h>
>> +
>> #include "rxe.h"
>>
>> -/**
>> - * rxe_mcast_add - add multicast address to rxe device
>> - * @rxe: rxe device object
>> - * @mgid: multicast address as a gid
>> - *
>> - * Returns 0 on success else an error
>> - */
>> -static int rxe_mcast_add(struct rxe_dev *rxe, union ib_gid *mgid)
>> +static int rxe_mcast_add6(struct rxe_dev *rxe, union ib_gid *mgid)
>> {
>> + struct in6_addr *addr6 = (struct in6_addr *)mgid;
>> + struct sock *sk = recv_sockets.sk6->sk;
>> unsigned char ll_addr[ETH_ALEN];
>> + int err;
>> +
>> + lock_sock(sk);
>> + rtnl_lock();
>
> reverse the order. rtnl is always taken first, then socket lock.
>
> Actually, I think it would be better to avoid burying this logic in the
> rxe driver. Can you try using the setsockopt API? I think it is now
> usable within the kernel again after the refactoring for io_uring.
>
>
David,
Thanks for looking at this. What is the in kernel setsock api? I'll give
it a try but I am not sure what to call.
Bob
>
>
Powered by blists - more mailing lists