public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Wentao Liang <vulab@iscas.ac.cn>
To: mustafa.ismail@intel.com, tatyana.e.nikolova@intel.com,
	jgg@ziepe.ca, leon@kernel.org
Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
	Wentao Liang <vulab@iscas.ac.cn>,
	stable@vger.kernel.org
Subject: [PATCH v2] RDMA/irdma: puda: Clear entries after allocation to ensure clean state
Date: Sun, 18 May 2025 22:49:42 +0800	[thread overview]
Message-ID: <20250518144942.714-1-vulab@iscas.ac.cn> (raw)

The irdma_puda_send() calls the irdma_puda_get_next_send_wqe() to get
entries, but does not clear the entries after the function call. A proper
implementation can be found in irdma_uk_send().

Add the irdma_clr_wqes() after irdma_puda_get_next_send_wqe(). Add the
headfile of the irdma_clr_wqes().

Fixes: a3a06db504d3 ("RDMA/irdma: Add privileged UDA queue implementation")
Cc: stable@vger.kernel.org # v5.14
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
v2: Fix code error and remove improper description.

 drivers/infiniband/hw/irdma/puda.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/infiniband/hw/irdma/puda.c b/drivers/infiniband/hw/irdma/puda.c
index 7e3f9bca2c23..f7a826a5bedf 100644
--- a/drivers/infiniband/hw/irdma/puda.c
+++ b/drivers/infiniband/hw/irdma/puda.c
@@ -7,6 +7,7 @@
 #include "protos.h"
 #include "puda.h"
 #include "ws.h"
+#include "user.h"
 
 static void irdma_ieq_receive(struct irdma_sc_vsi *vsi,
 			      struct irdma_puda_buf *buf);
@@ -444,6 +445,8 @@ int irdma_puda_send(struct irdma_sc_qp *qp, struct irdma_puda_send_info *info)
 	if (!wqe)
 		return -ENOMEM;
 
+	irdma_clr_wqes(&qp->qp_uk, wqe_idx);
+
 	qp->qp_uk.sq_wrtrk_array[wqe_idx].wrid = (uintptr_t)info->scratch;
 	/* Third line of WQE descriptor */
 	/* maclen is in words */
-- 
2.42.0.windows.2


             reply	other threads:[~2025-05-18 14:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-18 14:49 Wentao Liang [this message]
2025-05-20 13:15 ` [PATCH v2] RDMA/irdma: puda: Clear entries after allocation to ensure clean state 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=20250518144942.714-1-vulab@iscas.ac.cn \
    --to=vulab@iscas.ac.cn \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mustafa.ismail@intel.com \
    --cc=stable@vger.kernel.org \
    --cc=tatyana.e.nikolova@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox