Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: William Kucharski <william.kucharski@oracle.com>
To: Guoqing Jiang <guoqing.jiang@linux.dev>
Cc: "yanjun.zhu@linux.dev" <yanjun.zhu@linux.dev>,
	"jgg@ziepe.ca" <jgg@ziepe.ca>,
	"leon@kernel.org" <leon@kernel.org>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>
Subject: Re: [PATCH] RDMA/rxe: No need to check IPV6 in rxe_find_route
Date: Mon, 22 Aug 2022 16:33:51 +0000	[thread overview]
Message-ID: <6E8EBFAA-E346-413E-9DEC-84EC779CBAB6@oracle.com> (raw)
In-Reply-To: <20220822112355.17635-1-guoqing.jiang@linux.dev>

Rather than remove the #if guard here, shouldn't it instead be expanded
to cover the entire

    else if (av->network_type == RXE_NETWORK_TYPE_IPV6) {

clause?

There is no need to check for RXE_NETWORK_TYPE_IPV6, make assignments
to the stack-allocated pointers or call rxe_find_route6() unless
CONFIG_IPV6 is true.

In fact, if CONFIG_IPV6 is false, as rxe_find_route6 would also return
NULL, the else clause to the RXE_NETWORK_TYPE_IPV4 check could instead
become a simple

    return NULL;

> On Aug 22, 2022, at 5:23 AM, Guoqing Jiang <guoqing.jiang@linux.dev> wrote:
> 
> This check is unnecessary since rxe_find_route6 returns NULL if
> CONFIG_IPV6 is disabled.
> 
> Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev>
> ---
> drivers/infiniband/sw/rxe/rxe_net.c | 2 --
> 1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c
> index c53f4529f098..b0f31f849144 100644
> --- a/drivers/infiniband/sw/rxe/rxe_net.c
> +++ b/drivers/infiniband/sw/rxe/rxe_net.c
> @@ -113,11 +113,9 @@ static struct dst_entry *rxe_find_route(struct net_device *ndev,
> saddr6 = &av->sgid_addr._sockaddr_in6.sin6_addr;
> daddr6 = &av->dgid_addr._sockaddr_in6.sin6_addr;
> dst = rxe_find_route6(ndev, saddr6, daddr6);
> -#if IS_ENABLED(CONFIG_IPV6)
> if (dst)
> qp->dst_cookie =
> rt6_get_cookie((struct rt6_info *)dst);
> -#endif
> }
> 
> if (dst && (qp_type(qp) == IB_QPT_RC)) {
> -- 
> 2.31.1
> 


  reply	other threads:[~2022-08-22 16:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-22 11:23 [PATCH] RDMA/rxe: No need to check IPV6 in rxe_find_route Guoqing Jiang
2022-08-22 16:33 ` William Kucharski [this message]
2022-08-23  0:39   ` Guoqing Jiang
2022-08-22 18:49 ` kernel test robot

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=6E8EBFAA-E346-413E-9DEC-84EC779CBAB6@oracle.com \
    --to=william.kucharski@oracle.com \
    --cc=guoqing.jiang@linux.dev \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --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