Fix ping is lost after configuring ADq on VF
Subsystems (2)
cover Fix ping is lost after configuring ADq on VF
Properly reconfigure VF VSIs after VF request ADq.
Previously, VF main VSI in ADq had configured too many queues and had wrong RSS size, which lead to packets not being consumed and drops
in connectivity. Additionally, added setting vsi-> req_queue_pairs as the number of queues that will be distributed among the various TCs. Do it for non-zero values,which means the user requested a new number of queues.
The result is VF has ability to ping with ADq configured.
Eryk Rybak (2):
i40e: Fix changing previously set num_queue_pairs for PFs
i40e: Fix ping is lost after configuring ADq on VF
drivers/net/ethernet/intel/i40e/i40e.h | 1 + drivers/net/ethernet/intel/i40e/i40e_main.c | 89 ++++++++++++++++--- .../ethernet/intel/i40e/i40e_virtchnl_pf.c | 17 ++-- 3 files changed, 91 insertions(+), 16 deletions(-)
base-commit: 5ee9f22fb30f02076233f8fb105f83ff68fe6dbc
Signature · 1 line
2.20.1
PATCH 1/2 i40e: Fix changing previously set num_queue_pairs for PFs
Currently, the i40e_vsi_setup_queue_map is basing the count of queues in TCs on a VSI's alloc_queue_pairs member which is not changed throughout any user's action (for example via ethtool's set_channels callback).
This implies that vsi->tc_config.tc_info[n].qcount value that is given to the kernel via netdev_set_tc_queue() that notifies about the count of queues per particular traffic class is constant even if user has changed the total count of queues.
This in turn caused the kernel warning after setting the queue count to the lower value than the initial one:
$ ethtool -l ens801f0 Channel parameters for ens801f0: Pre-set maximums: RX: 0 TX: 0 Other: 1 Combined: 64 Current hardware settings: RX: 0 TX: 0 Other: 1 Combined: 64
$ ethtool -L ens801f0 combined 40
[dmesg]
Number of in use tx queues changed invalidating tc mappings. Priority traffic classification disabled!
Reason was that vsi->alloc_queue_pairs stayed at 64 value which was used to set the qcount on TC0 (by default only TC0 exists so all of the existing queues are assigned to TC0). we update the offset/qcount via netdev_set_tc_queue() back to the old value but then the netif_set_real_num_tx_queues() is using the vsi->num_queue_pairs as a value which got set to 40.
Fix it by using vsi->req_queue_pairs as a queue count that will be distributed across TCs. Do it only for non-zero values, which implies that user actually requested the new count of queues.
For VSIs other than main, stay with the vsi->alloc_queue_pairs as we only allow manipulating the queue count on main VSI.
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 35 ++++++++++++++------- 1 file changed, 23 insertions(+), 12 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +23 -12
@@ -1790,6 +1790,7 @@ static void i40e_vsi_setup_queue_map(struct i40e_vsi *vsi, bool is_add) {struct i40e_pf *pf = vsi->back; +u16 num_tc_qps =0 ;u16 sections =0 ;u8 netdev_tc =0 ;u16 numtc =1 ;
@@ -1797,13 +1798,29 @@ static void i40e_vsi_setup_queue_map(struct i40e_vsi *vsi,u8 offset;u16 qmap;int i; -u16 num_tc_qps =0 ; sections =I40E_AQ_VSI_PROP_QUEUE_MAP_VALID ; offset =0 ; +if (vsi->type ==I40E_VSI_MAIN ) { +/* This code helps add more queue to the VSI if we have +* more cores than RSS can support, the higher cores will +* be served by ATR or other filters. Furthermore, the +* non-zero req_queue_pairs says that user requested a new +* queue count via ethtool's set_channels, so use this +* value for queues distribution across traffic classes +*/ +if (vsi->req_queue_pairs >0 ) + vsi->num_queue_pairs = vsi->req_queue_pairs; +else if (pf->flags &I40E_FLAG_MSIX_ENABLED ) + vsi->num_queue_pairs = pf->num_lan_msix; + } +/* Number of queues per enabled TC */ - num_tc_qps = vsi->alloc_queue_pairs; +if (vsi->type ==I40E_VSI_MAIN ) + num_tc_qps = vsi->num_queue_pairs; +else + num_tc_qps = vsi->alloc_queue_pairs;if (enabled_tc && (vsi->back->flags &I40E_FLAG_DCB_ENABLED )) {/* Find numtc from enabled TC bitmap */ for (i =0 , numtc =0 ; i <I40E_MAX_TRAFFIC_CLASS ; i++) {
@@ -1881,16 +1898,10 @@ static void i40e_vsi_setup_queue_map(struct i40e_vsi *vsi, } ctxt->info.tc_mapping[i] =cpu_to_le16 (qmap); } - -/* Set actual Tx/Rx queue pairs */ - vsi->num_queue_pairs = offset; -if ((vsi->type ==I40E_VSI_MAIN ) && (numtc ==1 )) { -if (vsi->req_queue_pairs >0 ) - vsi->num_queue_pairs = vsi->req_queue_pairs; -else if (pf->flags &I40E_FLAG_MSIX_ENABLED ) - vsi->num_queue_pairs = pf->num_lan_msix; - } - +/* Do not change previously set num_queue_pairs for PFs */ +if ((vsi->type ==I40E_VSI_MAIN && numtc !=1 ) || + vsi->type !=I40E_VSI_MAIN ) + vsi->num_queue_pairs = offset;/* Scheduler section valid can only be set for ADD VSI */ if (is_add) { sections |=I40E_AQ_VSI_PROP_SCHED_VALID ;
Signature · 1 line
2.20.1
Brelinski
PATCH 1/2 i40e: Fix changing previously set num_queue_pairs for PFs
Quoted 60 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Rybak, Eryk Roch
Sent: Friday, April 23, 2021 4:43 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Rybak, Eryk Roch <[email protected]>; Patynowski, PrzemyslawX <[email protected]>
Subject: [Intel-wired-lan] [PATCH net-next v1 1/2] i40e: Fix changing previously setnum_queue_pairsfor PFsCurrently, the
i40e_vsi_setup_queue_mapis basing the count of queues in TCs on a VSI'salloc_queue_pairsmember which is not changed throughout any user's action (for example via ethtool'sset_channelscallback).This implies that vsi->tc_config.tc_info[n].qcount value that is given to the kernel via
netdev_set_tc_queue()that notifies about the count of queues per particular traffic class is constant even if user has changed the total count of queues.This in turn caused the kernel warning after setting the queue count to the lower value than the initial one:
$ ethtool -l ens801f0 Channel parameters for ens801f0: Pre-set maximums: RX: 0 TX: 0 Other: 1 Combined: 64 Current hardware settings: RX: 0 TX: 0 Other: 1 Combined: 64$ ethtool -L ens801f0 combined 40[dmesg]
Number of in use tx queues changed invalidating tc mappings. Priority traffic classification disabled!Reason was that
vsi->alloc_queue_pairsstayed at 64 value which was used to set the qcount on TC0 (by default only TC0 exists so all of the existing queues are assigned to TC0). we update the offset/qcount vianetdev_set_tc_queue()back to the old value but then thenetif_set_real_num_tx_queues()is using thevsi->num_queue_pairsas a value which got set to 40.Fix it by using
vsi->req_queue_pairsas a queue count that will be distributed across TCs. Do it only for non-zero values, which implies that user actually requested the new count of queues.For VSIs other than main, stay with the
vsi->alloc_queue_pairsas we only allow manipulating the queue count on main VSI.Fixes bc6d33c8d93f ("i40e: Fix the number of queues available to be mappedfor use")
Co-developed-by Maciej Fijalkowski <[email protected]>Signed-off-by Maciej Fijalkowski <[email protected]>Co-developed-by Przemyslaw Patynowski
Quoted 7 lines
<[email protected]>
Signed-off-by: Przemyslaw Patynowski
<[email protected]>Signed-off-by Eryk Rybak <[email protected]>--- drivers/net/ethernet/intel/i40e/i40e_main.c | 35 ++++++++++++++------- 1 file changed, 23 insertions(+), 12 deletions(-)
PATCH 2/2 i40e: Fix ping is lost after configuring ADq on VF
In reply to Eryk RybakProperly reconfigure VF VSIs after VF request ADq.
Created new function to update queue mapping and queue pairs per TC with AQ update VSI. This sets proper RSS size on NIC.
VFs num_queue_pairs should not be changed during setup of queue maps. Previously, VF main VSI in ADq had configured too many queues and had wrong RSS size, which lead to packets not being consumed and drops in connectivity.
--- drivers/net/ethernet/intel/i40e/i40e.h | 1 + drivers/net/ethernet/intel/i40e/i40e_main.c | 62 ++++++++++++++++++- .../ethernet/intel/i40e/i40e_virtchnl_pf.c | 17 +++-- 3 files changed, 72 insertions(+), 8 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +1 -0
@@ -1246,6 +1246,7 @@ void i40e_ptp_restore_hw_time(struct i40e_pf *pf);void i40e_ptp_init (struct i40e_pf *pf);void i40e_ptp_stop (struct i40e_pf *pf);int i40e_ptp_alloc_pins (struct i40e_pf *pf); +int i40e_update_adq_vsi_queues (struct i40e_vsi *vsi,int vsi_offset);int i40e_is_vsi_uplink_mode_veb (struct i40e_vsi *vsi);i40e_status i40e_get_partition_bw_setting (struct i40e_pf *pf);i40e_status i40e_set_partition_bw_setting (struct i40e_pf *pf);
drivers/net/ethernet/intel/i40e/i40e_main.c +59 -3
91 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +12 -5
@@ -2238,11 +2238,12 @@ static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg)struct virtchnl_vsi_queue_config_info *qci = (struct virtchnl_vsi_queue_config_info *)msg;struct virtchnl_queue_pair_info *qpi; -struct i40e_pf *pf = vf->pf;u16 vsi_id, vsi_queue_id =0 ; -u16 num_qps_all =0 ; +struct i40e_pf *pf = vf->pf;i40e_status aq_ret =0 ;int i, j =0 , idx =0 ; +struct i40e_vsi *vsi; +u16 num_qps_all =0 ;if (!test_bit (I40E_VF_STATE_ACTIVE , &vf->vf_states)) { aq_ret =I40E_ERR_PARAM ;
@@ -2331,9 +2332,15 @@ static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg) pf->vsi[vf->lan_vsi_idx]->num_queue_pairs = qci->num_queue_pairs; }else { -for (i =0 ; i < vf->num_tc; i++) - pf->vsi[vf->ch[i].vsi_idx]->num_queue_pairs = - vf->ch[i].num_qps; +for (i =0 ; i < vf->num_tc; i++) { + vsi = pf->vsi[vf->ch[i].vsi_idx]; + vsi->num_queue_pairs = vf->ch[i].num_qps; + +if (i40e_update_adq_vsi_queues (vsi, i)) { + aq_ret =I40E_ERR_CONFIG ; + goto error_param; + } + } } error_param:
Signature · 1 line
2.20.1
Brelinski
PATCH 2/2 i40e: Fix ping is lost after configuring ADq on VF
Quoted 24 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Rybak, Eryk Roch
Sent: Friday, April 23, 2021 4:43 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Rybak, Eryk Roch <[email protected]>; Patynowski, PrzemyslawX <[email protected]>
Subject: [Intel-wired-lan] [PATCH net-next v1 2/2] i40e: Fix ping is lost after configuring ADq on VFProperly reconfigure VF VSIs after VF request ADq.
Created new function to update queue mapping and queue pairs per TC with AQ update VSI. This sets proper RSS size on NIC.
VFsnum_queue_pairsshould not be changed during setup of queue maps. Previously, VF main VSI in ADq had configured too many queues and had wrong RSS size, which lead to packets not being consumed and drops in connectivity.Fixes bc6d33c8d93f ("i40e: Fix the number of queues available to be mappedfor use")
Co-developed-by: Przemyslaw Patynowski
<[email protected]>
Signed-off-by: Przemyslaw Patynowski
<[email protected]>
Quoted 6 lines
Signed-off-by Eryk Rybak <[email protected]>--- drivers/net/ethernet/intel/i40e/i40e.h | 1 + drivers/net/ethernet/intel/i40e/i40e_main.c | 62 ++++++++++++++++++- .../ethernet/intel/i40e/i40e_virtchnl_pf.c | 17 +++-- 3 files changed, 72 insertions(+), 8 deletions(-)