Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 899aba891cab ("RDMA/rxe: Fix FIXME in rxe_udp_encap_recv()")
Link: https://lore.kernel.org/r/20210304192048.2958-1-rpearson@hpe.com
Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>

authored by

Bob Pearson and committed by
Jason Gunthorpe
21e27ac8 cca7f12b

+9 -1
+9 -1
drivers/infiniband/sw/rxe/rxe_net.c
··· 407 return 0; 408 } 409 410 void rxe_loopback(struct sk_buff *skb) 411 { 412 if (skb->protocol == htons(ETH_P_IP)) 413 skb_pull(skb, sizeof(struct iphdr)); 414 else 415 skb_pull(skb, sizeof(struct ipv6hdr)); 416 417 - rxe_rcv(skb); 418 } 419 420 struct sk_buff *rxe_init_packet(struct rxe_dev *rxe, struct rxe_av *av,
··· 407 return 0; 408 } 409 410 + /* fix up a send packet to match the packets 411 + * received from UDP before looping them back 412 + */ 413 void rxe_loopback(struct sk_buff *skb) 414 { 415 + struct rxe_pkt_info *pkt = SKB_TO_PKT(skb); 416 + 417 if (skb->protocol == htons(ETH_P_IP)) 418 skb_pull(skb, sizeof(struct iphdr)); 419 else 420 skb_pull(skb, sizeof(struct ipv6hdr)); 421 422 + if (WARN_ON(!ib_device_try_get(&pkt->rxe->ib_dev))) 423 + kfree_skb(skb); 424 + else 425 + rxe_rcv(skb); 426 } 427 428 struct sk_buff *rxe_init_packet(struct rxe_dev *rxe, struct rxe_av *av,