From: Eric Dumazet <edumazet@google.com>
To: "David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>
Cc: Simon Horman <horms@kernel.org>,
Andrew Lunn <andrew+netdev@lunn.ch>,
netdev@vger.kernel.org, eric.dumazet@gmail.com,
Eric Dumazet <edumazet@google.com>
Subject: [PATCH net-next 01/10] bonding: do not assume mac header is set in ALB/TLB tx paths
Date: Wed, 2 Sep 2026 00:33:35 +0000 [thread overview]
Message-ID: <20260902003344.1931843-2-edumazet@google.com> (raw)
In-Reply-To: <20260902003344.1931843-1-edumazet@google.com>
We should not assume mac header is set in output path.
Use skb_eth_hdr() instead of eth_hdr() to fix the issue,
and remove now redundant skb_reset_mac_header() calls.
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
drivers/net/bonding/bond_alb.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index 839f7482dc1823b12a13437a4b6639e3b63d46ec..3d2c6a9fe3b7bfdd46299aeff14689d323c525d3 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -1339,7 +1339,7 @@ static netdev_tx_t bond_do_alb_xmit(struct sk_buff *skb, struct bonding *bond,
struct slave *tx_slave)
{
struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
- struct ethhdr *eth_data = eth_hdr(skb);
+ struct ethhdr *eth_data = skb_eth_hdr(skb);
if (!tx_slave) {
/* unbalanced or unassigned, send through primary */
@@ -1374,8 +1374,7 @@ struct slave *bond_xmit_tlb_slave_get(struct bonding *bond,
struct ethhdr *eth_data;
u32 hash_index;
- skb_reset_mac_header(skb);
- eth_data = eth_hdr(skb);
+ eth_data = skb_eth_hdr(skb);
/* Do not TX balance any multicast or broadcast */
if (!is_multicast_ether_addr(eth_data->h_dest)) {
@@ -1427,8 +1426,7 @@ struct slave *bond_xmit_alb_slave_get(struct bonding *bond,
u32 hash_index = 0;
int hash_size = 0;
- skb_reset_mac_header(skb);
- eth_data = eth_hdr(skb);
+ eth_data = skb_eth_hdr(skb);
switch (ntohs(skb->protocol)) {
case ETH_P_IP: {
--
2.55.0.966.g6673acef38-goog
next prev parent reply other threads:[~2026-09-02 0:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 0:33 [PATCH net-next 00/10] net: remove skb mac_header assumptions in TX paths (I) Eric Dumazet
2026-09-02 0:33 ` Eric Dumazet [this message]
2026-09-02 0:33 ` [PATCH net-next 02/10] atlantic: do not assume mac header is set in aq_ndev_start_xmit() Eric Dumazet
2026-09-02 0:33 ` [PATCH net-next 03/10] ibmveth: do not assume mac header is set in ibmveth_start_xmit() Eric Dumazet
2026-09-07 5:20 ` mingming cao
2026-09-07 6:41 ` Eric Dumazet
2026-09-02 0:33 ` [PATCH net-next 04/10] net: mediatek: do not assume mac header is set in mtk_start_xmit() Eric Dumazet
2026-09-02 0:33 ` [PATCH net-next 05/10] netvsc: do not assume mac header is set in netvsc_start_xmit() Eric Dumazet
2026-09-02 0:33 ` [PATCH net-next 06/10] macsec: do not assume mac header is set in macsec_encrypt_finish() Eric Dumazet
2026-09-02 0:33 ` [PATCH net-next 07/10] macvlan: do not assume mac header is set in macvlan_broadcast() Eric Dumazet
2026-09-02 0:33 ` [PATCH net-next 08/10] vxlan: do not assume mac header is set in tx paths Eric Dumazet
2026-09-02 0:33 ` [PATCH net-next 09/10] cdc_mbim: do not assume mac header is set in cdc_mbim_tx_fixup() Eric Dumazet
2026-09-02 0:33 ` [PATCH net-next 10/10] ice: do not assume mac header is set in tx paths Eric Dumazet
2026-09-02 11:22 ` [PATCH net-next 00/10] net: remove skb mac_header assumptions in TX paths (I) Eric Dumazet
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=20260902003344.1931843-2-edumazet@google.com \
--to=edumazet@google.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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 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.