From: Larysa Zaremba <larysa.zaremba@intel.com>
To: Jacob Keller <jacob.e.keller@intel.com>, netdev <netdev@vger.kernel.org>
Cc: netdev <netdev@vger.kernel.org>, Jakub Kicinski <kuba@kernel.org>,
"David Miller" <davem@davemloft.net>,
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>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Igor Bagnucki <igor.bagnucki@intel.com>,
Krishneil Singh <krishneil.k.singh@intel.com>,
Simon Horman <horms@kernel.org>
Subject: Re: [PATCH net 0/2] intel: Interpret .set_channels() input differently
Date: Thu, 16 May 2024 10:44:39 +0200 [thread overview]
Message-ID: <ZkXHdy6bKGUhIJfO@lzaremba-mobl.ger.corp.intel.com> (raw)
In-Reply-To: <20240514-iwl-net-2024-05-14-set-channels-fixes-v1-0-eb18d88e30c3@intel.com>
On Tue, May 14, 2024 at 11:51:11AM -0700, Jacob Keller wrote:
> The ice and idpf drivers can trigger a crash with AF_XDP due to incorrect
> interpretation of the asymmetric Tx and Rx parameters in their
> .set_channels() implementations:
>
> 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. the driver interprets `rx 15 tx 15` as 15 combined channels and deletes
> the queue that AF_XDP is attached to.
>
> This is fundamentally a problem with interpreting a request for asymmetric
> queues as symmetric combined queues.
>
> Fix the ice and idpf drivers to stop interpreting such requests as a
> request for combined queues. Due to current driver design for both ice and
> idpf, it is not possible to support requests of the same count of Tx and Rx
> queues with independent interrupts, (i.e. ethtool -L <IFNAME> rx 15 tx 15)
> so such requests are now rejected.
>
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> ---
Please, do not merge, first patch contains a redundant check
if (!ch->combined_count)
I will send another version.
> Larysa Zaremba (2):
> ice: Interpret .set_channels() input differently
> idpf: Interpret .set_channels() input differently
>
> drivers/net/ethernet/intel/ice/ice_ethtool.c | 22 ++++++----------------
> drivers/net/ethernet/intel/idpf/idpf_ethtool.c | 21 ++++++---------------
> 2 files changed, 12 insertions(+), 31 deletions(-)
> ---
> base-commit: aea27a92a41dae14843f92c79e9e42d8f570105c
> change-id: 20240514-iwl-net-2024-05-14-set-channels-fixes-25be6f04a86d
>
> Best regards,
> --
> Jacob Keller <jacob.e.keller@intel.com>
>
next prev parent reply other threads:[~2024-05-16 8:44 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
2024-05-14 18:51 ` [PATCH net 2/2] idpf: " Jacob Keller
2024-05-16 8:44 ` Larysa Zaremba [this message]
2024-05-16 17:21 ` [PATCH net 0/2] intel: " 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=ZkXHdy6bKGUhIJfO@lzaremba-mobl.ger.corp.intel.com \
--to=larysa.zaremba@intel.com \
--cc=chandanx.rout@intel.com \
--cc=davem@davemloft.net \
--cc=himasekharx.reddy.pucha@intel.com \
--cc=horms@kernel.org \
--cc=igor.bagnucki@intel.com \
--cc=jacob.e.keller@intel.com \
--cc=krishneil.k.singh@intel.com \
--cc=kuba@kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=michal.swiatkowski@linux.intel.com \
--cc=netdev@vger.kernel.org \
--cc=przemyslaw.kitszel@intel.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 read-only IMAP folder(s) and NNTP newsgroup(s).