mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 22:26:55 +00:00
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: 899aba891c
("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>
This commit is contained in:
parent
cca7f12b93
commit
21e27ac82d
1 changed files with 9 additions and 1 deletions
|
@ -407,14 +407,22 @@ int rxe_send(struct rxe_pkt_info *pkt, struct sk_buff *skb)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* fix up a send packet to match the packets
|
||||||
|
* received from UDP before looping them back
|
||||||
|
*/
|
||||||
void rxe_loopback(struct sk_buff *skb)
|
void rxe_loopback(struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
|
struct rxe_pkt_info *pkt = SKB_TO_PKT(skb);
|
||||||
|
|
||||||
if (skb->protocol == htons(ETH_P_IP))
|
if (skb->protocol == htons(ETH_P_IP))
|
||||||
skb_pull(skb, sizeof(struct iphdr));
|
skb_pull(skb, sizeof(struct iphdr));
|
||||||
else
|
else
|
||||||
skb_pull(skb, sizeof(struct ipv6hdr));
|
skb_pull(skb, sizeof(struct ipv6hdr));
|
||||||
|
|
||||||
rxe_rcv(skb);
|
if (WARN_ON(!ib_device_try_get(&pkt->rxe->ib_dev)))
|
||||||
|
kfree_skb(skb);
|
||||||
|
else
|
||||||
|
rxe_rcv(skb);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct sk_buff *rxe_init_packet(struct rxe_dev *rxe, struct rxe_av *av,
|
struct sk_buff *rxe_init_packet(struct rxe_dev *rxe, struct rxe_av *av,
|
||||||
|
|
Loading…
Reference in a new issue