From: Jakub Kicinski <kuba@kernel.org>
To: Tony Nguyen <anthony.l.nguyen@intel.com>
Cc: davem@davemloft.net, pabeni@redhat.com, edumazet@google.com,
netdev@vger.kernel.org, Jan Sokolowski <jan.sokolowski@intel.com>,
maciej.fijalkowski@intel.com, daniel@iogearbox.net,
Alexander Lobakin <aleksander.lobakin@intel.com>,
Michal Schmidt <mschmidt@redhat.com>,
Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com>
Subject: Re: [PATCH net] ice: Fix undersized tx_flags variable
Date: Tue, 9 May 2023 20:09:10 -0700 [thread overview]
Message-ID: <20230509200910.2a149f24@kernel.org> (raw)
In-Reply-To: <20230508174225.1707403-1-anthony.l.nguyen@intel.com>
On Mon, 8 May 2023 10:42:25 -0700 Tony Nguyen wrote:
> From: Jan Sokolowski <jan.sokolowski@intel.com>
>
> As not all ICE_TX_FLAGS_* fit in current 16-bit limited
> tx_flags field, some VLAN-related flags would not properly apply.
nit: this is a bit of a understatement. The vlan info is gone
completely, right? Maybe say something along the lines of:
"VLAN ID was stored on upper 16 bits of tx_flags, the commit under
Fixes reduced the size of tx_flags to 16 bits discarding vlan
information completely."
> Fix that by refactoring tx_flags variable into flags only and
> a separate variable that holds VLAN ID.
This sentence just describes what the patch does, it's not necessary.
> As there is some space left,
> type variable can fit between those two. Pahole reports no size
> change to ice_tx_buf struct.
You need to also describe user-visible misbehavior.
> diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.h b/drivers/net/ethernet/intel/ice/ice_txrx.h
> index fff0efe28373..76a34d435025 100644
> --- a/drivers/net/ethernet/intel/ice/ice_txrx.h
> +++ b/drivers/net/ethernet/intel/ice/ice_txrx.h
> @@ -127,10 +127,9 @@ static inline int ice_skb_pad(void)
> #define ICE_TX_FLAGS_IPV6 BIT(6)
> #define ICE_TX_FLAGS_TUNNEL BIT(7)
> #define ICE_TX_FLAGS_HW_OUTER_SINGLE_VLAN BIT(8)
> -#define ICE_TX_FLAGS_VLAN_M 0xffff0000
> -#define ICE_TX_FLAGS_VLAN_PR_M 0xe0000000
> -#define ICE_TX_FLAGS_VLAN_PR_S 29
> -#define ICE_TX_FLAGS_VLAN_S 16
> +
> +#define ICE_TX_VLAN_PR_M 0xe000
> +#define ICE_TX_VLAN_PR_S 13
You can use VLAN_PRIO_MASK and VLAN_PRIO_SHIFT if you're storing
it in a normal-ish 16b field.
--
pw-bot: cr
prev parent reply other threads:[~2023-05-10 3:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-08 17:42 [PATCH net] ice: Fix undersized tx_flags variable Tony Nguyen
2023-05-08 19:08 ` Simon Horman
2023-05-10 3:09 ` Jakub Kicinski [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=20230509200910.2a149f24@kernel.org \
--to=kuba@kernel.org \
--cc=aleksander.lobakin@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=himasekharx.reddy.pucha@intel.com \
--cc=jan.sokolowski@intel.com \
--cc=maciej.fijalkowski@intel.com \
--cc=mschmidt@redhat.com \
--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 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).