All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Alok Tiwari <alok.a.tiwari@oracle.com>
Cc: somnath.kotur@broadcom.com, sriharsha.basavapatna@broadcom.com,
	jgg@ziepe.ca, kalesh-anakkur.purayil@broadcom.com,
	selvin.xavier@broadcom.com, linux-rdma@vger.kernel.org,
	alok.a.tiwarilinux@gmail.com
Subject: Re: [PATCH] RDMA/bnxt_re: Fix IB_SEND_IP_CSUM handling in post_send
Date: Sun, 21 Dec 2025 11:42:23 +0200	[thread overview]
Message-ID: <20251221094223.GH13030@unreal> (raw)
In-Reply-To: <20251219093308.2415620-1-alok.a.tiwari@oracle.com>

On Fri, Dec 19, 2025 at 01:32:57AM -0800, Alok Tiwari wrote:
> The bnxt_re SEND path checks wr->send_flags to enable features such as
> IP checksum offload. However, send_flags is a bitmask and may contain
> multiple flags (e.g. IB_SEND_SIGNALED | IB_SEND_IP_CSUM), while the
> existing code uses a switch() statement that only matches when
> send_flags is exactly IB_SEND_IP_CSUM.
> 
> As a result, checksum offload is not enabled when additional SEND
> flags are present.
> 
> Replace the switch() with a bitmask test:
> 
>     if (wr->send_flags & IB_SEND_IP_CSUM)
> 
> This ensures IP checksum offload is enabled correctly when multiple
> SEND flags are used.
> 
> Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
> Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
> ---
>  drivers/infiniband/hw/bnxt_re/ib_verbs.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> index f19b55c13d58..ff91511bd338 100644
> --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> @@ -2919,14 +2919,9 @@ int bnxt_re_post_send(struct ib_qp *ib_qp, const struct ib_send_wr *wr,
>  				wqe.rawqp1.lflags |=
>  					SQ_SEND_RAWETH_QP1_LFLAGS_ROCE_CRC;
>  			}
> -			switch (wr->send_flags) {
> -			case IB_SEND_IP_CSUM:
> +			if (wr->send_flags & IB_SEND_IP_CSUM)
>  				wqe.rawqp1.lflags |=
>  					SQ_SEND_RAWETH_QP1_LFLAGS_IP_CHKSUM;
> -				break;

> -			default:
> -				break;
> -			}
>  			fallthrough;

The combination of "default with break" and "fallthrough" doesn't make
any sense. Are you sure that we should keep "fallthrough"?

Thanks

>  		case IB_WR_SEND_WITH_INV:
>  			rc = bnxt_re_build_send_wqe(qp, wr, &wqe);
> -- 
> 2.50.1
> 

  reply	other threads:[~2025-12-21  9:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-19  9:32 [PATCH] RDMA/bnxt_re: Fix IB_SEND_IP_CSUM handling in post_send Alok Tiwari
2025-12-21  9:42 ` Leon Romanovsky [this message]
2025-12-21 16:03   ` ALOK TIWARI
2025-12-21 15:56 ` Kalesh Anakkur Purayil
2025-12-22  8:04 ` Leon Romanovsky

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=20251221094223.GH13030@unreal \
    --to=leon@kernel.org \
    --cc=alok.a.tiwari@oracle.com \
    --cc=alok.a.tiwarilinux@gmail.com \
    --cc=jgg@ziepe.ca \
    --cc=kalesh-anakkur.purayil@broadcom.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=selvin.xavier@broadcom.com \
    --cc=somnath.kotur@broadcom.com \
    --cc=sriharsha.basavapatna@broadcom.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.