From: Larysa Zaremba <larysa.zaremba@intel.com>
To: intel-wired-lan@lists.osuosl.org,
Tony Nguyen <anthony.l.nguyen@intel.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Jiri Pirko <jiri@resnulli.us>,
Tatyana Nikolova <tatyana.e.nikolova@intel.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Alexander Lobakin <aleksander.lobakin@intel.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Maciej Fijalkowski <maciej.fijalkowski@intel.com>,
Lee Trager <lee@trager.us>,
Madhavan Srinivasan <maddy@linux.ibm.com>,
Larysa Zaremba <larysa.zaremba@intel.com>,
Sridhar Samudrala <sridhar.samudrala@intel.com>,
Jacob Keller <jacob.e.keller@intel.com>,
Michal Swiatkowski <michal.swiatkowski@linux.intel.com>,
Mateusz Polchlopek <mateusz.polchlopek@intel.com>,
Ahmed Zaki <ahmed.zaki@intel.com>,
netdev@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, "Karlsson,
Magnus" <magnus.karlsson@intel.com>,
Emil Tantilov <emil.s.tantilov@intel.com>,
Madhu Chittim <madhu.chittim@intel.com>,
Josh Hay <joshua.a.hay@intel.com>,
Milena Olech <milena.olech@intel.com>,
pavan.kumar.linga@intel.com, "Singhai,
Anjali" <anjali.singhai@intel.com>
Subject: [PATCH iwl-next v2 07/14] idpf: remove 'vport_params_reqd' field
Date: Thu, 24 Apr 2025 13:32:30 +0200 [thread overview]
Message-ID: <20250424113241.10061-8-larysa.zaremba@intel.com> (raw)
In-Reply-To: <20250424113241.10061-1-larysa.zaremba@intel.com>
From: Pavan Kumar Linga <pavan.kumar.linga@intel.com>
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 <pavan.kumar.linga@intel.com>
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
---
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;
diff --git a/drivers/net/ethernet/intel/idpf/idpf_lib.c b/drivers/net/ethernet/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)
kfree(adapter->vport_params_recvd[idx]);
adapter->vport_params_recvd[idx] = NULL;
- kfree(adapter->vport_params_reqd[idx]);
- adapter->vport_params_reqd[idx] = NULL;
if (adapter->vport_config[idx]) {
kfree(adapter->vport_config[idx]->req_qs_chunks);
adapter->vport_config[idx]->req_qs_chunks = 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;
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);
@@ -1247,8 +1243,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]) {
@@ -1256,7 +1251,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;
}
}
@@ -1272,13 +1267,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;
}
@@ -2847,8 +2844,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;
}
@@ -2863,17 +2858,11 @@ static int idpf_vport_params_buf_alloc(struct idpf_adapter *adapter)
{
u16 num_max_vports = idpf_get_max_vports(adapter);
- adapter->vport_params_reqd = kcalloc(num_max_vports,
- sizeof(*adapter->vport_params_reqd),
- GFP_KERNEL);
- if (!adapter->vport_params_reqd)
- return -ENOMEM;
-
adapter->vport_params_recvd = kcalloc(num_max_vports,
sizeof(*adapter->vport_params_recvd),
GFP_KERNEL);
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.0
next prev parent reply other threads:[~2025-04-24 11:33 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-24 11:32 [PATCH iwl-next v2 00/14] Introduce iXD driver Larysa Zaremba
2025-04-24 11:32 ` [PATCH iwl-next v2 01/14] virtchnl: create 'include/linux/intel' and move necessary header files Larysa Zaremba
2025-04-28 16:15 ` Simon Horman
2025-04-29 18:47 ` [Intel-wired-lan] " Jacob Keller
2025-04-30 8:55 ` Simon Horman
2025-05-05 7:56 ` Larysa Zaremba
2025-05-06 15:59 ` Simon Horman
2025-05-07 7:13 ` Larysa Zaremba
2025-04-24 11:32 ` [PATCH iwl-next v2 02/14] virtchnl: introduce control plane version fields Larysa Zaremba
2025-04-24 11:32 ` [PATCH iwl-next v2 03/14] libie: add PCI device initialization helpers to libie Larysa Zaremba
2025-04-28 16:56 ` Simon Horman
2025-05-05 6:56 ` Larysa Zaremba
2025-05-06 15:56 ` Simon Horman
2025-04-24 11:32 ` [PATCH iwl-next v2 04/14] libeth: allow to create fill queues without NAPI Larysa Zaremba
2025-04-24 11:32 ` [PATCH iwl-next v2 05/14] libie: add control queue support Larysa Zaremba
2025-04-24 11:32 ` [PATCH iwl-next v2 06/14] libie: add bookkeeping support for control queue messages Larysa Zaremba
2025-04-24 11:32 ` Larysa Zaremba [this message]
2025-04-24 11:32 ` [PATCH iwl-next v2 08/14] idpf: refactor idpf to use libie controlq and Xn APIs Larysa Zaremba
2025-04-24 15:32 ` [Intel-wired-lan] " Paul Menzel
2025-04-24 15:37 ` Keller, Jacob E
2025-04-25 10:22 ` Larysa Zaremba
2025-04-25 10:11 ` Larysa Zaremba
2025-04-25 10:30 ` Paul Menzel
2025-04-28 18:03 ` Simon Horman
2025-05-05 7:09 ` Larysa Zaremba
2025-04-24 11:32 ` [PATCH iwl-next v2 09/14] idpf: make mbx_task queueing and cancelling more consistent Larysa Zaremba
2025-04-24 11:32 ` [PATCH iwl-next v2 10/14] idpf: print a debug message and bail in case of non-event ctlq message Larysa Zaremba
2025-04-24 11:32 ` [PATCH iwl-next v2 11/14] ixd: add basic driver framework for Intel(R) Control Plane Function Larysa Zaremba
2025-04-24 11:32 ` [PATCH iwl-next v2 12/14] ixd: add reset checks and initialize the mailbox Larysa Zaremba
2025-04-24 11:32 ` [PATCH iwl-next v2 13/14] ixd: add the core initialization Larysa Zaremba
2025-04-24 11:32 ` [PATCH iwl-next v2 14/14] ixd: add devlink support Larysa Zaremba
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=20250424113241.10061-8-larysa.zaremba@intel.com \
--to=larysa.zaremba@intel.com \
--cc=ahmed.zaki@intel.com \
--cc=aleksander.lobakin@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anjali.singhai@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=emil.s.tantilov@intel.com \
--cc=horms@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jacob.e.keller@intel.com \
--cc=jiri@resnulli.us \
--cc=joshua.a.hay@intel.com \
--cc=kuba@kernel.org \
--cc=lee@trager.us \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=maddy@linux.ibm.com \
--cc=madhu.chittim@intel.com \
--cc=magnus.karlsson@intel.com \
--cc=mateusz.polchlopek@intel.com \
--cc=michal.swiatkowski@linux.intel.com \
--cc=milena.olech@intel.com \
--cc=mpe@ellerman.id.au \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavan.kumar.linga@intel.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=sridhar.samudrala@intel.com \
--cc=tatyana.e.nikolova@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
all inboxes | Powered by JetHome®