Skip to content

Commit

Permalink
RDMA/rxe: Correct skb on loopback path
Browse files Browse the repository at this point in the history
[ Upstream commit 5120bf0 ]

rxe_net.c sends packets at the IP layer with skb->data pointing at the IP
header but receives packets from a UDP tunnel with skb->data pointing at
the UDP header.  On the loopback path this was not correctly accounted
for.  This patch corrects for this by using sbk_pull() to strip the IP
header from the skb on received packets.

Fixes: 8700e3e ("Soft RoCE driver")
Link: https://lore.kernel.org/r/20210128182301.16859-1-rpearson@hpe.com
Signed-off-by: Bob Pearson <rpearson@hpe.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Bob Pearson authored and gregkh committed Mar 4, 2021
1 parent 54bdcd7 commit a46f34b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/infiniband/sw/rxe/rxe_net.c
Expand Up @@ -414,6 +414,11 @@ int rxe_send(struct rxe_pkt_info *pkt, struct sk_buff *skb)

void rxe_loopback(struct sk_buff *skb)
{
if (skb->protocol == htons(ETH_P_IP))
skb_pull(skb, sizeof(struct iphdr));
else
skb_pull(skb, sizeof(struct ipv6hdr));

rxe_rcv(skb);
}

Expand Down

0 comments on commit a46f34b

Please sign in to comment.