public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander Lobakin <aleksander.lobakin@intel.com>
To: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Cc: <intel-wired-lan@lists.osuosl.org>, <anthony.l.nguyen@intel.com>,
	<netdev@vger.kernel.org>,
	Katarzyna Wieczerzycka <katarzyna.wieczerzycka@intel.com>
Subject: Re: [Intel-wired-lan] [PATCH] ice: add missing reset of the mac header
Date: Tue, 24 Mar 2026 19:02:35 +0100	[thread overview]
Message-ID: <b616efc3-267f-461c-b5c4-b74e9647f3eb@intel.com> (raw)
In-Reply-To: <20260320050518.422303-1-aleksandr.loktionov@intel.com>

From: Loktionov, Aleksandr <aleksandr.loktionov@intel.com>
Date: Fri, 20 Mar 2026 06:05:18 +0100

> From: Katarzyna Wieczerzycka <katarzyna.wieczerzycka@intel.com>
> 
> By default skb->mac_header is not set, so reset prevents access to an
> invalid pointer.
> 
> Call skb_reset_mac_header() before accessing the mac header from skb.
> 
> Signed-off-by: Katarzyna Wieczerzycka <katarzyna.wieczerzycka@intel.com>
> Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_txrx.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c
> index a2cd4cf..374b17f 100644
> --- a/drivers/net/ethernet/intel/ice/ice_txrx.c
> +++ b/drivers/net/ethernet/intel/ice/ice_txrx.c
> @@ -2211,6 +2211,8 @@ ice_xmit_frame_ring(struct sk_buff *skb, struct ice_tx_ring *tx_ring)
>  		goto out_drop;
>  
>  	/* allow CONTROL frames egress from main VSI if FW LLDP disabled */
> +	if (likely(!skb_mac_header_was_set(skb)))
> +		skb_reset_mac_header(skb);
>  	eth = (struct ethhdr *)skb_mac_header(skb);
>  
>  	if ((ice_is_switchdev_running(vsi->back) ||

Did you read my internal review? I've never faced a situation when the
kernel queues an skb to .ndo_start_xmit() without the header pointers
set up correctly.

I need a good repro to agree this is needed. `likely()` also doesn't fit
here (you basically slow down almost 100% of the traffic).

Thanks,
Olek

      parent reply	other threads:[~2026-03-24 18:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-20  5:05 [PATCH] ice: add missing reset of the mac header Aleksandr Loktionov
2026-03-20 18:04 ` Simon Horman
2026-03-20 19:53   ` Loktionov, Aleksandr
2026-03-21  9:14     ` Simon Horman
2026-03-26 14:14   ` Loktionov, Aleksandr
2026-03-24 18:02 ` Alexander Lobakin [this message]

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=b616efc3-267f-461c-b5c4-b74e9647f3eb@intel.com \
    --to=aleksander.lobakin@intel.com \
    --cc=aleksandr.loktionov@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=katarzyna.wieczerzycka@intel.com \
    --cc=netdev@vger.kernel.org \
    /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