mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 06:41:06 -04:00
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. Link: https://patch.msgid.link/r/20240822065223.1117056-2-pizhenwei@bytedance.com Signed-off-by: zhenwei pi <pizhenwei@bytedance.com> Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
This commit is contained in:
committed by
Jason Gunthorpe
parent
ae46d3fc17
commit
c87c5f47ff
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user