From: Simon Horman <horms@kernel.org>
To: Jacob Keller <jacob.e.keller@intel.com>
Cc: netdev <netdev@vger.kernel.org>, Jakub Kicinski <kuba@kernel.org>,
David Miller <davem@davemloft.net>,
Larysa Zaremba <larysa.zaremba@intel.com>,
Michal Swiatkowski <michal.swiatkowski@linux.intel.com>,
Chandan Kumar Rout <chandanx.rout@intel.com>,
Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com>,
Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Subject: Re: [PATCH net 1/2] ice: Interpret .set_channels() input differently
Date: Wed, 15 May 2024 11:53:53 +0100 [thread overview]
Message-ID: <20240515105353.GI154012@kernel.org> (raw)
In-Reply-To: <20240514-iwl-net-2024-05-14-set-channels-fixes-v1-1-eb18d88e30c3@intel.com>
On Tue, May 14, 2024 at 11:51:12AM -0700, Jacob Keller wrote:
> From: Larysa Zaremba <larysa.zaremba@intel.com>
>
> A bug occurs because a safety check guarding AF_XDP-related queues in
> ethnl_set_channels(), does not trigger. This happens, because kernel and
> ice driver interpret the ethtool command differently.
>
> How the bug occurs:
> 1. ethtool -l <IFNAME> -> combined: 40
> 2. Attach AF_XDP to queue 30
> 3. ethtool -L <IFNAME> rx 15 tx 15
> combined number is not specified, so command becomes {rx_count = 15,
> tx_count = 15, combined_count = 40}.
> 4. ethnl_set_channels checks, if there are any AF_XDP of queues from the
> new (combined_count + rx_count) to the old one, so from 55 to 40, check
> does not trigger.
> 5. ice interprets `rx 15 tx 15` as 15 combined channels and deletes the
> queue that AF_XDP is attached to.
>
> Interpret the command in a way that is more consistent with ethtool
> manual [0] (--show-channels and --set-channels).
>
> Considering that in the ice driver only the difference between RX and TX
> queues forms dedicated channels, change the correct way to set number of
> channels to:
>
> ethtool -L <IFNAME> combined 10 /* For symmetric queues */
> ethtool -L <IFNAME> combined 8 tx 2 rx 0 /* For asymmetric queues */
>
> [0] https://man7.org/linux/man-pages/man8/ethtool.8.html
>
> Fixes: 87324e747fde ("ice: Implement ethtool ops for channels")
> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
> Tested-by: Chandan Kumar Rout <chandanx.rout@intel.com>
> Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com>
> Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
next prev parent reply other threads:[~2024-05-15 10:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-14 18:51 [PATCH net 0/2] intel: Interpret .set_channels() input differently Jacob Keller
2024-05-14 18:51 ` [PATCH net 1/2] ice: " Jacob Keller
2024-05-15 10:53 ` Simon Horman [this message]
2024-05-14 18:51 ` [PATCH net 2/2] idpf: " Jacob Keller
2024-05-16 8:44 ` [PATCH net 0/2] intel: " Larysa Zaremba
2024-05-16 17:21 ` Jacob Keller
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=20240515105353.GI154012@kernel.org \
--to=horms@kernel.org \
--cc=chandanx.rout@intel.com \
--cc=davem@davemloft.net \
--cc=himasekharx.reddy.pucha@intel.com \
--cc=jacob.e.keller@intel.com \
--cc=kuba@kernel.org \
--cc=larysa.zaremba@intel.com \
--cc=maciej.fijalkowski@intel.com \
--cc=michal.swiatkowski@linux.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;
as well as URLs for NNTP newsgroup(s).