RDMA/rxe: change variable and function argument to proper type
Subsystems (2)
PATCH v2 1/2 RDMA/rxe: change variable and function argument to proper type
The type of wqe length is u32 so in order to avoid overflow and shadow casting change variable and relevant function argument to proper type.
--- drivers/infiniband/sw/rxe/rxe_req.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/infiniband/sw/rxe/rxe_req.c +5 -5
@@ -359,7 +359,7 @@ static inline int get_mtu(struct rxe_qp *qp)static struct sk_buff *init_req_packet (struct rxe_qp *qp,struct rxe_send_wqe *wqe, -int opcode,int payload, +int opcode,u32 payload,struct rxe_pkt_info *pkt) {struct rxe_dev *rxe =to_rdev (qp->ibqp.device);
@@ -449,7 +449,7 @@ static struct sk_buff *init_req_packet(struct rxe_qp *qp,static int finish_packet (struct rxe_qp *qp,struct rxe_send_wqe *wqe,struct rxe_pkt_info *pkt,struct sk_buff *skb, -int paylen) +u32 paylen) {int err;
@@ -497,7 +497,7 @@ static void update_wqe_state(struct rxe_qp *qp,static void update_wqe_psn (struct rxe_qp *qp,struct rxe_send_wqe *wqe,struct rxe_pkt_info *pkt, -int payload) +u32 payload) {/* number of packets left to send including current one */ int num_pkt = (wqe->dma.resid + payload + qp->mtu -1 ) / qp->mtu;
@@ -540,7 +540,7 @@ static void rollback_state(struct rxe_send_wqe *wqe, }static void update_state (struct rxe_qp *qp,struct rxe_send_wqe *wqe, -struct rxe_pkt_info *pkt,int payload) +struct rxe_pkt_info *pkt,u32 payload) { qp->req.opcode = pkt->opcode;
@@ -612,7 +612,7 @@ int rxe_requester(void *arg)struct sk_buff *skb;struct rxe_send_wqe *wqe;enum rxe_hdr_mask mask; -int payload; +u32 payload;int mtu;int opcode;int ret;
Signature · 1 line
2.27.0
PATCH v2 2/2 RDMA/rxe: remove useless argument for update_state()
The argument 'payload' is not used in update_state(), so just remove it.
--- drivers/infiniband/sw/rxe/rxe_req.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/sw/rxe/rxe_req.c +2 -2
@@ -540,7 +540,7 @@ static void rollback_state(struct rxe_send_wqe *wqe, }static void update_state (struct rxe_qp *qp,struct rxe_send_wqe *wqe, -struct rxe_pkt_info *pkt,u32 payload) +struct rxe_pkt_info *pkt) { qp->req.opcode = pkt->opcode;
@@ -747,7 +747,7 @@ int rxe_requester(void *arg) goto err; } -update_state (qp, wqe, &pkt, payload); +update_state (qp, wqe, &pkt); goto next_wqe;
Signature · 1 line
2.27.0
Re: [PATCH v2 2/2] RDMA/rxe: remove useless argument for update_state()
Quoted 8 lines · Chengguang Xu
The argument 'payload' is not used in
update_state(), so just remove it.Signed-off-by Chengguang Xu <[email protected]>--- drivers/infiniband/sw/rxe/rxe_req.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Thanks,
Re: [PATCH v2 2/2] RDMA/rxe: remove useless argument for update_state()
In reply to Chengguang XuQuoted 5 lines · Chengguang Xu
The argument 'payload' is not used in
update_state(), so just remove it.Signed-off-by Chengguang Xu <[email protected]>
Zhu Yanjun
Quoted 30 lines
--- drivers/infiniband/sw/rxe/rxe_req.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/infiniband/sw/rxe/rxe_req.c +2
-3@@ -540,7 +540,7 @@ static void rollback_state(struct rxe_send_wqe *wqe, }static void update_state (struct rxe_qp *qp,struct rxe_send_wqe *wqe, -struct rxe_pkt_info *pkt,u32 payload) +struct rxe_pkt_info *pkt) { qp->req.opcode = pkt->opcode;@@ -747,7 +747,7 @@ int rxe_requester(void *arg) goto err; } -update_state (qp, wqe, &pkt, payload); +update_state (qp, wqe, &pkt); goto next_wqe; --2.27.0
Quoted 9 lines · Chengguang Xu
The type of wqe length is u32 so in order to avoid overflow and shadow casting change variable and relevant function argument to proper type.
Signed-off-by Chengguang Xu <[email protected]>--- drivers/infiniband/sw/rxe/rxe_req.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
Thanks,
Jason Gunthorpe
maintainerQuoted 9 lines · Chengguang Xu
The type of wqe length is u32 so in order to avoid overflow and shadow casting change variable and relevant function argument to proper type.
Signed-off-by Chengguang Xu <[email protected]>Reviewed-by Leon Romanovsky <[email protected]>--- drivers/infiniband/sw/rxe/rxe_req.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
Both patches applied to for-next, thanks
Jason