From: Ivan Vecera <ivecera@redhat.com>
To: intel-wired-lan@lists.osuosl.org
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>,
Tony Nguyen <anthony.l.nguyen@intel.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org (open list:NETWORKING DRIVERS),
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH iwl-next 7/7] i40e: Add and use helper to reconfigure TC for given VSI
Date: Mon, 18 Mar 2024 15:30:51 +0100 [thread overview]
Message-ID: <20240318143058.287014-8-ivecera@redhat.com> (raw)
In-Reply-To: <20240318143058.287014-1-ivecera@redhat.com>
Add helper i40e_vsi_reconfig_tc(vsi) that configures TC
for given VSI using previously stored TC bitmap.
Effectively replaces open-coded patterns:
enabled_tc = vsi->tc_config.enabled_tc;
vsi->tc_config.enabled_tc = 0;
i40e_vsi_config_tc(vsi, enabled_tc);
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 31 +++++++++++++++------
1 file changed, 23 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 2e1955064abb..6c25d02ea05e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -5924,6 +5924,27 @@ static int i40e_vsi_config_tc(struct i40e_vsi *vsi, u8 enabled_tc)
return ret;
}
+/**
+ * i40e_vsi_reconfig_tc - Reconfigure VSI Tx Scheduler for stored TC map
+ * @vsi: VSI to be reconfigured
+ *
+ * This reconfigures a particular VSI for TCs that are mapped to the
+ * TC bitmap stored previously for the VSI.
+ *
+ * NOTE:
+ * It is expected that the VSI queues have been quisced before calling
+ * this function.
+ **/
+static int i40e_vsi_reconfig_tc(struct i40e_vsi *vsi)
+{
+ u8 enabled_tc;
+
+ enabled_tc = vsi->tc_config.enabled_tc;
+ vsi->tc_config.enabled_tc = 0;
+
+ return i40e_vsi_config_tc(vsi, enabled_tc);
+}
+
/**
* i40e_get_link_speed - Returns link speed for the interface
* @vsi: VSI to be configured
@@ -14290,7 +14311,6 @@ static struct i40e_vsi *i40e_vsi_reinit_setup(struct i40e_vsi *vsi)
struct i40e_vsi *main_vsi;
u16 alloc_queue_pairs;
struct i40e_pf *pf;
- u8 enabled_tc;
int ret;
if (!vsi)
@@ -14323,10 +14343,8 @@ static struct i40e_vsi *i40e_vsi_reinit_setup(struct i40e_vsi *vsi)
* layout configurations.
*/
main_vsi = i40e_pf_get_main_vsi(pf);
- enabled_tc = main_vsi->tc_config.enabled_tc;
- main_vsi->tc_config.enabled_tc = 0;
main_vsi->seid = pf->main_vsi_seid;
- i40e_vsi_config_tc(main_vsi, enabled_tc);
+ i40e_vsi_reconfig_tc(main_vsi);
if (vsi->type == I40E_VSI_MAIN)
i40e_rm_default_mac_filter(vsi, pf->hw.mac.perm_addr);
@@ -15085,11 +15103,8 @@ static int i40e_setup_pf_switch(struct i40e_pf *pf, bool reinit, bool lock_acqui
}
} else {
/* force a reset of TC and queue layout configurations */
- u8 enabled_tc = main_vsi->tc_config.enabled_tc;
-
- main_vsi->tc_config.enabled_tc = 0;
main_vsi->seid = pf->main_vsi_seid;
- i40e_vsi_config_tc(main_vsi, enabled_tc);
+ i40e_vsi_reconfig_tc(main_vsi);
}
i40e_vlan_stripping_disable(main_vsi);
--
2.43.0
next prev parent reply other threads:[~2024-03-18 14:31 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-18 14:30 [PATCH iwl-next 0/7] i40e: cleanups & refactors Ivan Vecera
2024-03-18 14:30 ` [PATCH iwl-next 1/7] i40e: Remove flags field from i40e_veb Ivan Vecera
2024-03-26 15:38 ` [Intel-wired-lan] " Loktionov, Aleksandr
2024-03-26 15:50 ` Kalesh Anakkur Purayil
2024-03-18 14:30 ` [PATCH iwl-next 2/7] i40e: Change argument of several client notification functions Ivan Vecera
2024-03-26 16:02 ` [Intel-wired-lan] " Loktionov, Aleksandr
2024-03-18 14:30 ` [PATCH iwl-next 3/7] i40e: Change argument of i40e_detect_recover_hung() Ivan Vecera
2024-03-26 17:16 ` [Intel-wired-lan] " Loktionov, Aleksandr
2024-03-18 14:30 ` [PATCH iwl-next 4/7] i40e: Add helper to access main VSI Ivan Vecera
2024-03-27 10:51 ` [Intel-wired-lan] " Loktionov, Aleksandr
2024-03-18 14:30 ` [PATCH iwl-next 5/7] i40e: Consolidate checks whether given VSI is main Ivan Vecera
2024-03-19 10:17 ` Paolo Abeni
2024-03-21 9:33 ` Ivan Vecera
2024-03-18 14:30 ` [PATCH iwl-next 6/7] i40e: Add helper to access main VEB Ivan Vecera
2024-03-26 20:19 ` [Intel-wired-lan] " Loktionov, Aleksandr
2024-03-18 14:30 ` Ivan Vecera [this message]
2024-03-19 9:54 ` [PATCH iwl-next 0/7] i40e: cleanups & refactors Michal Schmidt
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=20240318143058.287014-8-ivecera@redhat.com \
--to=ivecera@redhat.com \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jesse.brandeburg@intel.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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;
as well as URLs for NNTP newsgroup(s).