From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
To: "Loktionov, Aleksandr" <aleksandr.loktionov@intel.com>,
"intel-wired-lan@lists.osuosl.org"
<intel-wired-lan@lists.osuosl.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Simon Horman <horms@kernel.org>,
"Nguyen, Anthony L" <anthony.l.nguyen@intel.com>,
"Michal Swiatkowski" <michal.swiatkowski@linux.intel.com>,
"Richardson, Bruce" <bruce.richardson@intel.com>,
"Medvedkin, Vladimir" <vladimir.medvedkin@intel.com>,
"Connolly, Padraig J" <padraig.j.connolly@intel.com>,
"S, Ananth" <ananth.s@intel.com>,
"Miskell, Timothy" <timothy.miskell@intel.com>,
"Keller, Jacob E" <jacob.e.keller@intel.com>,
"Czapnik, Lukasz" <lukasz.czapnik@intel.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
"Saeed Mahameed" <saeedm@nvidia.com>,
Leon Romanovsky <leon@kernel.org>,
Tariq Toukan <tariqt@nvidia.com>, Mark Bloch <mbloch@nvidia.com>,
"Schmidt, Michal" <mschmidt@redhat.com>,
Jakub Kicinski <kuba@kernel.org>, Jiri Pirko <jiri@resnulli.us>
Subject: Re: [PATCH iwl-next v1 14/15] ice: represent RSS LUTs as devlink resources
Date: Mon, 11 May 2026 11:41:20 +0200 [thread overview]
Message-ID: <774b6a00-03c8-4a03-bfce-354f3265bc19@intel.com> (raw)
In-Reply-To: <IA3PR11MB8986DED74CB42DE655B0E436E53D2@IA3PR11MB8986.namprd11.prod.outlook.com>
On 5/8/26 19:03, Loktionov, Aleksandr wrote:
>
>
>> -----Original Message-----
>> From: Kitszel, Przemyslaw <przemyslaw.kitszel@intel.com>
>> Sent: Friday, May 8, 2026 2:42 PM
>> To: intel-wired-lan@lists.osuosl.org; Schmidt, Michal
>> <mschmidt@redhat.com>; Jakub Kicinski <kuba@kernel.org>; Jiri Pirko
>> <jiri@resnulli.us>
>> Cc: netdev@vger.kernel.org; Simon Horman <horms@kernel.org>; Nguyen,
>> Anthony L <anthony.l.nguyen@intel.com>; Michal Swiatkowski
>> <michal.swiatkowski@linux.intel.com>; Richardson, Bruce
>> <bruce.richardson@intel.com>; Medvedkin, Vladimir
>> <vladimir.medvedkin@intel.com>; Connolly, Padraig J
>> <padraig.j.connolly@intel.com>; S, Ananth <ananth.s@intel.com>;
>> Miskell, Timothy <timothy.miskell@intel.com>; Keller, Jacob E
>> <jacob.e.keller@intel.com>; Czapnik, Lukasz
>> <lukasz.czapnik@intel.com>; Loktionov, Aleksandr
>> <aleksandr.loktionov@intel.com>; Andrew Lunn <andrew+netdev@lunn.ch>;
>> David S. Miller <davem@davemloft.net>; Eric Dumazet
>> <edumazet@google.com>; Paolo Abeni <pabeni@redhat.com>; Saeed Mahameed
>> <saeedm@nvidia.com>; Leon Romanovsky <leon@kernel.org>; Tariq Toukan
>> <tariqt@nvidia.com>; Mark Bloch <mbloch@nvidia.com>; Kitszel,
>> Przemyslaw <przemyslaw.kitszel@intel.com>
>> Subject: [PATCH iwl-next v1 14/15] ice: represent RSS LUTs as devlink
>> resources
>>
>> E800 family offers three kinds of RSS LUTs: VSI LUT (sized 64), GLOBAL
>> LUT (sized 256), and PF LUT (sized 2048). Until now the GLOBAL kind
>> was not used at all. There are two possible usages for it, subsequent
>> commit will give VF option to acquire it, and this one enables PF to
>> switch between PF LUT and GLOBAL LUT - switching to smaller one is,
>> again, to make it possible for VF to then acquire the former one.
>>
>> Devlink resources are used to let user show current usage and change
>> the allocation, see examples below.
>>
>> Default state on 8-port card, asking for aggregate "whole device"
>> usage, note that there are as many PF LUTs as there is PFs, and, for
>> e810, there are 16 GLOBAL LUTs:
>> $ devlink resource show devlink_index/11
>> devlink_index/11:
>> name rss size 8 unit entry size_min 0 size_max 24 size_gran 1
>> dpipe_tables none
>> resources:
>> name lut_512 size 0 unit entry size_min 0 size_max 16 size_gran
>> 1 dpipe_tables none
>> name lut_2048 size 8 unit entry size_min 0 size_max 8 size_gran
>> 1 dpipe_tables none
>>
>> Now let's add GLOBAL LUT for a single PF (on one-port NIC):
>> $ sudo devlink resource set pci/0000:18:00.0 path rss/lut_512 size 1
>> And show it's resources after that:
>> $ devlink resource show pci/0000:18:00.0
>> pci/0000:18:00.0:
>> name rss size 2 unit entry size_min 0 size_max 2 size_gran 1
>> dpipe_tables none
>> resources:
>> name lut_512 size 1 unit entry size_min 0 size_max 1 size_gran 1
>> dpipe_tables none
>> name lut_2048 size 1 unit entry size_min 0 size_max 1 size_gran
>> 1 dpipe_tables none Let's take the PF LUT out of that PF afterwards:
>> $ sudo devlink resource set pci/0000:18:00.0 path rss/lut_2048 size 0
>> now `ethtool -x $ifacename` will report smaller RSS table.
>>
>> Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
>> ---
>> drivers/net/ethernet/intel/ice/Makefile | 1 +
>> .../net/ethernet/intel/ice/devlink/resource.h | 19 +
>> drivers/net/ethernet/intel/ice/ice_adapter.h | 40 ++
>> drivers/net/ethernet/intel/ice/ice_common.h | 1 +
>> .../net/ethernet/intel/ice/devlink/resource.c | 469
>> ++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_adapter.c |
>> 12 +-
>> drivers/net/ethernet/intel/ice/ice_common.c | 2 +-
>> drivers/net/ethernet/intel/ice/ice_lib.c | 23 +-
>> drivers/net/ethernet/intel/ice/ice_main.c | 14 +-
>> 9 files changed, 573 insertions(+), 8 deletions(-) create mode
>> 100644 drivers/net/ethernet/intel/ice/devlink/resource.h
>> create mode 100644 drivers/net/ethernet/intel/ice/devlink/resource.c
>>
>> diff --git a/drivers/net/ethernet/intel/ice/Makefile
>> b/drivers/net/ethernet/intel/ice/Makefile
>> index 7f06d9bafe4a..0217ab6403de 100644
>> --- a/drivers/net/ethernet/intel/ice/Makefile
>> +++ b/drivers/net/ethernet/intel/ice/Makefile
>> @@ -37,6 +37,7 @@ ice-y := ice_main.o \
>> devlink/devlink.o \
>> devlink/health.o \
>> devlink/port.o \
>
> ...
>
>> +
>> +static int ice_devl_res_take(struct ice_pf *pf,
>> + enum ice_devl_resource_id res_id, int slot,
>> + void *owner)
>> +{
>> + struct ice_devl_resource *res = &pf->adapter-
>>> resources[res_id];
>> + int end = slot == ICE_ANY_SLOT ? res->max_size : slot + 1;
>> + int beg = slot == ICE_ANY_SLOT ? 0 : slot;
>> + int err, new_id = ICE_ANY_SLOT;
>> +
>> + for (int id = beg; id < end; id++) {
>> + if (!res->owner[id]) {
>> + new_id = id;
>> + break;
>> + }
>> + }
>> + if (new_id == ICE_ANY_SLOT)
>> + return -ENOSPC;
>> +
>> + if (res_id == ICE_RSS_LUT_GLOBAL) {
>> + struct ice_vsi *vsi;
>> + u16 lut_id;
>> +
>> + err = ice_alloc_rss_global_lut(&pf->hw, &lut_id);
>> + if (err)
>> + return err;
>> + if (lut_id != new_id)
>> + return -ENOANO;
> -ENOANO; looks for me very unusual choice.
> BTW won't LUT leak without calling ice_free_rss_global_lut() ?
I will replace it by WARN_ONCE() and just let use the ID we were
assigned by FW
>
>> +
>> + if (pf == owner)
>> + vsi = ice_get_main_vsi(pf);
>> + else
>> + vsi = ice_get_vf_vsi(owner);
>> +
>> + vsi->global_lut_id = new_id;
>> + }
>> +
>> + res->owner[new_id] = owner;
>> + res->pf_id[new_id] = pf->hw.pf_id;
>> + return new_id;
>> +}
>
> ...
>
>>
>> return status;
>> }
>> --
>> 2.39.3
>
next prev parent reply other threads:[~2026-05-11 9:41 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-08 12:41 [PATCH iwl-next v1 00/15] devlink, mlx5, iavf, ice: XLVF for iavf Przemek Kitszel
2026-05-08 12:41 ` [PATCH iwl-next v1 01/15] devlink, mlx5: add init/fini ops for shared devlink Przemek Kitszel
2026-05-11 11:36 ` Jiri Pirko
2026-05-11 13:26 ` Przemek Kitszel
2026-05-08 12:41 ` [PATCH iwl-next v1 02/15] ice: use shared devlink to store ice_adapters instead of custom xarray Przemek Kitszel
2026-05-08 12:41 ` [PATCH iwl-next v1 03/15] ice: simplify ice_vc_dis_qs_msg() a little Przemek Kitszel
2026-05-08 13:31 ` Loktionov, Aleksandr
2026-05-08 12:41 ` [PATCH iwl-next v1 04/15] ice: add VF queue ena/dis helper functions Przemek Kitszel
2026-05-08 13:37 ` Loktionov, Aleksandr
2026-05-11 9:33 ` Przemek Kitszel
2026-05-08 12:41 ` [PATCH iwl-next v1 05/15] ice: add helpers for Global RSS LUT alloc, free, vsi_update Przemek Kitszel
2026-05-08 13:38 ` Loktionov, Aleksandr
2026-05-08 12:41 ` [PATCH iwl-next v1 06/15] ice: rename ICE_MAX_RSS_QS_PER_VF to ICE_MAX_QS_PER_VF_VCV1 Przemek Kitszel
2026-05-08 12:42 ` [PATCH iwl-next v1 07/15] ice: bump to 256qs for VF Przemek Kitszel
2026-05-08 12:42 ` [PATCH iwl-next v1 08/15] iavf: extend iavf_configure_queues() to support more queues Przemek Kitszel
2026-05-08 12:42 ` [PATCH iwl-next v1 09/15] iavf: temporary rename of IAVF_MAX_REQ_QUEUES to IAVF_MAX_REQ_QUEUES_VCV1 Przemek Kitszel
2026-05-08 12:42 ` [PATCH iwl-next v1 10/15] iavf: increase max number of queues to 256 Przemek Kitszel
2026-05-08 16:49 ` Loktionov, Aleksandr
2026-05-11 9:37 ` Przemek Kitszel
2026-05-08 12:42 ` [PATCH iwl-next v1 11/15] iavf: use new opcodes to request more than 16 queues Przemek Kitszel
2026-05-08 12:42 ` [PATCH iwl-next v1 12/15] ice: introduce handling of virtchnl LARGE VF opcodes Przemek Kitszel
2026-05-08 16:55 ` Loktionov, Aleksandr
2026-05-11 9:39 ` Przemek Kitszel
2026-05-08 12:42 ` [PATCH iwl-next v1 13/15] devlink: give user option to allocate resources Przemek Kitszel
2026-05-08 12:42 ` [PATCH iwl-next v1 14/15] ice: represent RSS LUTs as devlink resources Przemek Kitszel
2026-05-08 17:03 ` Loktionov, Aleksandr
2026-05-11 9:41 ` Przemek Kitszel [this message]
2026-05-08 12:42 ` [PATCH iwl-next v1 15/15] ice: support up to 256 VF queues Przemek Kitszel
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=774b6a00-03c8-4a03-bfce-354f3265bc19@intel.com \
--to=przemyslaw.kitszel@intel.com \
--cc=aleksandr.loktionov@intel.com \
--cc=ananth.s@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=bruce.richardson@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jacob.e.keller@intel.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=lukasz.czapnik@intel.com \
--cc=mbloch@nvidia.com \
--cc=michal.swiatkowski@linux.intel.com \
--cc=mschmidt@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=padraig.j.connolly@intel.com \
--cc=saeedm@nvidia.com \
--cc=tariqt@nvidia.com \
--cc=timothy.miskell@intel.com \
--cc=vladimir.medvedkin@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