All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-next] RDMA/rxe: Remove useless code in rxe_recv.c
@ 2021-01-27 22:42 Bob Pearson
  2021-02-05 17:57 ` Jason Gunthorpe
  0 siblings, 1 reply; 2+ messages in thread
From: Bob Pearson @ 2021-01-27 22:42 UTC (permalink / raw)
  To: jgg, zyjzyj2000, linux-rdma; +Cc: Bob Pearson

In check_keys() in rxe_recv.c

	if ((...) && pkt->mask) {
		...
	}

always has pkt->mask non zero since in rxe_udp_encap_recv()
pkt->mask is always set to RXE_GRH_MASK (!= 0).  There is no obvious
reason for this additional test and the original intent is
lost. This patch simplifies the expression.

Fixes: 8b7b59d030cc0 ("IB/rxe: remove redudant qpn check")
Signed-off-by: Bob Pearson <rpearson@hpe.com>
---
 drivers/infiniband/sw/rxe/rxe_recv.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_recv.c b/drivers/infiniband/sw/rxe/rxe_recv.c
index c9984a28eecc..83a5c4f6654e 100644
--- a/drivers/infiniband/sw/rxe/rxe_recv.c
+++ b/drivers/infiniband/sw/rxe/rxe_recv.c
@@ -85,8 +85,7 @@ static int check_keys(struct rxe_dev *rxe, struct rxe_pkt_info *pkt,
 		goto err1;
 	}
 
-	if ((qp_type(qp) == IB_QPT_UD || qp_type(qp) == IB_QPT_GSI) &&
-	    pkt->mask) {
+	if (qp_type(qp) == IB_QPT_UD || qp_type(qp) == IB_QPT_GSI) {
 		u32 qkey = (qpn == 1) ? GSI_QKEY : qp->attr.qkey;
 
 		if (unlikely(deth_qkey(pkt) != qkey)) {
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH for-next] RDMA/rxe: Remove useless code in rxe_recv.c
  2021-01-27 22:42 [PATCH for-next] RDMA/rxe: Remove useless code in rxe_recv.c Bob Pearson
@ 2021-02-05 17:57 ` Jason Gunthorpe
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2021-02-05 17:57 UTC (permalink / raw)
  To: Bob Pearson; +Cc: zyjzyj2000, linux-rdma, Bob Pearson

On Wed, Jan 27, 2021 at 04:42:04PM -0600, Bob Pearson wrote:
> In check_keys() in rxe_recv.c
> 
> 	if ((...) && pkt->mask) {
> 		...
> 	}
> 
> always has pkt->mask non zero since in rxe_udp_encap_recv()
> pkt->mask is always set to RXE_GRH_MASK (!= 0).  There is no obvious
> reason for this additional test and the original intent is
> lost. This patch simplifies the expression.
> 
> Fixes: 8b7b59d030cc0 ("IB/rxe: remove redudant qpn check")
> Signed-off-by: Bob Pearson <rpearson@hpe.com>
> ---
>  drivers/infiniband/sw/rxe/rxe_recv.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Applied to for-next, thanks

Jason

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-05 18:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-27 22:42 [PATCH for-next] RDMA/rxe: Remove useless code in rxe_recv.c Bob Pearson
2021-02-05 17:57 ` Jason Gunthorpe

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.