Skip to content

Commit 8f88b30

Browse files
anambiarinJeff Kirsher
authored andcommitted
i40e: Add infrastructure for queue channel support
This patch sets up the infrastructure for offloading TCs and queue configurations to the hardware by creating HW channels(VSI). A new channel is created for each of the traffic class configuration offloaded via mqprio framework except for the first TC (TC0). TC0 for the main VSI is also reconfigured as per user provided queue parameters. Queue counts that are not power-of-2 are handled by reconfiguring RSS by reprogramming LUTs using the queue count value. This patch also handles configuring the TX rings for the channels, setting up the RX queue map for channel. Also, the channels so created are removed and all the queue configuration is set to default when the qdisc is detached from the root of the device. Signed-off-by: Amritha Nambiar <[email protected]> Signed-off-by: Kiran Patil <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent ff42418 commit 8f88b30

File tree

3 files changed

+743
-9
lines changed

3 files changed

+743
-9
lines changed

drivers/net/ethernet/intel/i40e/i40e.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
#define I40E_AQ_LEN 256
8888
#define I40E_AQ_WORK_LIMIT 66 /* max number of VFs + a little */
8989
#define I40E_MAX_USER_PRIORITY 8
90+
#define I40E_MAX_QUEUES_PER_CH 64
9091
#define I40E_DEFAULT_TRAFFIC_CLASS BIT(0)
9192
#define I40E_DEFAULT_MSG_ENABLE 4
9293
#define I40E_QUEUE_WAIT_RETRY_LIMIT 10
@@ -340,6 +341,23 @@ struct i40e_flex_pit {
340341
u8 pit_index;
341342
};
342343

344+
struct i40e_channel {
345+
struct list_head list;
346+
bool initialized;
347+
u8 type;
348+
u16 vsi_number; /* Assigned VSI number from AQ 'Add VSI' response */
349+
u16 stat_counter_idx;
350+
u16 base_queue;
351+
u16 num_queue_pairs; /* Requested by user */
352+
u16 seid;
353+
354+
u8 enabled_tc;
355+
struct i40e_aqc_vsi_properties_data info;
356+
357+
/* track this channel belongs to which VSI */
358+
struct i40e_vsi *parent_vsi;
359+
};
360+
343361
/* struct that defines the Ethernet device */
344362
struct i40e_pf {
345363
struct pci_dev *pdev;
@@ -456,6 +474,7 @@ struct i40e_pf {
456474
#define I40E_FLAG_CLIENT_RESET BIT(26)
457475
#define I40E_FLAG_LINK_DOWN_ON_CLOSE_ENABLED BIT(27)
458476
#define I40E_FLAG_SOURCE_PRUNING_DISABLED BIT(28)
477+
#define I40E_FLAG_TC_MQPRIO BIT(29)
459478

460479
struct i40e_client_instance *cinst;
461480
bool stat_offsets_loaded;
@@ -536,6 +555,8 @@ struct i40e_pf {
536555
u32 ioremap_len;
537556
u32 fd_inv;
538557
u16 phy_led_val;
558+
559+
u16 override_q_count;
539560
};
540561

541562
/**
@@ -700,6 +721,15 @@ struct i40e_vsi {
700721
bool current_isup; /* Sync 'link up' logging */
701722
enum i40e_aq_link_speed current_speed; /* Sync link speed logging */
702723

724+
/* channel specific fields */
725+
u16 cnt_q_avail; /* num of queues available for channel usage */
726+
u16 orig_rss_size;
727+
u16 current_rss_size;
728+
729+
u16 next_base_queue; /* next queue to be used for channel setup */
730+
731+
struct list_head ch_list;
732+
703733
void *priv; /* client driver data reference. */
704734

705735
/* VSI specific handlers */
@@ -1004,4 +1034,6 @@ static inline bool i40e_enabled_xdp_vsi(struct i40e_vsi *vsi)
10041034
{
10051035
return !!vsi->xdp_prog;
10061036
}
1037+
1038+
int i40e_create_queue_channel(struct i40e_vsi *vsi, struct i40e_channel *ch);
10071039
#endif /* _I40E_H_ */

0 commit comments

Comments
 (0)