From: David Ahern <dsahern@kernel.org>
To: Bob Pearson <rpearsonhpe@gmail.com>,
jgg@nvidia.com, yanjun.zhu@linux.dev, linux-rdma@vger.kernel.org,
netdev@vger.kernel.org, rain.1986.08.12@gmail.com
Subject: Re: [PATCH for-next v6 3/7] RDMA/rxe: Register IP mcast address
Date: Fri, 8 Dec 2023 08:50:38 -0700 [thread overview]
Message-ID: <7e370f63-f256-45f3-89c9-7774877afaba@kernel.org> (raw)
In-Reply-To: <20231207192907.10113-4-rpearsonhpe@gmail.com>
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.
next prev parent reply other threads:[~2023-12-08 15:50 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-07 19:29 [PATCH for-next v6 0/7] RDMA/rxe: Make multicast work Bob Pearson
2023-12-07 19:29 ` [PATCH for-next v6 1/7] RDMA/rxe: Cleanup rxe_ah/av_chk_attr Bob Pearson
2023-12-07 19:29 ` [PATCH for-next v6 2/7] RDMA/rxe: Fix sending of mcast packets Bob Pearson
2023-12-07 19:29 ` [PATCH for-next v6 3/7] RDMA/rxe: Register IP mcast address Bob Pearson
2023-12-08 13:52 ` Zhu Yanjun
2023-12-08 15:51 ` David Ahern
2023-12-08 15:50 ` David Ahern [this message]
2023-12-09 11:32 ` Zhu Yanjun
2023-12-11 0:56 ` Bob Pearson
2023-12-11 2:01 ` David Ahern
2023-12-07 19:29 ` [PATCH for-next v6 4/7] RDMA/rxe: Let rxe_lookup_mcg use rcu_read_lock Bob Pearson
2023-12-07 19:29 ` [PATCH for-next v6 5/7] RDMA/rxe: Split multicast lock Bob Pearson
2023-12-07 19:29 ` [PATCH for-next v6 6/7] RDMA/rxe: Cleanup mcg lifetime Bob Pearson
2023-12-07 19:29 ` [PATCH for-next v6 7/7] RDMA/rxe: Add module parameters for mcast limits Bob Pearson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7e370f63-f256-45f3-89c9-7774877afaba@kernel.org \
--to=dsahern@kernel.org \
--cc=jgg@nvidia.com \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rain.1986.08.12@gmail.com \
--cc=rpearsonhpe@gmail.com \
--cc=yanjun.zhu@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox