From: Marcin Szycik <marcin.szycik@linux.intel.com>
To: Aleksandr Loktionov <aleksandr.loktionov@intel.com>,
intel-wired-lan@lists.osuosl.org, anthony.l.nguyen@intel.com
Cc: netdev@vger.kernel.org, Marcin Szycik <marcin.szycik@intel.com>,
Martyna Szapar-Mudlaw <martyna.szapar-mudlaw@intel.com>
Subject: Re: [Intel-wired-lan] [PATCH iwl-next] ice: use ice_fill_eth_hdr() in ice_fill_sw_rule()
Date: Fri, 20 Mar 2026 14:18:59 +0100 [thread overview]
Message-ID: <ccac99ca-4a9e-4997-adf4-2eee389d60cc@linux.intel.com> (raw)
In-Reply-To: <20260320050556.422762-1-aleksandr.loktionov@intel.com>
On 20.03.2026 06:05, Aleksandr Loktionov wrote:
> From: Marcin Szycik <marcin.szycik@intel.com>
ACK
> Use the already existing helper function to fill Ethernet header. Also
> replace sizeof with a (also existing) macro to reduce the number of
> variables.
>
> Suggested-by: Martyna Szapar-Mudlaw <martyna.szapar-mudlaw@intel.com>
> Signed-off-by: Marcin Szycik <marcin.szycik@intel.com>
> Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> ---
> drivers/net/ethernet/intel/ice/ice_switch.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c
> index bb0f990..6496534 100644
> --- a/drivers/net/ethernet/intel/ice/ice_switch.c
> +++ b/drivers/net/ethernet/intel/ice/ice_switch.c
> @@ -2612,7 +2612,6 @@ ice_fill_sw_rule(struct ice_hw *hw, struct ice_fltr_info *f_info,
> u16 vlan_id = ICE_MAX_VLAN_ID + 1;
> u16 vlan_tpid = ETH_P_8021Q;
> void *daddr = NULL;
> - u16 eth_hdr_sz;
> u8 *eth_hdr;
> u32 act = 0;
> __be16 *off;
> @@ -2625,11 +2624,10 @@ ice_fill_sw_rule(struct ice_hw *hw, struct ice_fltr_info *f_info,
> return;
> }
>
> - eth_hdr_sz = sizeof(dummy_eth_header);
> eth_hdr = s_rule->hdr_data;
>
> /* initialize the ether header with a dummy header */
> - memcpy(eth_hdr, dummy_eth_header, eth_hdr_sz);
> + ice_fill_eth_hdr(eth_hdr);
> ice_fill_sw_info(hw, f_info);
>
> switch (f_info->fltr_act) {
> @@ -2730,7 +2728,7 @@ ice_fill_sw_rule(struct ice_hw *hw, struct ice_fltr_info *f_info,
>
> /* Create the switch rule with the final dummy Ethernet header */
> if (opc != ice_aqc_opc_update_sw_rules)
> - s_rule->hdr_len = cpu_to_le16(eth_hdr_sz);
> + s_rule->hdr_len = cpu_to_le16(DUMMY_ETH_HDR_LEN);
> }
>
> /**
next prev parent reply other threads:[~2026-03-20 13:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-20 5:05 [PATCH iwl-next] ice: use ice_fill_eth_hdr() in ice_fill_sw_rule() Aleksandr Loktionov
2026-03-20 13:18 ` Marcin Szycik [this message]
2026-03-20 20:00 ` Simon Horman
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=ccac99ca-4a9e-4997-adf4-2eee389d60cc@linux.intel.com \
--to=marcin.szycik@linux.intel.com \
--cc=aleksandr.loktionov@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=marcin.szycik@intel.com \
--cc=martyna.szapar-mudlaw@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