linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH rdma-next] RDMA/rxe: Skip dgid check in loopback mode
@ 2020-06-30 12:36 Leon Romanovsky
  2020-07-07 16:31 ` Jason Gunthorpe
  0 siblings, 1 reply; 2+ messages in thread
From: Leon Romanovsky @ 2020-06-30 12:36 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe; +Cc: Zhu Yanjun, linux-rdma

From: Zhu Yanjun <yanjunz@mellanox.com>

In the loopback tests, the following call trace occurs.

Call Trace:
 __rxe_do_task+0x1a/0x30 [rdma_rxe]
 rxe_qp_destroy+0x61/0xa0 [rdma_rxe]
 rxe_destroy_qp+0x20/0x60 [rdma_rxe]
 ib_destroy_qp_user+0xcc/0x220 [ib_core]
 uverbs_free_qp+0x3c/0xc0 [ib_uverbs]
 destroy_hw_idr_uobject+0x24/0x70 [ib_uverbs]
 uverbs_destroy_uobject+0x43/0x1b0 [ib_uverbs]
 uobj_destroy+0x41/0x70 [ib_uverbs]
 __uobj_get_destroy+0x39/0x70 [ib_uverbs]
 ib_uverbs_destroy_qp+0x88/0xc0 [ib_uverbs]
 ib_uverbs_handler_UVERBS_METHOD_INVOKE_WRITE+0xb9/0xf0 [ib_uverbs]
 ib_uverbs_cmd_verbs+0xb16/0xc30 [ib_uverbs]

The root cause is that the actual RDMA connection is not created in the
loopback tests and the rxe_match_dgid will fail randomly.

To fix this call trace which appear in the loopback tests, skip check
of the dgid.

Fixes: 8700e3e7c485 ("Soft RoCE driver")
Signed-off-by: Zhu Yanjun <yanjunz@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/infiniband/sw/rxe/rxe_recv.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_recv.c b/drivers/infiniband/sw/rxe/rxe_recv.c
index 831ad578a7b2..46e111c218fd 100644
--- a/drivers/infiniband/sw/rxe/rxe_recv.c
+++ b/drivers/infiniband/sw/rxe/rxe_recv.c
@@ -330,10 +330,14 @@ static void rxe_rcv_mcast_pkt(struct rxe_dev *rxe, struct sk_buff *skb)

 static int rxe_match_dgid(struct rxe_dev *rxe, struct sk_buff *skb)
 {
+	struct rxe_pkt_info *pkt = SKB_TO_PKT(skb);
 	const struct ib_gid_attr *gid_attr;
 	union ib_gid dgid;
 	union ib_gid *pdgid;

+	if (pkt->mask & RXE_LOOPBACK_MASK)
+		return 0;
+
 	if (skb->protocol == htons(ETH_P_IP)) {
 		ipv6_addr_set_v4mapped(ip_hdr(skb)->daddr,
 				       (struct in6_addr *)&dgid);
@@ -366,7 +370,7 @@ void rxe_rcv(struct sk_buff *skb)
 	if (unlikely(skb->len < pkt->offset + RXE_BTH_BYTES))
 		goto drop;

-	if (unlikely(rxe_match_dgid(rxe, skb) < 0)) {
+	if (rxe_match_dgid(rxe, skb) < 0) {
 		pr_warn_ratelimited("failed matching dgid\n");
 		goto drop;
 	}
--
2.26.2


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

* Re: [PATCH rdma-next] RDMA/rxe: Skip dgid check in loopback mode
  2020-06-30 12:36 [PATCH rdma-next] RDMA/rxe: Skip dgid check in loopback mode Leon Romanovsky
@ 2020-07-07 16:31 ` Jason Gunthorpe
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2020-07-07 16:31 UTC (permalink / raw)
  To: Leon Romanovsky; +Cc: Doug Ledford, Zhu Yanjun, linux-rdma

On Tue, Jun 30, 2020 at 03:36:05PM +0300, Leon Romanovsky wrote:
> From: Zhu Yanjun <yanjunz@mellanox.com>
> 
> In the loopback tests, the following call trace occurs.
> 
> Call Trace:
>  __rxe_do_task+0x1a/0x30 [rdma_rxe]
>  rxe_qp_destroy+0x61/0xa0 [rdma_rxe]
>  rxe_destroy_qp+0x20/0x60 [rdma_rxe]
>  ib_destroy_qp_user+0xcc/0x220 [ib_core]
>  uverbs_free_qp+0x3c/0xc0 [ib_uverbs]
>  destroy_hw_idr_uobject+0x24/0x70 [ib_uverbs]
>  uverbs_destroy_uobject+0x43/0x1b0 [ib_uverbs]
>  uobj_destroy+0x41/0x70 [ib_uverbs]
>  __uobj_get_destroy+0x39/0x70 [ib_uverbs]
>  ib_uverbs_destroy_qp+0x88/0xc0 [ib_uverbs]
>  ib_uverbs_handler_UVERBS_METHOD_INVOKE_WRITE+0xb9/0xf0 [ib_uverbs]
>  ib_uverbs_cmd_verbs+0xb16/0xc30 [ib_uverbs]
> 
> The root cause is that the actual RDMA connection is not created in the
> loopback tests and the rxe_match_dgid will fail randomly.
> 
> To fix this call trace which appear in the loopback tests, skip check
> of the dgid.
> 
> Fixes: 8700e3e7c485 ("Soft RoCE driver")
> Signed-off-by: Zhu Yanjun <yanjunz@mellanox.com>
> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> ---
>  drivers/infiniband/sw/rxe/rxe_recv.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)

Applied to for-next, thanks

Jason

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

end of thread, other threads:[~2020-07-07 16:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-30 12:36 [PATCH rdma-next] RDMA/rxe: Skip dgid check in loopback mode Leon Romanovsky
2020-07-07 16:31 ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).