Skip to content

Commit 21e27ac

Browse files
Bob Pearsonjgunthorpe
authored andcommitted
RDMA/rxe: Fix missed IB reference counting in loopback
When the noted patch below extending the reference taken by rxe_get_dev_from_net() in rxe_udp_encap_recv() until each skb is freed it was not matched by a reference in the loopback path resulting in underflows. Fixes: 899aba8 ("RDMA/rxe: Fix FIXME in rxe_udp_encap_recv()") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bob Pearson <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent cca7f12 commit 21e27ac

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/infiniband/sw/rxe/rxe_net.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,14 +407,22 @@ int rxe_send(struct rxe_pkt_info *pkt, struct sk_buff *skb)
407407
return 0;
408408
}
409409

410+
/* fix up a send packet to match the packets
411+
* received from UDP before looping them back
412+
*/
410413
void rxe_loopback(struct sk_buff *skb)
411414
{
415+
struct rxe_pkt_info *pkt = SKB_TO_PKT(skb);
416+
412417
if (skb->protocol == htons(ETH_P_IP))
413418
skb_pull(skb, sizeof(struct iphdr));
414419
else
415420
skb_pull(skb, sizeof(struct ipv6hdr));
416421

417-
rxe_rcv(skb);
422+
if (WARN_ON(!ib_device_try_get(&pkt->rxe->ib_dev)))
423+
kfree_skb(skb);
424+
else
425+
rxe_rcv(skb);
418426
}
419427

420428
struct sk_buff *rxe_init_packet(struct rxe_dev *rxe, struct rxe_av *av,

0 commit comments

Comments
 (0)