Skip to content

Commit 8c67b7a

Browse files
Michal Swiatkowskianguy11
authored andcommitted
ice: remove eswitch changing queues algorithm
Changing queues used by eswitch will be done through PF netdev. There is no need to reserve queues if the number of used queues is known. Reviewed-by: Wojciech Drewek <[email protected]> Reviewed-by: Marcin Szycik <[email protected]> Signed-off-by: Michal Swiatkowski <[email protected]> Tested-by: Sujai Buvaneswaran <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 537c2e9 commit 8c67b7a

File tree

4 files changed

+0
-47
lines changed

4 files changed

+0
-47
lines changed

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -527,12 +527,6 @@ struct ice_eswitch {
527527
struct ice_esw_br_offloads *br_offloads;
528528
struct xarray reprs;
529529
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;
536530
};
537531

538532
struct ice_agg_node {

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

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -455,8 +455,6 @@ static int ice_eswitch_enable_switchdev(struct ice_pf *pf)
455455
return -ENODEV;
456456

457457
ctrl_vsi = pf->eswitch.control_vsi;
458-
/* cp VSI is createad with 1 queue as default */
459-
pf->eswitch.qs.value = 1;
460458
pf->eswitch.uplink_vsi = uplink_vsi;
461459

462460
if (ice_eswitch_setup_env(pf))
@@ -489,7 +487,6 @@ static void ice_eswitch_disable_switchdev(struct ice_pf *pf)
489487
ice_vsi_release(ctrl_vsi);
490488

491489
pf->eswitch.is_running = false;
492-
pf->eswitch.qs.is_reaching = false;
493490
}
494491

495492
/**
@@ -620,18 +617,6 @@ ice_eswitch_cp_change_queues(struct ice_eswitch *eswitch, int change)
620617
struct ice_vsi *cp = eswitch->control_vsi;
621618
int queues = 0;
622619

623-
if (eswitch->qs.is_reaching) {
624-
if (eswitch->qs.to_reach >= eswitch->qs.value + change) {
625-
queues = eswitch->qs.to_reach;
626-
eswitch->qs.is_reaching = false;
627-
} else {
628-
queues = 0;
629-
}
630-
} else if ((change > 0 && cp->alloc_txq <= eswitch->qs.value) ||
631-
change < 0) {
632-
queues = cp->alloc_txq + change;
633-
}
634-
635620
if (queues) {
636621
cp->req_txq = queues;
637622
cp->req_rxq = queues;
@@ -643,7 +628,6 @@ ice_eswitch_cp_change_queues(struct ice_eswitch *eswitch, int change)
643628
ice_vsi_open(cp);
644629
}
645630

646-
eswitch->qs.value += change;
647631
ice_eswitch_remap_rings_to_vectors(eswitch);
648632
}
649633

@@ -661,8 +645,6 @@ ice_eswitch_attach(struct ice_pf *pf, struct ice_vf *vf)
661645
err = ice_eswitch_enable_switchdev(pf);
662646
if (err)
663647
return err;
664-
/* Control plane VSI is created with 1 queue as default */
665-
pf->eswitch.qs.to_reach -= 1;
666648
change = 0;
667649
}
668650

@@ -756,19 +738,3 @@ int ice_eswitch_rebuild(struct ice_pf *pf)
756738

757739
return 0;
758740
}
759-
760-
/**
761-
* ice_eswitch_reserve_cp_queues - reserve control plane VSI queues
762-
* @pf: pointer to PF structure
763-
* @change: how many more (or less) queues is needed
764-
*
765-
* Remember to call ice_eswitch_attach/detach() the "change" times.
766-
*/
767-
void ice_eswitch_reserve_cp_queues(struct ice_pf *pf, int change)
768-
{
769-
if (pf->eswitch.qs.value + change < 0)
770-
return;
771-
772-
pf->eswitch.qs.to_reach = pf->eswitch.qs.value + change;
773-
pf->eswitch.qs.is_reaching = true;
774-
}

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ void ice_eswitch_set_target_vsi(struct sk_buff *skb,
2626
struct ice_tx_offload_params *off);
2727
netdev_tx_t
2828
ice_eswitch_port_start_xmit(struct sk_buff *skb, struct net_device *netdev);
29-
void ice_eswitch_reserve_cp_queues(struct ice_pf *pf, int change);
3029
#else /* CONFIG_ICE_SWITCHDEV */
3130
static inline void ice_eswitch_detach(struct ice_pf *pf, struct ice_vf *vf) { }
3231

@@ -77,8 +76,5 @@ ice_eswitch_port_start_xmit(struct sk_buff *skb, struct net_device *netdev)
7776
{
7877
return NETDEV_TX_BUSY;
7978
}
80-
81-
static inline void
82-
ice_eswitch_reserve_cp_queues(struct ice_pf *pf, int change) { }
8379
#endif /* CONFIG_ICE_SWITCHDEV */
8480
#endif /* _ICE_ESWITCH_H_ */

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,6 @@ void ice_free_vfs(struct ice_pf *pf)
170170
else
171171
dev_warn(dev, "VFs are assigned - not disabling SR-IOV\n");
172172

173-
ice_eswitch_reserve_cp_queues(pf, -ice_get_num_vfs(pf));
174-
175173
mutex_lock(&vfs->table_lock);
176174

177175
ice_for_each_vf(pf, bkt, vf) {
@@ -897,7 +895,6 @@ static int ice_ena_vfs(struct ice_pf *pf, u16 num_vfs)
897895
goto err_unroll_sriov;
898896
}
899897

900-
ice_eswitch_reserve_cp_queues(pf, num_vfs);
901898
ret = ice_start_vfs(pf);
902899
if (ret) {
903900
dev_err(dev, "Failed to start %d VFs, err %d\n", num_vfs, ret);

0 commit comments

Comments
 (0)