[PATCH net v2] bonding: Fix extraction of ports from the packet headers

Subsystems: bonding driver, networking drivers, the rest

STALE1661d REVIEWED: 6 (4M)

3 review trailers.

3 messages, 3 authors, 2022-01-16 · open the first message on its own page

[PATCH net v2] bonding: Fix extraction of ports from the packet headers

From: Moshe Tal <hidden>
Date: 2022-01-16 17:40:08

Wrong hash sends single stream to multiple output interfaces.

The offset calculation was relative to skb->head, fix it to be relative
to skb->data.

Fixes: a815bde56b15 ("net, bonding: Refactor bond_xmit_hash for use with
xdp_buff")
Reviewed-by: Jussi Maki <redacted>
Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
Reviewed-by: Gal Pressman <redacted>
Signed-off-by: Moshe Tal <redacted>
---

Notes:
    v2: Change the offset to be relative to skb->data in higher level to
    handle the case when skb is NULL.

 drivers/net/bonding/bond_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index fce80b57f15b..ec498ce70f35 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3874,8 +3874,8 @@ u32 bond_xmit_hash(struct bonding *bond, struct sk_buff *skb)
 	    skb->l4_hash)
 		return skb->hash;
 
-	return __bond_xmit_hash(bond, skb, skb->head, skb->protocol,
-				skb->mac_header, skb->network_header,
+	return __bond_xmit_hash(bond, skb, skb->data, skb->protocol,
+				skb_mac_offset(skb), skb_network_offset(skb),
 				skb_headlen(skb));
 }
 
-- 
2.26.2

Re: [PATCH net v2] bonding: Fix extraction of ports from the packet headers

From: Jay Vosburgh <hidden>
Date: 2022-01-16 20:23:44

Moshe Tal [off-list ref] wrote:
Wrong hash sends single stream to multiple output interfaces.

The offset calculation was relative to skb->head, fix it to be relative
to skb->data.

Fixes: a815bde56b15 ("net, bonding: Refactor bond_xmit_hash for use with
xdp_buff")
Reviewed-by: Jussi Maki <redacted>
Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
Reviewed-by: Gal Pressman <redacted>
Signed-off-by: Moshe Tal <redacted>
Acked-by: Jay Vosburgh <redacted>
quoted hunk
---

Notes:
   v2: Change the offset to be relative to skb->data in higher level to
   handle the case when skb is NULL.

drivers/net/bonding/bond_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index fce80b57f15b..ec498ce70f35 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3874,8 +3874,8 @@ u32 bond_xmit_hash(struct bonding *bond, struct sk_buff *skb)
	    skb->l4_hash)
		return skb->hash;

-	return __bond_xmit_hash(bond, skb, skb->head, skb->protocol,
-				skb->mac_header, skb->network_header,
+	return __bond_xmit_hash(bond, skb, skb->data, skb->protocol,
+				skb_mac_offset(skb), skb_network_offset(skb),
				skb_headlen(skb));
}

-- 
2.26.2

Re: [PATCH net v2] bonding: Fix extraction of ports from the packet headers

From: patchwork-bot+netdevbpf@kernel.org
Date: 2022-01-16 23:40:12

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller [off-list ref]:

On Sun, 16 Jan 2022 19:39:29 +0200 you wrote:
Wrong hash sends single stream to multiple output interfaces.

The offset calculation was relative to skb->head, fix it to be relative
to skb->data.

Fixes: a815bde56b15 ("net, bonding: Refactor bond_xmit_hash for use with
xdp_buff")
Reviewed-by: Jussi Maki <redacted>
Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
Reviewed-by: Gal Pressman <redacted>
Signed-off-by: Moshe Tal <redacted>

[...]
Here is the summary with links:
  - [net,v2] bonding: Fix extraction of ports from the packet headers
    https://git.kernel.org/netdev/net/c/429e3d123d9a

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help