Skip to content

Commit 459a70b

Browse files
committed
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue
Tony Nguyen says: ==================== ice: one by one port representors creation Michal Swiatkowski says: Currently ice supports creating port representors only for VFs. For that use case they can be created and removed in one step. This patchset is refactoring current flow to support port representor creation also for subfunctions and SIOV. In this case port representors need to be created and removed one by one. Also, they can be added and removed while other port representors are running. To achieve that we need to change the switchdev configuration flow. Three first patches are only cosmetic (renaming, removing not used code). Next few ones are preparation for new flow. The most important one is "add VF representor one by one". It fully implements new flow. New type of port representor (for subfunction) will be introduced in follow up patchset. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: ice: reserve number of CP queues ice: adjust switchdev rebuild path ice: add VF representors one by one ice: realloc VSI stats arrays ice: set Tx topology every time new repr is added ice: allow changing SWITCHDEV_CTRL VSI queues ice: return pointer to representor ice: make representor code generic ice: remove VF pointer reference in eswitch code ice: track port representors in xarray ice: use repr instead of vf->repr ice: track q_id in representor ice: remove unused control VSI parameter ice: remove redundant max_vsi_num variable ice: rename switchdev to eswitch ==================== Link: https://lore.kernel.org/r/20231114181449.1290117-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents a49296e + 19b39ca commit 459a70b

File tree

14 files changed

+553
-422
lines changed

14 files changed

+553
-422
lines changed

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -522,11 +522,18 @@ enum ice_misc_thread_tasks {
522522
ICE_MISC_THREAD_NBITS /* must be last */
523523
};
524524

525-
struct ice_switchdev_info {
525+
struct ice_eswitch {
526526
struct ice_vsi *control_vsi;
527527
struct ice_vsi *uplink_vsi;
528528
struct ice_esw_br_offloads *br_offloads;
529+
struct xarray reprs;
529530
bool is_running;
531+
/* struct to allow cp queues management optimization */
532+
struct {
533+
int to_reach;
534+
int value;
535+
bool is_reaching;
536+
} qs;
530537
};
531538

532539
struct ice_agg_node {
@@ -637,7 +644,7 @@ struct ice_pf {
637644
struct ice_link_default_override_tlv link_dflt_override;
638645
struct ice_lag *lag; /* Link Aggregation information */
639646

640-
struct ice_switchdev_info switchdev;
647+
struct ice_eswitch eswitch;
641648
struct ice_esw_br_port *br_port;
642649

643650
#define ICE_INVALID_AGG_NODE_ID 0
@@ -846,7 +853,7 @@ static inline struct ice_vsi *ice_find_vsi(struct ice_pf *pf, u16 vsi_num)
846853
*/
847854
static inline bool ice_is_switchdev_running(struct ice_pf *pf)
848855
{
849-
return pf->switchdev.is_running;
856+
return pf->eswitch.is_running;
850857
}
851858

852859
#define ICE_FD_STAT_CTR_BLOCK_COUNT 256

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

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,10 @@ static void ice_traverse_tx_tree(struct devlink *devlink, struct ice_sched_node
810810
struct ice_vf *vf;
811811
int i;
812812

813+
if (node->rate_node)
814+
/* already added, skip to the next */
815+
goto traverse_children;
816+
813817
if (node->parent == tc_node) {
814818
/* create root node */
815819
rate_node = devl_rate_node_create(devlink, node, node->name, NULL);
@@ -831,6 +835,7 @@ static void ice_traverse_tx_tree(struct devlink *devlink, struct ice_sched_node
831835
if (rate_node && !IS_ERR(rate_node))
832836
node->rate_node = rate_node;
833837

838+
traverse_children:
834839
for (i = 0; i < node->num_children; i++)
835840
ice_traverse_tx_tree(devlink, node->children[i], tc_node, pf);
836841
}
@@ -861,6 +866,30 @@ int ice_devlink_rate_init_tx_topology(struct devlink *devlink, struct ice_vsi *v
861866
return 0;
862867
}
863868

869+
static void ice_clear_rate_nodes(struct ice_sched_node *node)
870+
{
871+
node->rate_node = NULL;
872+
873+
for (int i = 0; i < node->num_children; i++)
874+
ice_clear_rate_nodes(node->children[i]);
875+
}
876+
877+
/**
878+
* ice_devlink_rate_clear_tx_topology - clear node->rate_node
879+
* @vsi: main vsi struct
880+
*
881+
* Clear rate_node to cleanup creation of Tx topology.
882+
*
883+
*/
884+
void ice_devlink_rate_clear_tx_topology(struct ice_vsi *vsi)
885+
{
886+
struct ice_port_info *pi = vsi->port_info;
887+
888+
mutex_lock(&pi->sched_lock);
889+
ice_clear_rate_nodes(pi->root->children[0]);
890+
mutex_unlock(&pi->sched_lock);
891+
}
892+
864893
/**
865894
* ice_set_object_tx_share - sets node scheduling parameter
866895
* @pi: devlink struct instance

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ void ice_devlink_destroy_regions(struct ice_pf *pf);
2020

2121
int ice_devlink_rate_init_tx_topology(struct devlink *devlink, struct ice_vsi *vsi);
2222
void ice_tear_down_devlink_rate_tree(struct ice_pf *pf);
23+
void ice_devlink_rate_clear_tx_topology(struct ice_vsi *vsi);
2324

2425
#endif /* _ICE_DEVLINK_H_ */

0 commit comments

Comments
 (0)