From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.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 510674908C0; Wed, 12 Aug 2026 21:26:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786569971; cv=none; b=jz0Vt6u1bMGWQrdc4xP7VJJ+Cwcl6iv3/3PQpXwy4nyIzKVB8Atr7kNPQGQS238+AXisW/8er6ryxUhmwhvX8v9vVKQk4EbFm8P2OooVqYzGNt05l3BB4Fc87KZszb9+oqAeYyR9yYF4ZSKY+0w/Ukabax5MPJBf/l2eLrrGADg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786569971; c=relaxed/simple; bh=3PdX5gtCGNwmT1Gx1/S8n4RZxBnyF+blgU7+SvoUM6Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iVGmMAmjSXG8xR38I+T8R8jh1dwIM2bEOKxHD5EClrUBXLIa9/psx5ApBZ0RvLK8UmY/+8Lvxwoo9MhGB27dAXnRb+xgchBrz8cc3DFwT5SoUvcD++iJkIyLCEETGI5WDVFQA1aJiDwqHVeoFp9jNRxq8VuKxdje5kMfjrOX6tA= 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=lopsdajp; arc=none smtp.client-ip=198.175.65.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="lopsdajp" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1786569966; x=1818105966; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3PdX5gtCGNwmT1Gx1/S8n4RZxBnyF+blgU7+SvoUM6Q=; b=lopsdajp7hulrBpfsqnV6JazZnSaLKh3aa5gmWhWY+5K0EZRicvQpkcU dX+bTk7GbVLOfm0j4XQ7CwUAS4XXsv2myVQSi32W1rS48CxJNLK2WmVF9 QAKhekTQgX0mKZ3PSsvqY2crJaV7dN1EIT+CYe5iwCj3JvMAwXe6GVTXP Zucevu5QAoJyEylC25bgBycR7Kv0d3DUkIWVcyAPK9aIfKMbBL2XyY7BG sk2WCoqp5odub4dfvPu5mC1bwUwjO2sJbA47iTm1g0G1XYAx4lX8LMyiQ p16XcA4N1xMFNyOC1lFBPVHL24cB2qO6mgesfmLJOptLds5Sv8GRWA6Cz Q==; X-CSE-ConnectionGUID: XUo+oqAzQCi3IDIGxLcdUw== X-CSE-MsgGUID: 4mrXa64lRImlsaej24AGZQ== X-IronPort-AV: E=McAfee;i="6800,10657,11873"; a="97485557" X-IronPort-AV: E=Sophos;i="6.25,220,1779174000"; d="scan'208";a="97485557" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2026 14:25:40 -0700 X-CSE-ConnectionGUID: 5za7H9ZRRvGuFV2LEEbomQ== X-CSE-MsgGUID: sta7lh4LTQiyltIKqrHJUQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,220,1779174000"; d="scan'208";a="257546245" Received: from anguy11-upstream.jf.intel.com ([10.166.9.133]) by fmviesa009.fm.intel.com with ESMTP; 12 Aug 2026 14:25:39 -0700 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com, andrew+netdev@lunn.ch, netdev@vger.kernel.org Cc: Pavan Kumar Linga , anthony.l.nguyen@intel.com, larysa.zaremba@intel.com, przemyslaw.kitszel@intel.com, aleksander.lobakin@intel.com, sridhar.samudrala@intel.com, michal.swiatkowski@linux.intel.com, maciej.fijalkowski@intel.com, emil.s.tantilov@intel.com, joshua.a.hay@intel.com, jacob.e.keller@intel.com, jayaprakash.shanmugam@intel.com, jiri@resnulli.us, horms@kernel.org, corbet@lwn.net, richardcochran@gmail.com, skhan@linuxfoundation.org, linux-doc@vger.kernel.org, Samuel Salin Subject: [PATCH net-next v8 06/15] idpf: remove 'vport_params_reqd' field Date: Wed, 12 Aug 2026 14:25:20 -0700 Message-ID: <20260812212532.905873-7-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20260812212532.905873-1-anthony.l.nguyen@intel.com> References: <20260812212532.905873-1-anthony.l.nguyen@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Madhu Chittim Tested-by: Samuel Salin Signed-off-by: Larysa Zaremba Signed-off-by: Tony Nguyen --- drivers/net/ethernet/intel/idpf/idpf.h | 2 -- drivers/net/ethernet/intel/idpf/idpf_lib.c | 2 -- .../net/ethernet/intel/idpf/idpf_virtchnl.c | 30 +++++++------------ 3 files changed, 10 insertions(+), 24 deletions(-) diff --git a/drivers/net/ethernet/intel/idpf/idpf.h b/drivers/net/ethernet/intel/idpf/idpf.h index 984944bab28b..c5e47e79a641 100644 --- a/drivers/net/ethernet/intel/idpf/idpf.h +++ b/drivers/net/ethernet/intel/idpf/idpf.h @@ -638,7 +638,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 * @singleq_pt_lkup: Lookup table for singleq RX ptypes @@ -697,7 +696,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; diff --git a/drivers/net/ethernet/intel/idpf/idpf_lib.c b/drivers/net/ethernet/intel/idpf/idpf_lib.c index bb81e620c5c8..810d220c229a 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_lib.c +++ b/drivers/net/ethernet/intel/idpf/idpf_lib.c @@ -1109,8 +1109,6 @@ static void idpf_vport_rel(struct idpf_vport *vport) kfree(adapter->vport_params_recvd[idx]); adapter->vport_params_recvd[idx] = NULL; - kfree(adapter->vport_params_reqd[idx]); - adapter->vport_params_reqd[idx] = NULL; kfree(vport); adapter->num_alloc_vports--; diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c index 8bd6cca64c9b..c4a128a114a5 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c +++ b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c @@ -1558,14 +1558,10 @@ int idpf_send_create_vport_msg(struct idpf_adapter *adapter, ssize_t reply_sz; buf_size = sizeof(struct virtchnl2_create_vport); - if (!adapter->vport_params_reqd[idx]) { - adapter->vport_params_reqd[idx] = kzalloc(buf_size, - GFP_KERNEL); - if (!adapter->vport_params_reqd[idx]) - return -ENOMEM; - } + vport_msg = kzalloc(buf_size, GFP_KERNEL); + if (!vport_msg) + return -ENOMEM; - vport_msg = adapter->vport_params_reqd[idx]; vport_msg->vport_type = cpu_to_le16(VIRTCHNL2_VPORT_TYPE_DEFAULT); vport_msg->vport_index = cpu_to_le16(idx); @@ -1582,8 +1578,7 @@ int idpf_send_create_vport_msg(struct idpf_adapter *adapter, err = 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; } if (!adapter->vport_params_recvd[idx]) { @@ -1591,7 +1586,7 @@ int idpf_send_create_vport_msg(struct idpf_adapter *adapter, GFP_KERNEL); if (!adapter->vport_params_recvd[idx]) { err = -ENOMEM; - goto free_vport_params; + goto rel_buf; } } @@ -1607,13 +1602,15 @@ int idpf_send_create_vport_msg(struct idpf_adapter *adapter, goto free_vport_params; } + kfree(vport_msg); + return 0; free_vport_params: kfree(adapter->vport_params_recvd[idx]); adapter->vport_params_recvd[idx] = NULL; - kfree(adapter->vport_params_reqd[idx]); - adapter->vport_params_reqd[idx] = NULL; +rel_buf: + kfree(vport_msg); return err; } @@ -3419,8 +3416,6 @@ static void idpf_vport_params_buf_rel(struct idpf_adapter *adapter) { kfree(adapter->vport_params_recvd); adapter->vport_params_recvd = NULL; - kfree(adapter->vport_params_reqd); - adapter->vport_params_reqd = NULL; kfree(adapter->vport_ids); adapter->vport_ids = NULL; } @@ -3435,15 +3430,10 @@ static int idpf_vport_params_buf_alloc(struct idpf_adapter *adapter) { u16 num_max_vports = idpf_get_max_vports(adapter); - adapter->vport_params_reqd = kzalloc_objs(*adapter->vport_params_reqd, - num_max_vports); - if (!adapter->vport_params_reqd) - return -ENOMEM; - adapter->vport_params_recvd = kzalloc_objs(*adapter->vport_params_recvd, num_max_vports); if (!adapter->vport_params_recvd) - goto err_mem; + return -ENOMEM; adapter->vport_ids = kcalloc(num_max_vports, sizeof(u32), GFP_KERNEL); if (!adapter->vport_ids) -- 2.47.1