[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240822065223.1117056-2-pizhenwei@bytedance.com>
Date: Thu, 22 Aug 2024 14:52:21 +0800
From: zhenwei pi <pizhenwei@...edance.com>
To: linux-rdma@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: zyjzyj2000@...il.com,
jgg@...dia.com,
leonro@...dia.com,
zhenwei pi <pizhenwei@...edance.com>
Subject: [PATCH 1/3] RDMA/rxe: Use sizeof instead of hard code number
Use 'sizeof(union rdma_network_hdr)' instead of hard code GRH length
for GSI and UD.
Signed-off-by: zhenwei pi <pizhenwei@...edance.com>
---
drivers/infiniband/sw/rxe/rxe_resp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c
index 6596a85723c9..bf8f4bc8c5c8 100644
--- a/drivers/infiniband/sw/rxe/rxe_resp.c
+++ b/drivers/infiniband/sw/rxe/rxe_resp.c
@@ -351,7 +351,7 @@ static enum resp_states rxe_resp_check_length(struct rxe_qp *qp,
for (i = 0; i < qp->resp.wqe->dma.num_sge; i++)
recv_buffer_len += qp->resp.wqe->dma.sge[i].length;
- if (payload + 40 > recv_buffer_len) {
+ if (payload + sizeof(union rdma_network_hdr) > recv_buffer_len) {
rxe_dbg_qp(qp, "The receive buffer is too small for this UD packet.\n");
return RESPST_ERR_LENGTH;
}
--
2.34.1
Powered by blists - more mailing lists