From: Moshe Tal <moshet@nvidia.com>
To: Jay Vosburgh <j.vosburgh@gmail.com>,
Veaceslav Falico <vfalico@gmail.com>,
Andy Gospodarek <andy@greyhouse.net>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>
Cc: <netdev@vger.kernel.org>, Jussi Maki <joamaki@gmail.com>,
Daniel Borkmann <daniel@iogearbox.net>,
Tariq Toukan <tariqt@nvidia.com>, Moshe Tal <moshet@nvidia.com>,
Saeed Mahameed <saeedm@nvidia.com>, Gal Pressman <gal@nvidia.com>
Subject: [PATCH net v2] bonding: Fix extraction of ports from the packet headers
Date: Sun, 16 Jan 2022 19:39:29 +0200 [thread overview]
Message-ID: <20220116173929.6590-1-moshet@nvidia.com> (raw)
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 <joamaki@gmail.com>
Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
Reviewed-by: Gal Pressman <gal@nvidia.com>
Signed-off-by: Moshe Tal <moshet@nvidia.com>
---
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
next reply other threads:[~2022-01-16 17:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-16 17:39 Moshe Tal [this message]
2022-01-16 20:23 ` [PATCH net v2] bonding: Fix extraction of ports from the packet headers Jay Vosburgh
2022-01-16 23:40 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220116173929.6590-1-moshet@nvidia.com \
--to=moshet@nvidia.com \
--cc=andy@greyhouse.net \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=gal@nvidia.com \
--cc=j.vosburgh@gmail.com \
--cc=joamaki@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=saeedm@nvidia.com \
--cc=tariqt@nvidia.com \
--cc=vfalico@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).