* [Intel-wired-lan] [PATCH net-next v1] i40e: Refactor arrow operator usage in i40e_update_adq_vsi_queues()
@ 2021-06-11 22:54 =?unknown-8bit?q?J=C4=99drzej?= Jagielski
2021-10-27 20:39 ` Brelinski, Tony
0 siblings, 1 reply; 2+ messages in thread
From: =?unknown-8bit?q?J=C4=99drzej?= Jagielski @ 2021-06-11 22:54 UTC (permalink / raw)
To: intel-wired-lan
Use local pf & hw variables instead of multiple arrow operators.
Move pf & hw variables initialization after checking if vsi is not NULL.
Co-developed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index fce05ad24..6a11002c8 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -5450,16 +5450,18 @@ static void i40e_vsi_update_queue_map(struct i40e_vsi *vsi,
*/
int i40e_update_adq_vsi_queues(struct i40e_vsi *vsi, int vsi_offset)
{
- struct i40e_pf *pf = vsi->back;
- struct i40e_hw *hw = &pf->hw;
struct i40e_vsi_context ctxt = {};
- int ret = 0;
+ struct i40e_pf *pf;
+ struct i40e_hw *hw;
+ int ret;
if (!vsi)
return I40E_ERR_PARAM;
+ pf = vsi->back;
+ hw = &pf->hw;
ctxt.seid = vsi->seid;
- ctxt.pf_num = vsi->back->hw.pf_id;
+ ctxt.pf_num = hw->pf_id;
ctxt.vf_num = vsi->vf_id + hw->func_caps.vf_base_id + vsi_offset;
ctxt.uplink_seid = vsi->uplink_seid;
ctxt.connection_type = I40E_AQ_VSI_CONN_TYPE_NORMAL;
@@ -5469,11 +5471,11 @@ int i40e_update_adq_vsi_queues(struct i40e_vsi *vsi, int vsi_offset)
i40e_vsi_setup_queue_map(vsi, &ctxt, vsi->tc_config.enabled_tc,
false);
if (vsi->reconfig_rss) {
- vsi->rss_size = min_t(int, vsi->back->alloc_rss_size,
+ vsi->rss_size = min_t(int, pf->alloc_rss_size,
vsi->num_queue_pairs);
ret = i40e_vsi_config_rss(vsi);
if (ret) {
- dev_info(&vsi->back->pdev->dev, "Failed to reconfig rss for num_queues\n");
+ dev_info(&pf->pdev->dev, "Failed to reconfig rss for num_queues\n");
return ret;
}
vsi->reconfig_rss = false;
--
2.27.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Intel-wired-lan] [PATCH net-next v1] i40e: Refactor arrow operator usage in i40e_update_adq_vsi_queues()
2021-06-11 22:54 [Intel-wired-lan] [PATCH net-next v1] i40e: Refactor arrow operator usage in i40e_update_adq_vsi_queues() =?unknown-8bit?q?J=C4=99drzej?= Jagielski
@ 2021-10-27 20:39 ` Brelinski, Tony
0 siblings, 0 replies; 2+ messages in thread
From: Brelinski, Tony @ 2021-10-27 20:39 UTC (permalink / raw)
To: intel-wired-lan
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Jagielski, Jedrzej
> Sent: Friday, June 11, 2021 3:55 PM
> To: intel-wired-lan at lists.osuosl.org
> Cc: Loktionov, Aleksandr <aleksandr.loktionov@intel.com>; Jagielski, Jedrzej
> <jedrzej.jagielski@intel.com>
> Subject: [Intel-wired-lan] [PATCH net-next v1] i40e: Refactor arrow operator
> usage in i40e_update_adq_vsi_queues()
>
> Use local pf & hw variables instead of multiple arrow operators.
> Move pf & hw variables initialization after checking if vsi is not NULL.
>
> Co-developed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
> ---
> drivers/net/ethernet/intel/i40e/i40e_main.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
Tested-by: Tony Brelinski <tony.brelinski@intel.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-10-27 20:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-11 22:54 [Intel-wired-lan] [PATCH net-next v1] i40e: Refactor arrow operator usage in i40e_update_adq_vsi_queues() =?unknown-8bit?q?J=C4=99drzej?= Jagielski
2021-10-27 20:39 ` Brelinski, Tony
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.