Skip to content

Commit fd2162a

Browse files
committed
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue
Tony Nguyen says: ==================== ice: use less resources in switchdev Michal Swiatkowski says: Switchdev is using one queue per created port representor. This can quickly lead to Rx queue shortage, as with subfunction support user can create high number of PRs. Save one MSI-X and 'number of PRs' * 1 queues. Refactor switchdev slow-path to use less resources (even no additional resources). Do this by removing control plane VSI and move its functionality to PF VSI. Even with current solution PF is acting like uplink and can't be used simultaneously for other use cases (adding filters can break slow-path). In short, do Tx via PF VSI and Rx packets using PF resources. Rx needs additional code in interrupt handler to choose correct PR netdev. Previous solution had to queue filters, it was way more elegant but needed one queue per PRs. Beside that this refactor mostly simplifies switchdev configuration. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: ice: count representor stats ice: do switchdev slow-path Rx using PF VSI ice: change repr::id values ice: remove switchdev control plane VSI ice: control default Tx rule in lag ice: default Tx rule instead of to queue ice: do Tx through PF netdev in slow-path ice: remove eswitch changing queues algorithm ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents b3f4c32 + 4498159 commit fd2162a

18 files changed

+232
-489
lines changed

drivers/net/ethernet/intel/ice/ice.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -522,17 +522,10 @@ enum ice_misc_thread_tasks {
522522
};
523523

524524
struct ice_eswitch {
525-
struct ice_vsi *control_vsi;
526525
struct ice_vsi *uplink_vsi;
527526
struct ice_esw_br_offloads *br_offloads;
528527
struct xarray reprs;
529528
bool is_running;
530-
/* struct to allow cp queues management optimization */
531-
struct {
532-
int to_reach;
533-
int value;
534-
bool is_reaching;
535-
} qs;
536529
};
537530

538531
struct ice_agg_node {

drivers/net/ethernet/intel/ice/ice_base.c

Lines changed: 9 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -263,30 +263,6 @@ static u16 ice_calc_txq_handle(struct ice_vsi *vsi, struct ice_tx_ring *ring, u8
263263
return ring->q_index - vsi->tc_cfg.tc_info[tc].qoffset;
264264
}
265265

266-
/**
267-
* ice_eswitch_calc_txq_handle
268-
* @ring: pointer to ring which unique index is needed
269-
*
270-
* To correctly work with many netdevs ring->q_index of Tx rings on switchdev
271-
* VSI can repeat. Hardware ring setup requires unique q_index. Calculate it
272-
* here by finding index in vsi->tx_rings of this ring.
273-
*
274-
* Return ICE_INVAL_Q_INDEX when index wasn't found. Should never happen,
275-
* because VSI is get from ring->vsi, so it has to be present in this VSI.
276-
*/
277-
static u16 ice_eswitch_calc_txq_handle(struct ice_tx_ring *ring)
278-
{
279-
const struct ice_vsi *vsi = ring->vsi;
280-
int i;
281-
282-
ice_for_each_txq(vsi, i) {
283-
if (vsi->tx_rings[i] == ring)
284-
return i;
285-
}
286-
287-
return ICE_INVAL_Q_INDEX;
288-
}
289-
290266
/**
291267
* ice_cfg_xps_tx_ring - Configure XPS for a Tx ring
292268
* @ring: The Tx ring to configure
@@ -353,9 +329,6 @@ ice_setup_tx_ctx(struct ice_tx_ring *ring, struct ice_tlan_ctx *tlan_ctx, u16 pf
353329
tlan_ctx->vmvf_num = hw->func_caps.vf_base_id + vsi->vf->vf_id;
354330
tlan_ctx->vmvf_type = ICE_TLAN_CTX_VMVF_TYPE_VF;
355331
break;
356-
case ICE_VSI_SWITCHDEV_CTRL:
357-
tlan_ctx->vmvf_type = ICE_TLAN_CTX_VMVF_TYPE_VMQ;
358-
break;
359332
default:
360333
return;
361334
}
@@ -479,6 +452,14 @@ static int ice_setup_rx_ctx(struct ice_rx_ring *ring)
479452
/* Rx queue threshold in units of 64 */
480453
rlan_ctx.lrxqthresh = 1;
481454

455+
/* PF acts as uplink for switchdev; set flex descriptor with src_vsi
456+
* metadata and flags to allow redirecting to PR netdev
457+
*/
458+
if (ice_is_eswitch_mode_switchdev(vsi->back)) {
459+
ring->flags |= ICE_RX_FLAGS_MULTIDEV;
460+
rxdid = ICE_RXDID_FLEX_NIC_2;
461+
}
462+
482463
/* Enable Flexible Descriptors in the queue context which
483464
* allows this driver to select a specific receive descriptor format
484465
* increasing context priority to pick up profile ID; default is 0x01;
@@ -919,14 +900,7 @@ ice_vsi_cfg_txq(struct ice_vsi *vsi, struct ice_tx_ring *ring,
919900
/* Add unique software queue handle of the Tx queue per
920901
* TC into the VSI Tx ring
921902
*/
922-
if (vsi->type == ICE_VSI_SWITCHDEV_CTRL) {
923-
ring->q_handle = ice_eswitch_calc_txq_handle(ring);
924-
925-
if (ring->q_handle == ICE_INVAL_Q_INDEX)
926-
return -ENODEV;
927-
} else {
928-
ring->q_handle = ice_calc_txq_handle(vsi, ring, tc);
929-
}
903+
ring->q_handle = ice_calc_txq_handle(vsi, ring, tc);
930904

931905
if (ch)
932906
status = ice_ena_vsi_txq(vsi->port_info, ch->ch_vsi->idx, 0,

drivers/net/ethernet/intel/ice/ice_dcb_lib.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,6 @@ static void ice_dcb_ena_dis_vsi(struct ice_pf *pf, bool ena, bool locked)
291291

292292
switch (vsi->type) {
293293
case ICE_VSI_CHNL:
294-
case ICE_VSI_SWITCHDEV_CTRL:
295294
case ICE_VSI_PF:
296295
if (ena)
297296
ice_ena_vsi(vsi, locked);
@@ -776,8 +775,7 @@ void ice_pf_dcb_recfg(struct ice_pf *pf, bool locked)
776775
/* no need to proceed with remaining cfg if it is CHNL
777776
* or switchdev VSI
778777
*/
779-
if (vsi->type == ICE_VSI_CHNL ||
780-
vsi->type == ICE_VSI_SWITCHDEV_CTRL)
778+
if (vsi->type == ICE_VSI_CHNL)
781779
continue;
782780

783781
ice_vsi_map_rings_to_vectors(vsi);

0 commit comments

Comments
 (0)