Skip to contentSkip to conversation

RDMA/rxe: Correct skb on loopback path

PATCH Applied Bob Pearson 2 participants 2 messages Jan 28, 2021 – Feb 5, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/rxe: Correct skb on loopback path

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 8700e3e7c4857 ("Soft RoCE driver")
---
 drivers/infiniband/sw/rxe/rxe_net.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/infiniband/sw/rxe/rxe_net.c +5 -0
index c4b06ced30a7..0d4125b867b7 100644
@@ -408,6 +408,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);
 }
 
Signature · 1 line
2.27.0
maintainer Applied
#1 lore raw
Quoted 7 lines · Bob Pearson

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.

Quoted 5 lines
Fixes 8700e3e7c4857 ("Soft RoCE driver")
---
 drivers/infiniband/sw/rxe/rxe_net.c | 5 +++++
 1 file changed, 5 insertions(+)

Applied to for-next, thanks

Jason