All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-next] RDMA/rxe: Correct skb on loopback path
@ 2021-01-28 18:23 Bob Pearson
  2021-02-05 17:57 ` Jason Gunthorpe
  0 siblings, 1 reply; 2+ messages in thread
From: Bob Pearson @ 2021-01-28 18:23 UTC (permalink / raw)
  To: jgg, zyjzyj2000, linux-rdma; +Cc: 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.

Fixes: 8700e3e7c4857 ("Soft RoCE driver")
Signed-off-by: Bob Pearson <rpearson@hpe.com>
---
 drivers/infiniband/sw/rxe/rxe_net.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c
index c4b06ced30a7..0d4125b867b7 100644
--- a/drivers/infiniband/sw/rxe/rxe_net.c
+++ b/drivers/infiniband/sw/rxe/rxe_net.c
@@ -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);
 }
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH for-next] RDMA/rxe: Correct skb on loopback path
  2021-01-28 18:23 [PATCH for-next] RDMA/rxe: Correct skb on loopback path Bob Pearson
@ 2021-02-05 17:57 ` Jason Gunthorpe
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2021-02-05 17:57 UTC (permalink / raw)
  To: Bob Pearson; +Cc: zyjzyj2000, linux-rdma, Bob Pearson

On Thu, Jan 28, 2021 at 12:23:02PM -0600, Bob Pearson wrote:
> 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")
> Signed-off-by: Bob Pearson <rpearson@hpe.com>
> ---
>  drivers/infiniband/sw/rxe/rxe_net.c | 5 +++++
>  1 file changed, 5 insertions(+)

Applied to for-next, thanks

Jason

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-05 18:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-28 18:23 [PATCH for-next] RDMA/rxe: Correct skb on loopback path Bob Pearson
2021-02-05 17:57 ` Jason Gunthorpe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.