From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BC8B0C47DB3 for ; Fri, 2 Feb 2024 14:55:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 72B114374D; Fri, 2 Feb 2024 14:55:47 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 72B114374D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1706885747; bh=OksPROaUvQkaJh1dljDcayAAYPAf3Iyccfa2bV8KDlI=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=S9DGbxmTGH8CK1gMaMxzKYUI5iJpYu6jOMwfbgaGgL5AOtazCzdU3TpR40T3P2/me sLkoQ6bJ40siD17MYVi4as7ljBYqh0vbW7tb//KoVN/ZzSCZ8NRrhb60PcqUlvwRMj xOhF96ZnnV1KaaEGP9tIlBQuNTQOZL9ytx19eGiHwUkd+7TfC0cAYO7gXRV0z9CqKz B3bvFNi74ULxk1lmoVwJayjVPTSHznQ8PApLwHN7Ej6C31DUiox934gSsnCKScuOFO amqt2LtpstqSXNEg1BxCi7PxOg95XZtsWMiCgFBohD2qU0UzpnE9JvRMyLqwzf1SP2 gh9UIsTqOVy2g== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id X7prekIfnHeI; Fri, 2 Feb 2024 14:55:47 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 94BCD43760; Fri, 2 Feb 2024 14:55:46 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 94BCD43760 Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 4DB631BF99D for ; Fri, 2 Feb 2024 14:55:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 8E6E2426FE for ; Fri, 2 Feb 2024 14:55:39 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 8E6E2426FE X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oTFu0wxASs0v for ; Fri, 2 Feb 2024 14:55:39 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by smtp4.osuosl.org (Postfix) with ESMTPS id 07AC34224C for ; Fri, 2 Feb 2024 14:55:38 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 07AC34224C X-IronPort-AV: E=McAfee;i="6600,9927,10971"; a="10823043" X-IronPort-AV: E=Sophos;i="6.05,238,1701158400"; d="scan'208";a="10823043" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Feb 2024 06:55:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,238,1701158400"; d="scan'208";a="98474" Received: from wasp.igk.intel.com (HELO GK3153-DR2-R750-36946.localdomain.com) ([10.102.20.192]) by orviesa009.jf.intel.com with ESMTP; 02 Feb 2024 06:55:34 -0800 From: Michal Swiatkowski To: intel-wired-lan@lists.osuosl.org Date: Fri, 2 Feb 2024 15:59:26 +0100 Message-ID: <20240202145929.12444-7-michal.swiatkowski@linux.intel.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240202145929.12444-1-michal.swiatkowski@linux.intel.com> References: <20240202145929.12444-1-michal.swiatkowski@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706885739; x=1738421739; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PNyrbCjywjNlIXYg5ByVAotjsH2kxGncIfNEMqdut3Q=; b=OXtEjXW5tFXeN5pDcYIjpz4ns2ArJml17jQx42duIZW2OQPobG9GmfLW uTFhnZHKxcRfobWfkNAu0HF6K/mjlAgnUZOsqKzq/MFmsURV+7p8JnDAo dk3bsvYYT5tA+Bh+RcWjShYXDGSbfIUNDccpQEPTDVPSxQB7JwkZ46NQ5 Ds71ZKYtrH/QkH5ASV2QTzh1HMAu7ZP+7kTtwx7m+YyKAqvqUc5Wwp7vO gQE9TPwB8l5+096np9wM+l78rwb4X+6fMgwHoGri9qHjIn3OkCdBcB1rs 5IUOBRXU9cikliUKHTKmkQGwU15NV4pLpHWvHWUlmFKfTOQ7tDfyjkIxD w==; X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=OXtEjXW5 Subject: [Intel-wired-lan] [iwl-next v2 6/8] ice: change repr::id values X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: wojciech.drewek@intel.com, marcin.szycik@intel.com, Marcin Szycik , przemyslaw.kitszel@intel.com, sridhar.samudrala@intel.com, horms@kernel.org, netdev@vger.kernel.org, Michal Swiatkowski Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" 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 Reviewed-by: Marcin Szycik Signed-off-by: Michal Swiatkowski --- 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