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