From: Ivan Vecera <ivecera@redhat.com>
To: intel-wired-lan@lists.osuosl.org
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
aleksandr.loktionov@intel.com, edumazet@google.com,
anthony.l.nguyen@intel.com, kuba@kernel.org, pabeni@redhat.com,
davem@davemloft.net
Subject: [Intel-wired-lan] [PATCH iwl-next v2 7/7] i40e: Add and use helper to reconfigure TC for given VSI
Date: Wed, 27 Mar 2024 08:57:33 +0100 [thread overview]
Message-ID: <20240327075733.8967-8-ivecera@redhat.com> (raw)
In-Reply-To: <20240327075733.8967-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);
Reviewed-by: Michal Schmidt <mschmidt@redhat.com>
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
WARNING: multiple messages have this Message-ID (diff)
From: Ivan Vecera <ivecera@redhat.com>
To: intel-wired-lan@lists.osuosl.org
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
mschmidt@redhat.com, aleksandr.loktionov@intel.com,
jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com
Subject: [PATCH iwl-next v2 7/7] i40e: Add and use helper to reconfigure TC for given VSI
Date: Wed, 27 Mar 2024 08:57:33 +0100 [thread overview]
Message-ID: <20240327075733.8967-8-ivecera@redhat.com> (raw)
In-Reply-To: <20240327075733.8967-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);
Reviewed-by: Michal Schmidt <mschmidt@redhat.com>
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-27 7:58 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-27 7:57 [Intel-wired-lan] [PATCH iwl-next v2 0/7] i40e: cleanups & refactors Ivan Vecera
2024-03-27 7:57 ` Ivan Vecera
2024-03-27 7:57 ` [Intel-wired-lan] [PATCH iwl-next v2 1/7] i40e: Remove flags field from i40e_veb Ivan Vecera
2024-03-27 7:57 ` Ivan Vecera
2024-03-28 17:23 ` [Intel-wired-lan] " Simon Horman
2024-03-28 17:23 ` Simon Horman
2024-04-02 4:20 ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
2024-04-02 4:20 ` Pucha, HimasekharX Reddy
2024-03-27 7:57 ` [Intel-wired-lan] [PATCH iwl-next v2 2/7] i40e: Refactor argument of several client notification functions Ivan Vecera
2024-03-27 7:57 ` Ivan Vecera
2024-03-28 17:22 ` [Intel-wired-lan] " Simon Horman
2024-03-28 17:22 ` Simon Horman
2024-03-27 7:57 ` [Intel-wired-lan] [PATCH iwl-next v2 3/7] i40e: Refactor argument of i40e_detect_recover_hung() Ivan Vecera
2024-03-27 7:57 ` Ivan Vecera
2024-03-28 17:23 ` [Intel-wired-lan] " Simon Horman
2024-03-28 17:23 ` Simon Horman
2024-03-29 4:47 ` [Intel-wired-lan] " Kalesh Anakkur Purayil
2024-03-29 4:47 ` Kalesh Anakkur Purayil
2024-03-29 11:02 ` [Intel-wired-lan] " Loktionov, Aleksandr
2024-03-29 11:02 ` Loktionov, Aleksandr
2024-04-02 4:21 ` Pucha, HimasekharX Reddy
2024-04-02 4:21 ` Pucha, HimasekharX Reddy
2024-03-27 7:57 ` [Intel-wired-lan] [PATCH iwl-next v2 4/7] i40e: Add helper to access main VSI Ivan Vecera
2024-03-27 7:57 ` Ivan Vecera
2024-03-28 17:24 ` [Intel-wired-lan] " Simon Horman
2024-03-28 17:24 ` Simon Horman
2024-04-02 4:23 ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
2024-04-02 4:23 ` Pucha, HimasekharX Reddy
2024-03-27 7:57 ` [Intel-wired-lan] [PATCH iwl-next v2 5/7] i40e: Consolidate checks whether given VSI is main Ivan Vecera
2024-03-27 7:57 ` Ivan Vecera
2024-03-28 17:24 ` [Intel-wired-lan] " Simon Horman
2024-03-28 17:24 ` Simon Horman
2024-04-02 4:25 ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
2024-04-02 4:25 ` Pucha, HimasekharX Reddy
2024-03-27 7:57 ` [Intel-wired-lan] [PATCH iwl-next v2 6/7] i40e: Add helper to access main VEB Ivan Vecera
2024-03-27 7:57 ` Ivan Vecera
2024-03-28 17:24 ` [Intel-wired-lan] " Simon Horman
2024-03-28 17:24 ` Simon Horman
2024-04-02 4:33 ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
2024-04-02 4:33 ` Pucha, HimasekharX Reddy
2024-03-27 7:57 ` Ivan Vecera [this message]
2024-03-27 7:57 ` [PATCH iwl-next v2 7/7] i40e: Add and use helper to reconfigure TC for given VSI Ivan Vecera
2024-03-28 17:25 ` [Intel-wired-lan] " Simon Horman
2024-03-28 17:25 ` Simon Horman
2024-04-12 14:19 ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
2024-04-12 14:19 ` Pucha, HimasekharX Reddy
2024-04-12 21:19 ` [Intel-wired-lan] [PATCH iwl-next v2 0/7] i40e: cleanups & refactors Tony Nguyen
2024-04-12 21:19 ` Tony Nguyen
2024-04-26 17:16 ` [Intel-wired-lan] " Ivan Vecera
2024-04-26 17:16 ` Ivan Vecera
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=20240327075733.8967-8-ivecera@redhat.com \
--to=ivecera@redhat.com \
--cc=aleksandr.loktionov@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=intel-wired-lan@lists.osuosl.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.