From nobody Mon Feb 9 14:03:11 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 64F162288D2; Thu, 24 Apr 2025 11:33:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745494395; cv=none; b=mAHpJRIfXXjLc4Z0Ta3wvcEbqpetuHzEZT4Lbhh1WJ1YiU5AwAmDYS8Kmrv0LRfJCTRbTan6w+j6gMqpRWwhYdNyY7aCOa8ymAxTCHw3QJn9Cji48YUp/XAyJROG6PP1brL2A4eEiFT3PkwIxfkNhudJI3IeIaW4tq0w76JsuIQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745494395; c=relaxed/simple; bh=wThW0E9IeVuGP+kqjdmswdvx5kRIF7hbP2DVRW2rI0U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qs6XNXwjt/f+C+Vvs5q20nfmnBy2EVI4E5j0JUrjozryk7zLiv1Pbci38Fe37++GN+hxGCEvPeWpoQHTjWnkNczpmIMC3FpcJxs5oEY6t2dDEN9ztSJBQhIkiSdRma4+Pa+qQsjOABe+59UVYdzD8MRxa5Awhvu9uMV1kRQHJ3w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=iS4VrTV6; arc=none smtp.client-ip=192.198.163.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="iS4VrTV6" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1745494393; x=1777030393; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wThW0E9IeVuGP+kqjdmswdvx5kRIF7hbP2DVRW2rI0U=; b=iS4VrTV6OeSyyDdFnZ9XIzV/5fAw2QFkg86RiLkblH4aOaijr+QpjP7n 1fZEcB0loWkh0TbblQWcAAgcq4NGv9W5/rFSAN8jy/yTwaHwc7U2Io+lk 6175Ql0KVDwm+Fl/VxoofnxnrMGVbqjdQgeQLdUd2VhSeS7JAaYrI6dOZ TQR+rx3DHME0WvsGLnVmzPtcKMYG2aOAQZ8Dokyb5kV9m7M/Z2jWdQeLF e4fHXWuqtofnAfYu1zDLvaHY2haVhf1xKRo4UEUi4Y1NS2cVFiN+CDOgP vIYuUi93PS6Cbho6+nAiBokkbMUqT6upW0te3is5DEZRdwJ0+qGRLu8tb A==; X-CSE-ConnectionGUID: yC981KhtRVKrLkwKM5sA3Q== X-CSE-MsgGUID: Eip6IaGGSIWRBNsgOBrSOw== X-IronPort-AV: E=McAfee;i="6700,10204,11412"; a="57771238" X-IronPort-AV: E=Sophos;i="6.15,235,1739865600"; d="scan'208";a="57771238" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2025 04:33:07 -0700 X-CSE-ConnectionGUID: //Ns4K0URxGdb2EuK4J7Yg== X-CSE-MsgGUID: ODG1OBRSRiOn1biUZOXgkw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,235,1739865600"; d="scan'208";a="137389422" Received: from irvmail002.ir.intel.com ([10.43.11.120]) by fmviesa005.fm.intel.com with ESMTP; 24 Apr 2025 04:33:01 -0700 Received: from mglak.igk.intel.com (mglak.igk.intel.com [10.237.112.146]) by irvmail002.ir.intel.com (Postfix) with ESMTP id D187533EA4; Thu, 24 Apr 2025 12:32:58 +0100 (IST) From: Larysa Zaremba To: intel-wired-lan@lists.osuosl.org, Tony Nguyen Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Jonathan Corbet , Przemek Kitszel , Jiri Pirko , Tatyana Nikolova , Andrew Lunn , Alexander Lobakin , Michael Ellerman , Maciej Fijalkowski , Lee Trager , Madhavan Srinivasan , Larysa Zaremba , Sridhar Samudrala , Jacob Keller , Michal Swiatkowski , Mateusz Polchlopek , Ahmed Zaki , netdev@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, "Karlsson, Magnus" , Emil Tantilov , Madhu Chittim , Josh Hay , Milena Olech , pavan.kumar.linga@intel.com, "Singhai, Anjali" Subject: [PATCH iwl-next v2 07/14] idpf: remove 'vport_params_reqd' field Date: Thu, 24 Apr 2025 13:32:30 +0200 Message-ID: <20250424113241.10061-8-larysa.zaremba@intel.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20250424113241.10061-1-larysa.zaremba@intel.com> References: <20250424113241.10061-1-larysa.zaremba@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Pavan Kumar Linga While sending a create vport message to the device control plane, a create vport virtchnl message is prepared with all the required info to initialize the vport. This info is stored in the adapter struct but never used thereafter. So, remove the said field. Signed-off-by: Pavan Kumar Linga Reviewed-by: Maciej Fijalkowski Signed-off-by: Larysa Zaremba --- drivers/net/ethernet/intel/idpf/idpf.h | 2 -- drivers/net/ethernet/intel/idpf/idpf_lib.c | 2 -- .../net/ethernet/intel/idpf/idpf_virtchnl.c | 31 ++++++------------- 3 files changed, 10 insertions(+), 25 deletions(-) diff --git a/drivers/net/ethernet/intel/idpf/idpf.h b/drivers/net/ethernet/= intel/idpf/idpf.h index a46793d34827..b714746ccc90 100644 --- a/drivers/net/ethernet/intel/idpf/idpf.h +++ b/drivers/net/ethernet/intel/idpf/idpf.h @@ -535,7 +535,6 @@ struct idpf_vc_xn_manager; * @avail_queues: Device given queue limits * @vports: Array to store vports created by the driver * @netdevs: Associated Vport netdevs - * @vport_params_reqd: Vport params requested * @vport_params_recvd: Vport params received * @vport_ids: Array of device given vport identifiers * @vport_config: Vport config parameters @@ -590,7 +589,6 @@ struct idpf_adapter { struct idpf_avail_queue_info avail_queues; struct idpf_vport **vports; struct net_device **netdevs; - struct virtchnl2_create_vport **vport_params_reqd; struct virtchnl2_create_vport **vport_params_recvd; u32 *vport_ids; =20 diff --git a/drivers/net/ethernet/intel/idpf/idpf_lib.c b/drivers/net/ether= net/intel/idpf/idpf_lib.c index bab12ecb2df5..34a6a26410a6 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_lib.c +++ b/drivers/net/ethernet/intel/idpf/idpf_lib.c @@ -951,8 +951,6 @@ static void idpf_vport_rel(struct idpf_vport *vport) =20 kfree(adapter->vport_params_recvd[idx]); adapter->vport_params_recvd[idx] =3D NULL; - kfree(adapter->vport_params_reqd[idx]); - adapter->vport_params_reqd[idx] =3D NULL; if (adapter->vport_config[idx]) { kfree(adapter->vport_config[idx]->req_qs_chunks); adapter->vport_config[idx]->req_qs_chunks =3D NULL; diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c b/drivers/net/= ethernet/intel/idpf/idpf_virtchnl.c index f1f6b63bfeb0..ced129f6477e 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c +++ b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c @@ -1223,14 +1223,10 @@ int idpf_send_create_vport_msg(struct idpf_adapter = *adapter, ssize_t reply_sz; =20 buf_size =3D sizeof(struct virtchnl2_create_vport); - if (!adapter->vport_params_reqd[idx]) { - adapter->vport_params_reqd[idx] =3D kzalloc(buf_size, - GFP_KERNEL); - if (!adapter->vport_params_reqd[idx]) - return -ENOMEM; - } + vport_msg =3D kzalloc(buf_size, GFP_KERNEL); + if (!vport_msg) + return -ENOMEM; =20 - vport_msg =3D adapter->vport_params_reqd[idx]; vport_msg->vport_type =3D cpu_to_le16(VIRTCHNL2_VPORT_TYPE_DEFAULT); vport_msg->vport_index =3D cpu_to_le16(idx); =20 @@ -1247,8 +1243,7 @@ int idpf_send_create_vport_msg(struct idpf_adapter *a= dapter, err =3D idpf_vport_calc_total_qs(adapter, idx, vport_msg, max_q); if (err) { dev_err(&adapter->pdev->dev, "Enough queues are not available"); - - return err; + goto rel_buf; } =20 if (!adapter->vport_params_recvd[idx]) { @@ -1256,7 +1251,7 @@ int idpf_send_create_vport_msg(struct idpf_adapter *a= dapter, GFP_KERNEL); if (!adapter->vport_params_recvd[idx]) { err =3D -ENOMEM; - goto free_vport_params; + goto rel_buf; } } =20 @@ -1272,13 +1267,15 @@ int idpf_send_create_vport_msg(struct idpf_adapter = *adapter, goto free_vport_params; } =20 + kfree(vport_msg); + return 0; =20 free_vport_params: kfree(adapter->vport_params_recvd[idx]); adapter->vport_params_recvd[idx] =3D NULL; - kfree(adapter->vport_params_reqd[idx]); - adapter->vport_params_reqd[idx] =3D NULL; +rel_buf: + kfree(vport_msg); =20 return err; } @@ -2847,8 +2844,6 @@ static void idpf_vport_params_buf_rel(struct idpf_ada= pter *adapter) { kfree(adapter->vport_params_recvd); adapter->vport_params_recvd =3D NULL; - kfree(adapter->vport_params_reqd); - adapter->vport_params_reqd =3D NULL; kfree(adapter->vport_ids); adapter->vport_ids =3D NULL; } @@ -2863,17 +2858,11 @@ static int idpf_vport_params_buf_alloc(struct idpf_= adapter *adapter) { u16 num_max_vports =3D idpf_get_max_vports(adapter); =20 - adapter->vport_params_reqd =3D kcalloc(num_max_vports, - sizeof(*adapter->vport_params_reqd), - GFP_KERNEL); - if (!adapter->vport_params_reqd) - return -ENOMEM; - adapter->vport_params_recvd =3D kcalloc(num_max_vports, sizeof(*adapter->vport_params_recvd), GFP_KERNEL); if (!adapter->vport_params_recvd) - goto err_mem; + return -ENOMEM; =20 adapter->vport_ids =3D kcalloc(num_max_vports, sizeof(u32), GFP_KERNEL); if (!adapter->vport_ids) --=20 2.47.0