Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
To: intel-wired-lan@lists.osuosl.org
Cc: wojciech.drewek@intel.com, marcin.szycik@intel.com,
	Marcin Szycik <marcin.szycik@linux.intel.com>,
	przemyslaw.kitszel@intel.com, sridhar.samudrala@intel.com,
	horms@kernel.org, netdev@vger.kernel.org,
	Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Subject: [Intel-wired-lan] [iwl-next v2 6/8] ice: change repr::id values
Date: Fri,  2 Feb 2024 15:59:26 +0100	[thread overview]
Message-ID: <20240202145929.12444-7-michal.swiatkowski@linux.intel.com> (raw)
In-Reply-To: <20240202145929.12444-1-michal.swiatkowski@linux.intel.com>

Instead of getting repr::id from xa_alloc() value, set it to the
src_vsi::num_vsi value. It is unique for each PR.

Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Marcin Szycik <marcin.szycik@linux.intel.com>
Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
---
 drivers/net/ethernet/intel/ice/ice_eswitch.c | 5 ++---
 drivers/net/ethernet/intel/ice/ice_repr.c    | 1 +
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_eswitch.c b/drivers/net/ethernet/intel/ice/ice_eswitch.c
index 76fa114f22c9..5eba8dec9f94 100644
--- a/drivers/net/ethernet/intel/ice/ice_eswitch.c
+++ b/drivers/net/ethernet/intel/ice/ice_eswitch.c
@@ -319,7 +319,7 @@ ice_eswitch_mode_set(struct devlink *devlink, u16 mode,
 
 		dev_info(ice_pf_to_dev(pf), "PF %d changed eswitch mode to switchdev",
 			 pf->hw.pf_id);
-		xa_init_flags(&pf->eswitch.reprs, XA_FLAGS_ALLOC);
+		xa_init(&pf->eswitch.reprs);
 		NL_SET_ERR_MSG_MOD(extack, "Changed eswitch mode to switchdev");
 		break;
 	}
@@ -426,8 +426,7 @@ ice_eswitch_attach(struct ice_pf *pf, struct ice_vf *vf)
 	if (err)
 		goto err_setup_repr;
 
-	err = xa_alloc(&pf->eswitch.reprs, &repr->id, repr,
-		       XA_LIMIT(1, INT_MAX), GFP_KERNEL);
+	err = xa_insert(&pf->eswitch.reprs, repr->id, repr, GFP_KERNEL);
 	if (err)
 		goto err_xa_alloc;
 
diff --git a/drivers/net/ethernet/intel/ice/ice_repr.c b/drivers/net/ethernet/intel/ice/ice_repr.c
index a5c24da31b88..b4fb74271811 100644
--- a/drivers/net/ethernet/intel/ice/ice_repr.c
+++ b/drivers/net/ethernet/intel/ice/ice_repr.c
@@ -345,6 +345,7 @@ ice_repr_add(struct ice_pf *pf, struct ice_vsi *src_vsi, const u8 *parent_mac)
 	}
 
 	repr->src_vsi = src_vsi;
+	repr->id = src_vsi->vsi_num;
 	np = netdev_priv(repr->netdev);
 	np->repr = repr;
 
-- 
2.42.0


  parent reply	other threads:[~2024-02-02 14:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-02 14:59 [Intel-wired-lan] [iwl-next v2 0/8] ice: use less resources in switchdev Michal Swiatkowski
2024-02-02 14:59 ` [Intel-wired-lan] [iwl-next v2 1/8] ice: remove eswitch changing queues algorithm Michal Swiatkowski
2024-02-16 12:13   ` Buvaneswaran, Sujai
2024-02-02 14:59 ` [Intel-wired-lan] [iwl-next v2 2/8] ice: do Tx through PF netdev in slow-path Michal Swiatkowski
2024-02-02 14:59 ` [Intel-wired-lan] [iwl-next v2 3/8] ice: default Tx rule instead of to queue Michal Swiatkowski
2024-02-02 14:59 ` [Intel-wired-lan] [iwl-next v2 4/8] ice: control default Tx rule in lag Michal Swiatkowski
2024-02-02 14:59 ` [Intel-wired-lan] [iwl-next v2 5/8] ice: remove switchdev control plane VSI Michal Swiatkowski
2024-02-02 14:59 ` Michal Swiatkowski [this message]
2024-02-02 14:59 ` [Intel-wired-lan] [iwl-next v2 7/8] ice: do switchdev slow-path Rx using PF VSI Michal Swiatkowski
2024-02-02 14:59 ` [Intel-wired-lan] [iwl-next v2 8/8] ice: count representor stats Michal Swiatkowski

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=20240202145929.12444-7-michal.swiatkowski@linux.intel.com \
    --to=michal.swiatkowski@linux.intel.com \
    --cc=horms@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=marcin.szycik@intel.com \
    --cc=marcin.szycik@linux.intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=sridhar.samudrala@intel.com \
    --cc=wojciech.drewek@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