All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bob Pearson <rpearsonhpe@gmail.com>
To: jgg@nvidia.com, zyjzyj2000@gmail.com, linux-rdma@vger.kernel.org
Cc: Bob Pearson <rpearsonhpe@gmail.com>
Subject: [PATCH 2/2] providers/rxe: Remove redundant num_sge fields
Date: Tue, 13 Sep 2022 17:30:51 -0500	[thread overview]
Message-ID: <20220913223050.18416-3-rpearsonhpe@gmail.com> (raw)
In-Reply-To: <20220913223050.18416-1-rpearsonhpe@gmail.com>

This patch is a matching patch to a kernel patch
"RDMA/rxe: Remove redundant num_sge fields" which
performs the same function for the kernel rxe driver.

Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
---
 providers/rxe/rxe.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/providers/rxe/rxe.c b/providers/rxe/rxe.c
index 9a900e4d..0e8f5605 100644
--- a/providers/rxe/rxe.c
+++ b/providers/rxe/rxe.c
@@ -679,6 +679,7 @@ static int rxe_post_one_recv(struct rxe_wq *rq, struct ibv_recv_wr *recv_wr)
 	int i;
 	struct rxe_recv_wqe *wqe;
 	struct rxe_queue_buf *q = rq->queue;
+	int num_sge = recv_wr->num_sge;
 	int length = 0;
 	int rc = 0;
 
@@ -687,7 +688,7 @@ static int rxe_post_one_recv(struct rxe_wq *rq, struct ibv_recv_wr *recv_wr)
 		goto out;
 	}
 
-	if (recv_wr->num_sge > rq->max_sge) {
+	if (num_sge > rq->max_sge) {
 		rc = EINVAL;
 		goto out;
 	}
@@ -695,18 +696,17 @@ static int rxe_post_one_recv(struct rxe_wq *rq, struct ibv_recv_wr *recv_wr)
 	wqe = (struct rxe_recv_wqe *)producer_addr(q);
 
 	wqe->wr_id = recv_wr->wr_id;
-	wqe->num_sge = recv_wr->num_sge;
 
 	memcpy(wqe->dma.sge, recv_wr->sg_list,
-	       wqe->num_sge*sizeof(*wqe->dma.sge));
+	       num_sge*sizeof(*wqe->dma.sge));
 
-	for (i = 0; i < wqe->num_sge; i++)
+	for (i = 0; i < num_sge; i++)
 		length += wqe->dma.sge[i].length;
 
 	wqe->dma.length = length;
 	wqe->dma.resid = length;
 	wqe->dma.cur_sge = 0;
-	wqe->dma.num_sge = wqe->num_sge;
+	wqe->dma.num_sge = num_sge;
 	wqe->dma.sge_offset = 0;
 
 	advance_producer(q);
@@ -1406,7 +1406,6 @@ static void convert_send_wr(struct rxe_qp *qp, struct rxe_send_wr *kwr,
 	memset(kwr, 0, sizeof(*kwr));
 
 	kwr->wr_id		= uwr->wr_id;
-	kwr->num_sge		= uwr->num_sge;
 	kwr->opcode		= uwr->opcode;
 	kwr->send_flags		= uwr->send_flags;
 	kwr->ex.imm_data	= uwr->imm_data;
-- 
2.34.1


      parent reply	other threads:[~2022-09-13 22:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-13 22:30 [PATCH 0/2] providers/rxe: Remove redundant num_sge_fields Bob Pearson
2022-09-13 22:30 ` [PATCH 1/2] Update kernel headers Bob Pearson
2022-09-13 22:30 ` Bob Pearson [this message]

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=20220913223050.18416-3-rpearsonhpe@gmail.com \
    --to=rpearsonhpe@gmail.com \
    --cc=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=zyjzyj2000@gmail.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.