mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-19 20:40:50 -05:00
Merge branch '200GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue
Tony Nguyen says: ==================== refactor IDPF resource access Pavan Kumar Linga says: Queue and vector resources for a given vport, are stored in the idpf_vport structure. At the time of configuration, these resources are accessed using vport pointer. Meaning, all the config path functions are tied to the default queue and vector resources of the vport. There are use cases which can make use of config path functions to configure queue and vector resources that are not tied to any vport. One such use case is PTP secondary mailbox creation (it would be in a followup series). To configure queue and interrupt resources for such cases, we can make use of the existing config infrastructure by passing the necessary queue and vector resources info. To achieve this, group the existing queue and vector resources into default resource group and refactor the code to pass the resource pointer to the config path functions. This series also includes patches which generalizes the send virtchnl message APIs and mailbox API that are necessary for the implementation of PTP secondary mailbox. * '200GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: idpf: generalize mailbox API idpf: avoid calling get_rx_ptypes for each vport idpf: generalize send virtchnl message API idpf: remove vport pointer from queue sets idpf: add rss_data field to RSS function parameters idpf: reshuffle idpf_vport struct members to avoid holes idpf: move some iterator declarations inside for loops idpf: move queue resources to idpf_q_vec_rsrc structure idpf: introduce idpf_q_vec_rsrc struct and move vector resources to it idpf: introduce local idpf structure to store virtchnl queue chunks ==================== Link: https://patch.msgid.link/20260122223601.2208759-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
struct idpf_adapter;
|
||||
struct idpf_vport;
|
||||
struct idpf_vport_max_q;
|
||||
struct idpf_q_vec_rsrc;
|
||||
struct idpf_rss_data;
|
||||
|
||||
#include <net/pkt_sched.h>
|
||||
#include <linux/aer.h>
|
||||
@@ -201,7 +203,8 @@ struct idpf_vport_max_q {
|
||||
struct idpf_reg_ops {
|
||||
void (*ctlq_reg_init)(struct idpf_adapter *adapter,
|
||||
struct idpf_ctlq_create_info *cq);
|
||||
int (*intr_reg_init)(struct idpf_vport *vport);
|
||||
int (*intr_reg_init)(struct idpf_vport *vport,
|
||||
struct idpf_q_vec_rsrc *rsrc);
|
||||
void (*mb_intr_reg_init)(struct idpf_adapter *adapter);
|
||||
void (*reset_reg_init)(struct idpf_adapter *adapter);
|
||||
void (*trigger_reset)(struct idpf_adapter *adapter,
|
||||
@@ -288,54 +291,88 @@ struct idpf_fsteer_fltr {
|
||||
};
|
||||
|
||||
/**
|
||||
* struct idpf_vport - Handle for netdevices and queue resources
|
||||
* @num_txq: Number of allocated TX queues
|
||||
* @num_complq: Number of allocated completion queues
|
||||
* struct idpf_q_vec_rsrc - handle for queue and vector resources
|
||||
* @dev: device pointer for DMA mapping
|
||||
* @q_vectors: array of queue vectors
|
||||
* @q_vector_idxs: starting index of queue vectors
|
||||
* @num_q_vectors: number of IRQ vectors allocated
|
||||
* @noirq_v_idx: ID of the NOIRQ vector
|
||||
* @noirq_dyn_ctl_ena: value to write to the above to enable it
|
||||
* @noirq_dyn_ctl: register to enable/disable the vector for NOIRQ queues
|
||||
* @txq_grps: array of TX queue groups
|
||||
* @txq_desc_count: TX queue descriptor count
|
||||
* @complq_desc_count: Completion queue descriptor count
|
||||
* @compln_clean_budget: Work budget for completion clean
|
||||
* @num_txq_grp: Number of TX queue groups
|
||||
* @txq_grps: Array of TX queue groups
|
||||
* @txq_model: Split queue or single queue queuing model
|
||||
* @txqs: Used only in hotpath to get to the right queue very fast
|
||||
* @crc_enable: Enable CRC insertion offload
|
||||
* @xdpsq_share: whether XDPSQ sharing is enabled
|
||||
* @num_xdp_txq: number of XDPSQs
|
||||
* @complq_desc_count: completion queue descriptor count
|
||||
* @txq_model: split queue or single queue queuing model
|
||||
* @num_txq: number of allocated TX queues
|
||||
* @num_complq: number of allocated completion queues
|
||||
* @num_txq_grp: number of TX queue groups
|
||||
* @xdp_txq_offset: index of the first XDPSQ (== number of regular SQs)
|
||||
* @xdp_prog: installed XDP program
|
||||
* @num_rxq: Number of allocated RX queues
|
||||
* @num_bufq: Number of allocated buffer queues
|
||||
* @num_rxq_grp: number of RX queues in a group
|
||||
* @rxq_model: splitq queue or single queue queuing model
|
||||
* @rxq_grps: total number of RX groups. Number of groups * number of RX per
|
||||
* group will yield total number of RX queues.
|
||||
* @num_rxq: number of allocated RX queues
|
||||
* @num_bufq: number of allocated buffer queues
|
||||
* @rxq_desc_count: RX queue descriptor count. *MUST* have enough descriptors
|
||||
* to complete all buffer descriptors for all buffer queues in
|
||||
* the worst case.
|
||||
* @num_bufqs_per_qgrp: Buffer queues per RX queue in a given grouping
|
||||
* @bufq_desc_count: Buffer queue descriptor count
|
||||
* @num_rxq_grp: Number of RX queues in a group
|
||||
* @rxq_grps: Total number of RX groups. Number of groups * number of RX per
|
||||
* group will yield total number of RX queues.
|
||||
* @rxq_model: Splitq queue or single queue queuing model
|
||||
* @rx_ptype_lkup: Lookup table for ptypes on RX
|
||||
* @bufq_desc_count: buffer queue descriptor count
|
||||
* @num_bufqs_per_qgrp: buffer queues per RX queue in a given grouping
|
||||
* @base_rxd: true if the driver should use base descriptors instead of flex
|
||||
*/
|
||||
struct idpf_q_vec_rsrc {
|
||||
struct device *dev;
|
||||
struct idpf_q_vector *q_vectors;
|
||||
u16 *q_vector_idxs;
|
||||
u16 num_q_vectors;
|
||||
u16 noirq_v_idx;
|
||||
u32 noirq_dyn_ctl_ena;
|
||||
void __iomem *noirq_dyn_ctl;
|
||||
|
||||
struct idpf_txq_group *txq_grps;
|
||||
u32 txq_desc_count;
|
||||
u32 complq_desc_count;
|
||||
u32 txq_model;
|
||||
u16 num_txq;
|
||||
u16 num_complq;
|
||||
u16 num_txq_grp;
|
||||
u16 xdp_txq_offset;
|
||||
|
||||
u16 num_rxq_grp;
|
||||
u32 rxq_model;
|
||||
struct idpf_rxq_group *rxq_grps;
|
||||
u16 num_rxq;
|
||||
u16 num_bufq;
|
||||
u32 rxq_desc_count;
|
||||
u32 bufq_desc_count[IDPF_MAX_BUFQS_PER_RXQ_GRP];
|
||||
u8 num_bufqs_per_qgrp;
|
||||
bool base_rxd;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct idpf_vport - Handle for netdevices and queue resources
|
||||
* @dflt_qv_rsrc: contains default queue and vector resources
|
||||
* @txqs: Used only in hotpath to get to the right queue very fast
|
||||
* @num_txq: Number of allocated TX queues
|
||||
* @num_xdp_txq: number of XDPSQs
|
||||
* @xdpsq_share: whether XDPSQ sharing is enabled
|
||||
* @xdp_prog: installed XDP program
|
||||
* @vdev_info: IDC vport device info pointer
|
||||
* @adapter: back pointer to associated adapter
|
||||
* @netdev: Associated net_device. Each vport should have one and only one
|
||||
* associated netdev.
|
||||
* @flags: See enum idpf_vport_flags
|
||||
* @vport_type: Default SRIOV, SIOV, etc.
|
||||
* @compln_clean_budget: Work budget for completion clean
|
||||
* @vport_id: Device given vport identifier
|
||||
* @vport_type: Default SRIOV, SIOV, etc.
|
||||
* @idx: Software index in adapter vports struct
|
||||
* @default_vport: Use this vport if one isn't specified
|
||||
* @base_rxd: True if the driver should use base descriptors instead of flex
|
||||
* @num_q_vectors: Number of IRQ vectors allocated
|
||||
* @q_vectors: Array of queue vectors
|
||||
* @q_vector_idxs: Starting index of queue vectors
|
||||
* @noirq_dyn_ctl: register to enable/disable the vector for NOIRQ queues
|
||||
* @noirq_dyn_ctl_ena: value to write to the above to enable it
|
||||
* @noirq_v_idx: ID of the NOIRQ vector
|
||||
* @max_mtu: device given max possible MTU
|
||||
* @default_mac_addr: device will give a default MAC to use
|
||||
* @rx_itr_profile: RX profiles for Dynamic Interrupt Moderation
|
||||
* @tx_itr_profile: TX profiles for Dynamic Interrupt Moderation
|
||||
* @port_stats: per port csum, header split, and other offload stats
|
||||
* @default_vport: Use this vport if one isn't specified
|
||||
* @crc_enable: Enable CRC insertion offload
|
||||
* @link_up: True if link is up
|
||||
* @tx_tstamp_caps: Capabilities negotiated for Tx timestamping
|
||||
* @tstamp_config: The Tx tstamp config
|
||||
@@ -343,57 +380,31 @@ struct idpf_fsteer_fltr {
|
||||
* @tstamp_stats: Tx timestamping statistics
|
||||
*/
|
||||
struct idpf_vport {
|
||||
u16 num_txq;
|
||||
u16 num_complq;
|
||||
u32 txq_desc_count;
|
||||
u32 complq_desc_count;
|
||||
u32 compln_clean_budget;
|
||||
u16 num_txq_grp;
|
||||
struct idpf_txq_group *txq_grps;
|
||||
u32 txq_model;
|
||||
struct idpf_q_vec_rsrc dflt_qv_rsrc;
|
||||
struct idpf_tx_queue **txqs;
|
||||
bool crc_enable;
|
||||
|
||||
bool xdpsq_share;
|
||||
u16 num_txq;
|
||||
u16 num_xdp_txq;
|
||||
u16 xdp_txq_offset;
|
||||
bool xdpsq_share;
|
||||
struct bpf_prog *xdp_prog;
|
||||
|
||||
u16 num_rxq;
|
||||
u16 num_bufq;
|
||||
u32 rxq_desc_count;
|
||||
u8 num_bufqs_per_qgrp;
|
||||
u32 bufq_desc_count[IDPF_MAX_BUFQS_PER_RXQ_GRP];
|
||||
u16 num_rxq_grp;
|
||||
struct idpf_rxq_group *rxq_grps;
|
||||
u32 rxq_model;
|
||||
struct libeth_rx_pt *rx_ptype_lkup;
|
||||
|
||||
struct iidc_rdma_vport_dev_info *vdev_info;
|
||||
|
||||
struct idpf_adapter *adapter;
|
||||
struct net_device *netdev;
|
||||
DECLARE_BITMAP(flags, IDPF_VPORT_FLAGS_NBITS);
|
||||
u16 vport_type;
|
||||
u32 compln_clean_budget;
|
||||
u32 vport_id;
|
||||
u16 vport_type;
|
||||
u16 idx;
|
||||
bool default_vport;
|
||||
bool base_rxd;
|
||||
|
||||
u16 num_q_vectors;
|
||||
struct idpf_q_vector *q_vectors;
|
||||
u16 *q_vector_idxs;
|
||||
|
||||
void __iomem *noirq_dyn_ctl;
|
||||
u32 noirq_dyn_ctl_ena;
|
||||
u16 noirq_v_idx;
|
||||
|
||||
u16 max_mtu;
|
||||
u8 default_mac_addr[ETH_ALEN];
|
||||
u16 rx_itr_profile[IDPF_DIM_PROFILE_SLOTS];
|
||||
u16 tx_itr_profile[IDPF_DIM_PROFILE_SLOTS];
|
||||
struct idpf_port_stats port_stats;
|
||||
|
||||
struct idpf_port_stats port_stats;
|
||||
bool default_vport;
|
||||
bool crc_enable;
|
||||
bool link_up;
|
||||
|
||||
struct idpf_ptp_vport_tx_tstamp_caps *tx_tstamp_caps;
|
||||
@@ -549,11 +560,38 @@ struct idpf_vector_lifo {
|
||||
u16 *vec_idx;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct idpf_queue_id_reg_chunk - individual queue ID and register chunk
|
||||
* @qtail_reg_start: queue tail register offset
|
||||
* @qtail_reg_spacing: queue tail register spacing
|
||||
* @type: queue type of the queues in the chunk
|
||||
* @start_queue_id: starting queue ID in the chunk
|
||||
* @num_queues: number of queues in the chunk
|
||||
*/
|
||||
struct idpf_queue_id_reg_chunk {
|
||||
u64 qtail_reg_start;
|
||||
u32 qtail_reg_spacing;
|
||||
u32 type;
|
||||
u32 start_queue_id;
|
||||
u32 num_queues;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct idpf_queue_id_reg_info - queue ID and register chunk info received
|
||||
* over the mailbox
|
||||
* @num_chunks: number of chunks
|
||||
* @queue_chunks: array of chunks
|
||||
*/
|
||||
struct idpf_queue_id_reg_info {
|
||||
u16 num_chunks;
|
||||
struct idpf_queue_id_reg_chunk *queue_chunks;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct idpf_vport_config - Vport configuration data
|
||||
* @user_config: see struct idpf_vport_user_config_data
|
||||
* @max_q: Maximum possible queues
|
||||
* @req_qs_chunks: Queue chunk data for requested queues
|
||||
* @qid_reg_info: Struct to store the queue ID and register info
|
||||
* @mac_filter_list_lock: Lock to protect mac filters
|
||||
* @flow_steer_list_lock: Lock to protect fsteer filters
|
||||
* @flags: See enum idpf_vport_config_flags
|
||||
@@ -561,7 +599,7 @@ struct idpf_vector_lifo {
|
||||
struct idpf_vport_config {
|
||||
struct idpf_vport_user_config_data user_config;
|
||||
struct idpf_vport_max_q max_q;
|
||||
struct virtchnl2_add_queues *req_qs_chunks;
|
||||
struct idpf_queue_id_reg_info qid_reg_info;
|
||||
spinlock_t mac_filter_list_lock;
|
||||
spinlock_t flow_steer_list_lock;
|
||||
DECLARE_BITMAP(flags, IDPF_VPORT_CONFIG_FLAGS_NBITS);
|
||||
@@ -603,6 +641,8 @@ struct idpf_vc_xn_manager;
|
||||
* @vport_params_reqd: Vport params requested
|
||||
* @vport_params_recvd: Vport params received
|
||||
* @vport_ids: Array of device given vport identifiers
|
||||
* @singleq_pt_lkup: Lookup table for singleq RX ptypes
|
||||
* @splitq_pt_lkup: Lookup table for splitq RX ptypes
|
||||
* @vport_config: Vport config parameters
|
||||
* @max_vports: Maximum vports that can be allocated
|
||||
* @num_alloc_vports: Current number of vports allocated
|
||||
@@ -661,6 +701,9 @@ struct idpf_adapter {
|
||||
struct virtchnl2_create_vport **vport_params_recvd;
|
||||
u32 *vport_ids;
|
||||
|
||||
struct libeth_rx_pt *singleq_pt_lkup;
|
||||
struct libeth_rx_pt *splitq_pt_lkup;
|
||||
|
||||
struct idpf_vport_config **vport_config;
|
||||
u16 max_vports;
|
||||
u16 num_alloc_vports;
|
||||
|
||||
@@ -70,11 +70,13 @@ static void idpf_mb_intr_reg_init(struct idpf_adapter *adapter)
|
||||
/**
|
||||
* idpf_intr_reg_init - Initialize interrupt registers
|
||||
* @vport: virtual port structure
|
||||
* @rsrc: pointer to queue and vector resources
|
||||
*/
|
||||
static int idpf_intr_reg_init(struct idpf_vport *vport)
|
||||
static int idpf_intr_reg_init(struct idpf_vport *vport,
|
||||
struct idpf_q_vec_rsrc *rsrc)
|
||||
{
|
||||
struct idpf_adapter *adapter = vport->adapter;
|
||||
int num_vecs = vport->num_q_vectors;
|
||||
u16 num_vecs = rsrc->num_q_vectors;
|
||||
struct idpf_vec_regs *reg_vals;
|
||||
int num_regs, i, err = 0;
|
||||
u32 rx_itr, tx_itr, val;
|
||||
@@ -86,15 +88,15 @@ static int idpf_intr_reg_init(struct idpf_vport *vport)
|
||||
if (!reg_vals)
|
||||
return -ENOMEM;
|
||||
|
||||
num_regs = idpf_get_reg_intr_vecs(vport, reg_vals);
|
||||
num_regs = idpf_get_reg_intr_vecs(adapter, reg_vals);
|
||||
if (num_regs < num_vecs) {
|
||||
err = -EINVAL;
|
||||
goto free_reg_vals;
|
||||
}
|
||||
|
||||
for (i = 0; i < num_vecs; i++) {
|
||||
struct idpf_q_vector *q_vector = &vport->q_vectors[i];
|
||||
u16 vec_id = vport->q_vector_idxs[i] - IDPF_MBX_Q_VEC;
|
||||
struct idpf_q_vector *q_vector = &rsrc->q_vectors[i];
|
||||
u16 vec_id = rsrc->q_vector_idxs[i] - IDPF_MBX_Q_VEC;
|
||||
struct idpf_intr_reg *intr = &q_vector->intr_reg;
|
||||
u32 spacing;
|
||||
|
||||
@@ -123,12 +125,12 @@ static int idpf_intr_reg_init(struct idpf_vport *vport)
|
||||
|
||||
/* Data vector for NOIRQ queues */
|
||||
|
||||
val = reg_vals[vport->q_vector_idxs[i] - IDPF_MBX_Q_VEC].dyn_ctl_reg;
|
||||
vport->noirq_dyn_ctl = idpf_get_reg_addr(adapter, val);
|
||||
val = reg_vals[rsrc->q_vector_idxs[i] - IDPF_MBX_Q_VEC].dyn_ctl_reg;
|
||||
rsrc->noirq_dyn_ctl = idpf_get_reg_addr(adapter, val);
|
||||
|
||||
val = PF_GLINT_DYN_CTL_WB_ON_ITR_M | PF_GLINT_DYN_CTL_INTENA_MSK_M |
|
||||
FIELD_PREP(PF_GLINT_DYN_CTL_ITR_INDX_M, IDPF_NO_ITR_UPDATE_IDX);
|
||||
vport->noirq_dyn_ctl_ena = val;
|
||||
rsrc->noirq_dyn_ctl_ena = val;
|
||||
|
||||
free_reg_vals:
|
||||
kfree(reg_vals);
|
||||
|
||||
@@ -18,7 +18,7 @@ static u32 idpf_get_rx_ring_count(struct net_device *netdev)
|
||||
|
||||
idpf_vport_ctrl_lock(netdev);
|
||||
vport = idpf_netdev_to_vport(netdev);
|
||||
num_rxq = vport->num_rxq;
|
||||
num_rxq = vport->dflt_qv_rsrc.num_rxq;
|
||||
idpf_vport_ctrl_unlock(netdev);
|
||||
|
||||
return num_rxq;
|
||||
@@ -503,7 +503,7 @@ static int idpf_set_rxfh(struct net_device *netdev,
|
||||
}
|
||||
|
||||
if (test_bit(IDPF_VPORT_UP, np->state))
|
||||
err = idpf_config_rss(vport);
|
||||
err = idpf_config_rss(vport, rss_data);
|
||||
|
||||
unlock_mutex:
|
||||
idpf_vport_ctrl_unlock(netdev);
|
||||
@@ -644,8 +644,8 @@ static void idpf_get_ringparam(struct net_device *netdev,
|
||||
|
||||
ring->rx_max_pending = IDPF_MAX_RXQ_DESC;
|
||||
ring->tx_max_pending = IDPF_MAX_TXQ_DESC;
|
||||
ring->rx_pending = vport->rxq_desc_count;
|
||||
ring->tx_pending = vport->txq_desc_count;
|
||||
ring->rx_pending = vport->dflt_qv_rsrc.rxq_desc_count;
|
||||
ring->tx_pending = vport->dflt_qv_rsrc.txq_desc_count;
|
||||
|
||||
kring->tcp_data_split = idpf_vport_get_hsplit(vport);
|
||||
|
||||
@@ -669,8 +669,9 @@ static int idpf_set_ringparam(struct net_device *netdev,
|
||||
{
|
||||
struct idpf_vport_user_config_data *config_data;
|
||||
u32 new_rx_count, new_tx_count;
|
||||
struct idpf_q_vec_rsrc *rsrc;
|
||||
struct idpf_vport *vport;
|
||||
int i, err = 0;
|
||||
int err = 0;
|
||||
u16 idx;
|
||||
|
||||
idpf_vport_ctrl_lock(netdev);
|
||||
@@ -704,8 +705,9 @@ static int idpf_set_ringparam(struct net_device *netdev,
|
||||
netdev_info(netdev, "Requested Tx descriptor count rounded up to %u\n",
|
||||
new_tx_count);
|
||||
|
||||
if (new_tx_count == vport->txq_desc_count &&
|
||||
new_rx_count == vport->rxq_desc_count &&
|
||||
rsrc = &vport->dflt_qv_rsrc;
|
||||
if (new_tx_count == rsrc->txq_desc_count &&
|
||||
new_rx_count == rsrc->rxq_desc_count &&
|
||||
kring->tcp_data_split == idpf_vport_get_hsplit(vport))
|
||||
goto unlock_mutex;
|
||||
|
||||
@@ -724,10 +726,10 @@ static int idpf_set_ringparam(struct net_device *netdev,
|
||||
/* Since we adjusted the RX completion queue count, the RX buffer queue
|
||||
* descriptor count needs to be adjusted as well
|
||||
*/
|
||||
for (i = 0; i < vport->num_bufqs_per_qgrp; i++)
|
||||
vport->bufq_desc_count[i] =
|
||||
for (unsigned int i = 0; i < rsrc->num_bufqs_per_qgrp; i++)
|
||||
rsrc->bufq_desc_count[i] =
|
||||
IDPF_RX_BUFQ_DESC_COUNT(new_rx_count,
|
||||
vport->num_bufqs_per_qgrp);
|
||||
rsrc->num_bufqs_per_qgrp);
|
||||
|
||||
err = idpf_initiate_soft_reset(vport, IDPF_SR_Q_DESC_CHANGE);
|
||||
|
||||
@@ -1104,7 +1106,7 @@ static void idpf_add_port_stats(struct idpf_vport *vport, u64 **data)
|
||||
static void idpf_collect_queue_stats(struct idpf_vport *vport)
|
||||
{
|
||||
struct idpf_port_stats *pstats = &vport->port_stats;
|
||||
int i, j;
|
||||
struct idpf_q_vec_rsrc *rsrc = &vport->dflt_qv_rsrc;
|
||||
|
||||
/* zero out port stats since they're actually tracked in per
|
||||
* queue stats; this is only for reporting
|
||||
@@ -1120,22 +1122,22 @@ static void idpf_collect_queue_stats(struct idpf_vport *vport)
|
||||
u64_stats_set(&pstats->tx_dma_map_errs, 0);
|
||||
u64_stats_update_end(&pstats->stats_sync);
|
||||
|
||||
for (i = 0; i < vport->num_rxq_grp; i++) {
|
||||
struct idpf_rxq_group *rxq_grp = &vport->rxq_grps[i];
|
||||
for (unsigned int i = 0; i < rsrc->num_rxq_grp; i++) {
|
||||
struct idpf_rxq_group *rxq_grp = &rsrc->rxq_grps[i];
|
||||
u16 num_rxq;
|
||||
|
||||
if (idpf_is_queue_model_split(vport->rxq_model))
|
||||
if (idpf_is_queue_model_split(rsrc->rxq_model))
|
||||
num_rxq = rxq_grp->splitq.num_rxq_sets;
|
||||
else
|
||||
num_rxq = rxq_grp->singleq.num_rxq;
|
||||
|
||||
for (j = 0; j < num_rxq; j++) {
|
||||
for (unsigned int j = 0; j < num_rxq; j++) {
|
||||
u64 hw_csum_err, hsplit, hsplit_hbo, bad_descs;
|
||||
struct idpf_rx_queue_stats *stats;
|
||||
struct idpf_rx_queue *rxq;
|
||||
unsigned int start;
|
||||
|
||||
if (idpf_is_queue_model_split(vport->rxq_model))
|
||||
if (idpf_is_queue_model_split(rsrc->rxq_model))
|
||||
rxq = &rxq_grp->splitq.rxq_sets[j]->rxq;
|
||||
else
|
||||
rxq = rxq_grp->singleq.rxqs[j];
|
||||
@@ -1162,10 +1164,10 @@ static void idpf_collect_queue_stats(struct idpf_vport *vport)
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < vport->num_txq_grp; i++) {
|
||||
struct idpf_txq_group *txq_grp = &vport->txq_grps[i];
|
||||
for (unsigned int i = 0; i < rsrc->num_txq_grp; i++) {
|
||||
struct idpf_txq_group *txq_grp = &rsrc->txq_grps[i];
|
||||
|
||||
for (j = 0; j < txq_grp->num_txq; j++) {
|
||||
for (unsigned int j = 0; j < txq_grp->num_txq; j++) {
|
||||
u64 linearize, qbusy, skb_drops, dma_map_errs;
|
||||
struct idpf_tx_queue *txq = txq_grp->txqs[j];
|
||||
struct idpf_tx_queue_stats *stats;
|
||||
@@ -1208,9 +1210,9 @@ static void idpf_get_ethtool_stats(struct net_device *netdev,
|
||||
{
|
||||
struct idpf_netdev_priv *np = netdev_priv(netdev);
|
||||
struct idpf_vport_config *vport_config;
|
||||
struct idpf_q_vec_rsrc *rsrc;
|
||||
struct idpf_vport *vport;
|
||||
unsigned int total = 0;
|
||||
unsigned int i, j;
|
||||
bool is_splitq;
|
||||
u16 qtype;
|
||||
|
||||
@@ -1228,12 +1230,13 @@ static void idpf_get_ethtool_stats(struct net_device *netdev,
|
||||
idpf_collect_queue_stats(vport);
|
||||
idpf_add_port_stats(vport, &data);
|
||||
|
||||
for (i = 0; i < vport->num_txq_grp; i++) {
|
||||
struct idpf_txq_group *txq_grp = &vport->txq_grps[i];
|
||||
rsrc = &vport->dflt_qv_rsrc;
|
||||
for (unsigned int i = 0; i < rsrc->num_txq_grp; i++) {
|
||||
struct idpf_txq_group *txq_grp = &rsrc->txq_grps[i];
|
||||
|
||||
qtype = VIRTCHNL2_QUEUE_TYPE_TX;
|
||||
|
||||
for (j = 0; j < txq_grp->num_txq; j++, total++) {
|
||||
for (unsigned int j = 0; j < txq_grp->num_txq; j++, total++) {
|
||||
struct idpf_tx_queue *txq = txq_grp->txqs[j];
|
||||
|
||||
if (!txq)
|
||||
@@ -1253,10 +1256,10 @@ static void idpf_get_ethtool_stats(struct net_device *netdev,
|
||||
idpf_add_empty_queue_stats(&data, VIRTCHNL2_QUEUE_TYPE_TX);
|
||||
total = 0;
|
||||
|
||||
is_splitq = idpf_is_queue_model_split(vport->rxq_model);
|
||||
is_splitq = idpf_is_queue_model_split(rsrc->rxq_model);
|
||||
|
||||
for (i = 0; i < vport->num_rxq_grp; i++) {
|
||||
struct idpf_rxq_group *rxq_grp = &vport->rxq_grps[i];
|
||||
for (unsigned int i = 0; i < rsrc->num_rxq_grp; i++) {
|
||||
struct idpf_rxq_group *rxq_grp = &rsrc->rxq_grps[i];
|
||||
u16 num_rxq;
|
||||
|
||||
qtype = VIRTCHNL2_QUEUE_TYPE_RX;
|
||||
@@ -1266,7 +1269,7 @@ static void idpf_get_ethtool_stats(struct net_device *netdev,
|
||||
else
|
||||
num_rxq = rxq_grp->singleq.num_rxq;
|
||||
|
||||
for (j = 0; j < num_rxq; j++, total++) {
|
||||
for (unsigned int j = 0; j < num_rxq; j++, total++) {
|
||||
struct idpf_rx_queue *rxq;
|
||||
|
||||
if (is_splitq)
|
||||
@@ -1298,15 +1301,16 @@ static void idpf_get_ethtool_stats(struct net_device *netdev,
|
||||
struct idpf_q_vector *idpf_find_rxq_vec(const struct idpf_vport *vport,
|
||||
u32 q_num)
|
||||
{
|
||||
const struct idpf_q_vec_rsrc *rsrc = &vport->dflt_qv_rsrc;
|
||||
int q_grp, q_idx;
|
||||
|
||||
if (!idpf_is_queue_model_split(vport->rxq_model))
|
||||
return vport->rxq_grps->singleq.rxqs[q_num]->q_vector;
|
||||
if (!idpf_is_queue_model_split(rsrc->rxq_model))
|
||||
return rsrc->rxq_grps->singleq.rxqs[q_num]->q_vector;
|
||||
|
||||
q_grp = q_num / IDPF_DFLT_SPLITQ_RXQ_PER_GROUP;
|
||||
q_idx = q_num % IDPF_DFLT_SPLITQ_RXQ_PER_GROUP;
|
||||
|
||||
return vport->rxq_grps[q_grp].splitq.rxq_sets[q_idx]->rxq.q_vector;
|
||||
return rsrc->rxq_grps[q_grp].splitq.rxq_sets[q_idx]->rxq.q_vector;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1319,14 +1323,15 @@ struct idpf_q_vector *idpf_find_rxq_vec(const struct idpf_vport *vport,
|
||||
struct idpf_q_vector *idpf_find_txq_vec(const struct idpf_vport *vport,
|
||||
u32 q_num)
|
||||
{
|
||||
const struct idpf_q_vec_rsrc *rsrc = &vport->dflt_qv_rsrc;
|
||||
int q_grp;
|
||||
|
||||
if (!idpf_is_queue_model_split(vport->txq_model))
|
||||
if (!idpf_is_queue_model_split(rsrc->txq_model))
|
||||
return vport->txqs[q_num]->q_vector;
|
||||
|
||||
q_grp = q_num / IDPF_DFLT_SPLITQ_TXQ_PER_GROUP;
|
||||
|
||||
return vport->txq_grps[q_grp].complq->q_vector;
|
||||
return rsrc->txq_grps[q_grp].complq->q_vector;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1363,7 +1368,8 @@ static int idpf_get_q_coalesce(struct net_device *netdev,
|
||||
u32 q_num)
|
||||
{
|
||||
const struct idpf_netdev_priv *np = netdev_priv(netdev);
|
||||
const struct idpf_vport *vport;
|
||||
struct idpf_q_vec_rsrc *rsrc;
|
||||
struct idpf_vport *vport;
|
||||
int err = 0;
|
||||
|
||||
idpf_vport_ctrl_lock(netdev);
|
||||
@@ -1372,16 +1378,17 @@ static int idpf_get_q_coalesce(struct net_device *netdev,
|
||||
if (!test_bit(IDPF_VPORT_UP, np->state))
|
||||
goto unlock_mutex;
|
||||
|
||||
if (q_num >= vport->num_rxq && q_num >= vport->num_txq) {
|
||||
rsrc = &vport->dflt_qv_rsrc;
|
||||
if (q_num >= rsrc->num_rxq && q_num >= rsrc->num_txq) {
|
||||
err = -EINVAL;
|
||||
goto unlock_mutex;
|
||||
}
|
||||
|
||||
if (q_num < vport->num_rxq)
|
||||
if (q_num < rsrc->num_rxq)
|
||||
__idpf_get_q_coalesce(ec, idpf_find_rxq_vec(vport, q_num),
|
||||
VIRTCHNL2_QUEUE_TYPE_RX);
|
||||
|
||||
if (q_num < vport->num_txq)
|
||||
if (q_num < rsrc->num_txq)
|
||||
__idpf_get_q_coalesce(ec, idpf_find_txq_vec(vport, q_num),
|
||||
VIRTCHNL2_QUEUE_TYPE_TX);
|
||||
|
||||
@@ -1549,8 +1556,9 @@ static int idpf_set_coalesce(struct net_device *netdev,
|
||||
struct idpf_netdev_priv *np = netdev_priv(netdev);
|
||||
struct idpf_vport_user_config_data *user_config;
|
||||
struct idpf_q_coalesce *q_coal;
|
||||
struct idpf_q_vec_rsrc *rsrc;
|
||||
struct idpf_vport *vport;
|
||||
int i, err = 0;
|
||||
int err = 0;
|
||||
|
||||
user_config = &np->adapter->vport_config[np->vport_idx]->user_config;
|
||||
|
||||
@@ -1560,14 +1568,15 @@ static int idpf_set_coalesce(struct net_device *netdev,
|
||||
if (!test_bit(IDPF_VPORT_UP, np->state))
|
||||
goto unlock_mutex;
|
||||
|
||||
for (i = 0; i < vport->num_txq; i++) {
|
||||
rsrc = &vport->dflt_qv_rsrc;
|
||||
for (unsigned int i = 0; i < rsrc->num_txq; i++) {
|
||||
q_coal = &user_config->q_coalesce[i];
|
||||
err = idpf_set_q_coalesce(vport, q_coal, ec, i, false);
|
||||
if (err)
|
||||
goto unlock_mutex;
|
||||
}
|
||||
|
||||
for (i = 0; i < vport->num_rxq; i++) {
|
||||
for (unsigned int i = 0; i < rsrc->num_rxq; i++) {
|
||||
q_coal = &user_config->q_coalesce[i];
|
||||
err = idpf_set_q_coalesce(vport, q_coal, ec, i, true);
|
||||
if (err)
|
||||
@@ -1748,6 +1757,7 @@ static void idpf_get_ts_stats(struct net_device *netdev,
|
||||
struct ethtool_ts_stats *ts_stats)
|
||||
{
|
||||
struct idpf_netdev_priv *np = netdev_priv(netdev);
|
||||
struct idpf_q_vec_rsrc *rsrc;
|
||||
struct idpf_vport *vport;
|
||||
unsigned int start;
|
||||
|
||||
@@ -1763,8 +1773,9 @@ static void idpf_get_ts_stats(struct net_device *netdev,
|
||||
if (!test_bit(IDPF_VPORT_UP, np->state))
|
||||
goto exit;
|
||||
|
||||
for (u16 i = 0; i < vport->num_txq_grp; i++) {
|
||||
struct idpf_txq_group *txq_grp = &vport->txq_grps[i];
|
||||
rsrc = &vport->dflt_qv_rsrc;
|
||||
for (u16 i = 0; i < rsrc->num_txq_grp; i++) {
|
||||
struct idpf_txq_group *txq_grp = &rsrc->txq_grps[i];
|
||||
|
||||
for (u16 j = 0; j < txq_grp->num_txq; j++) {
|
||||
struct idpf_tx_queue *txq = txq_grp->txqs[j];
|
||||
|
||||
@@ -545,7 +545,9 @@ static int idpf_del_mac_filter(struct idpf_vport *vport,
|
||||
if (test_bit(IDPF_VPORT_UP, np->state)) {
|
||||
int err;
|
||||
|
||||
err = idpf_add_del_mac_filters(vport, np, false, async);
|
||||
err = idpf_add_del_mac_filters(np->adapter, vport_config,
|
||||
vport->default_mac_addr,
|
||||
np->vport_id, false, async);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
@@ -614,7 +616,9 @@ static int idpf_add_mac_filter(struct idpf_vport *vport,
|
||||
return err;
|
||||
|
||||
if (test_bit(IDPF_VPORT_UP, np->state))
|
||||
err = idpf_add_del_mac_filters(vport, np, true, async);
|
||||
err = idpf_add_del_mac_filters(np->adapter, vport_config,
|
||||
vport->default_mac_addr,
|
||||
np->vport_id, true, async);
|
||||
|
||||
return err;
|
||||
}
|
||||
@@ -662,7 +666,8 @@ static void idpf_restore_mac_filters(struct idpf_vport *vport)
|
||||
|
||||
spin_unlock_bh(&vport_config->mac_filter_list_lock);
|
||||
|
||||
idpf_add_del_mac_filters(vport, netdev_priv(vport->netdev),
|
||||
idpf_add_del_mac_filters(vport->adapter, vport_config,
|
||||
vport->default_mac_addr, vport->vport_id,
|
||||
true, false);
|
||||
}
|
||||
|
||||
@@ -686,7 +691,8 @@ static void idpf_remove_mac_filters(struct idpf_vport *vport)
|
||||
|
||||
spin_unlock_bh(&vport_config->mac_filter_list_lock);
|
||||
|
||||
idpf_add_del_mac_filters(vport, netdev_priv(vport->netdev),
|
||||
idpf_add_del_mac_filters(vport->adapter, vport_config,
|
||||
vport->default_mac_addr, vport->vport_id,
|
||||
false, false);
|
||||
}
|
||||
|
||||
@@ -975,6 +981,10 @@ static void idpf_remove_features(struct idpf_vport *vport)
|
||||
static void idpf_vport_stop(struct idpf_vport *vport, bool rtnl)
|
||||
{
|
||||
struct idpf_netdev_priv *np = netdev_priv(vport->netdev);
|
||||
struct idpf_q_vec_rsrc *rsrc = &vport->dflt_qv_rsrc;
|
||||
struct idpf_adapter *adapter = vport->adapter;
|
||||
struct idpf_queue_id_reg_info *chunks;
|
||||
u32 vport_id = vport->vport_id;
|
||||
|
||||
if (!test_bit(IDPF_VPORT_UP, np->state))
|
||||
return;
|
||||
@@ -985,24 +995,26 @@ static void idpf_vport_stop(struct idpf_vport *vport, bool rtnl)
|
||||
netif_carrier_off(vport->netdev);
|
||||
netif_tx_disable(vport->netdev);
|
||||
|
||||
idpf_send_disable_vport_msg(vport);
|
||||
chunks = &adapter->vport_config[vport->idx]->qid_reg_info;
|
||||
|
||||
idpf_send_disable_vport_msg(adapter, vport_id);
|
||||
idpf_send_disable_queues_msg(vport);
|
||||
idpf_send_map_unmap_queue_vector_msg(vport, false);
|
||||
idpf_send_map_unmap_queue_vector_msg(adapter, rsrc, vport_id, false);
|
||||
/* Normally we ask for queues in create_vport, but if the number of
|
||||
* initially requested queues have changed, for example via ethtool
|
||||
* set channels, we do delete queues and then add the queues back
|
||||
* instead of deleting and reallocating the vport.
|
||||
*/
|
||||
if (test_and_clear_bit(IDPF_VPORT_DEL_QUEUES, vport->flags))
|
||||
idpf_send_delete_queues_msg(vport);
|
||||
idpf_send_delete_queues_msg(adapter, chunks, vport_id);
|
||||
|
||||
idpf_remove_features(vport);
|
||||
|
||||
vport->link_up = false;
|
||||
idpf_vport_intr_deinit(vport);
|
||||
idpf_xdp_rxq_info_deinit_all(vport);
|
||||
idpf_vport_queues_rel(vport);
|
||||
idpf_vport_intr_rel(vport);
|
||||
idpf_vport_intr_deinit(vport, rsrc);
|
||||
idpf_xdp_rxq_info_deinit_all(rsrc);
|
||||
idpf_vport_queues_rel(vport, rsrc);
|
||||
idpf_vport_intr_rel(rsrc);
|
||||
clear_bit(IDPF_VPORT_UP, np->state);
|
||||
|
||||
if (rtnl)
|
||||
@@ -1046,9 +1058,6 @@ static void idpf_decfg_netdev(struct idpf_vport *vport)
|
||||
struct idpf_adapter *adapter = vport->adapter;
|
||||
u16 idx = vport->idx;
|
||||
|
||||
kfree(vport->rx_ptype_lkup);
|
||||
vport->rx_ptype_lkup = NULL;
|
||||
|
||||
if (test_and_clear_bit(IDPF_VPORT_REG_NETDEV,
|
||||
adapter->vport_config[idx]->flags)) {
|
||||
unregister_netdev(vport->netdev);
|
||||
@@ -1065,6 +1074,7 @@ static void idpf_decfg_netdev(struct idpf_vport *vport)
|
||||
*/
|
||||
static void idpf_vport_rel(struct idpf_vport *vport)
|
||||
{
|
||||
struct idpf_q_vec_rsrc *rsrc = &vport->dflt_qv_rsrc;
|
||||
struct idpf_adapter *adapter = vport->adapter;
|
||||
struct idpf_vport_config *vport_config;
|
||||
struct idpf_vector_info vec_info;
|
||||
@@ -1073,12 +1083,12 @@ static void idpf_vport_rel(struct idpf_vport *vport)
|
||||
u16 idx = vport->idx;
|
||||
|
||||
vport_config = adapter->vport_config[vport->idx];
|
||||
idpf_deinit_rss_lut(vport);
|
||||
rss_data = &vport_config->user_config.rss_data;
|
||||
idpf_deinit_rss_lut(rss_data);
|
||||
kfree(rss_data->rss_key);
|
||||
rss_data->rss_key = NULL;
|
||||
|
||||
idpf_send_destroy_vport_msg(vport);
|
||||
idpf_send_destroy_vport_msg(adapter, vport->vport_id);
|
||||
|
||||
/* Release all max queues allocated to the adapter's pool */
|
||||
max_q.max_rxq = vport_config->max_q.max_rxq;
|
||||
@@ -1089,24 +1099,21 @@ static void idpf_vport_rel(struct idpf_vport *vport)
|
||||
|
||||
/* Release all the allocated vectors on the stack */
|
||||
vec_info.num_req_vecs = 0;
|
||||
vec_info.num_curr_vecs = vport->num_q_vectors;
|
||||
vec_info.num_curr_vecs = rsrc->num_q_vectors;
|
||||
vec_info.default_vport = vport->default_vport;
|
||||
|
||||
idpf_req_rel_vector_indexes(adapter, vport->q_vector_idxs, &vec_info);
|
||||
idpf_req_rel_vector_indexes(adapter, rsrc->q_vector_idxs, &vec_info);
|
||||
|
||||
kfree(vport->q_vector_idxs);
|
||||
vport->q_vector_idxs = NULL;
|
||||
kfree(rsrc->q_vector_idxs);
|
||||
rsrc->q_vector_idxs = NULL;
|
||||
|
||||
idpf_vport_deinit_queue_reg_chunks(vport_config);
|
||||
|
||||
kfree(adapter->vport_params_recvd[idx]);
|
||||
adapter->vport_params_recvd[idx] = NULL;
|
||||
kfree(adapter->vport_params_reqd[idx]);
|
||||
adapter->vport_params_reqd[idx] = NULL;
|
||||
if (adapter->vport_config[idx]) {
|
||||
kfree(adapter->vport_config[idx]->req_qs_chunks);
|
||||
adapter->vport_config[idx]->req_qs_chunks = NULL;
|
||||
}
|
||||
kfree(vport->rx_ptype_lkup);
|
||||
vport->rx_ptype_lkup = NULL;
|
||||
|
||||
kfree(vport);
|
||||
adapter->num_alloc_vports--;
|
||||
}
|
||||
@@ -1155,7 +1162,7 @@ static void idpf_vport_dealloc(struct idpf_vport *vport)
|
||||
*/
|
||||
static bool idpf_is_hsplit_supported(const struct idpf_vport *vport)
|
||||
{
|
||||
return idpf_is_queue_model_split(vport->rxq_model) &&
|
||||
return idpf_is_queue_model_split(vport->dflt_qv_rsrc.rxq_model) &&
|
||||
idpf_is_cap_ena_all(vport->adapter, IDPF_HSPLIT_CAPS,
|
||||
IDPF_CAP_HSPLIT);
|
||||
}
|
||||
@@ -1224,6 +1231,7 @@ static struct idpf_vport *idpf_vport_alloc(struct idpf_adapter *adapter,
|
||||
{
|
||||
struct idpf_rss_data *rss_data;
|
||||
u16 idx = adapter->next_vport;
|
||||
struct idpf_q_vec_rsrc *rsrc;
|
||||
struct idpf_vport *vport;
|
||||
u16 num_max_q;
|
||||
int err;
|
||||
@@ -1271,11 +1279,15 @@ static struct idpf_vport *idpf_vport_alloc(struct idpf_adapter *adapter,
|
||||
vport->default_vport = adapter->num_alloc_vports <
|
||||
idpf_get_default_vports(adapter);
|
||||
|
||||
vport->q_vector_idxs = kcalloc(num_max_q, sizeof(u16), GFP_KERNEL);
|
||||
if (!vport->q_vector_idxs)
|
||||
rsrc = &vport->dflt_qv_rsrc;
|
||||
rsrc->dev = &adapter->pdev->dev;
|
||||
rsrc->q_vector_idxs = kcalloc(num_max_q, sizeof(u16), GFP_KERNEL);
|
||||
if (!rsrc->q_vector_idxs)
|
||||
goto free_vport;
|
||||
|
||||
idpf_vport_init(vport, max_q);
|
||||
err = idpf_vport_init(vport, max_q);
|
||||
if (err)
|
||||
goto free_vector_idxs;
|
||||
|
||||
/* LUT and key are both initialized here. Key is not strictly dependent
|
||||
* on how many queues we have. If we change number of queues and soft
|
||||
@@ -1286,13 +1298,13 @@ static struct idpf_vport *idpf_vport_alloc(struct idpf_adapter *adapter,
|
||||
rss_data = &adapter->vport_config[idx]->user_config.rss_data;
|
||||
rss_data->rss_key = kzalloc(rss_data->rss_key_size, GFP_KERNEL);
|
||||
if (!rss_data->rss_key)
|
||||
goto free_vector_idxs;
|
||||
goto free_qreg_chunks;
|
||||
|
||||
/* Initialize default rss key */
|
||||
/* Initialize default RSS key */
|
||||
netdev_rss_key_fill((void *)rss_data->rss_key, rss_data->rss_key_size);
|
||||
|
||||
/* Initialize default rss LUT */
|
||||
err = idpf_init_rss_lut(vport);
|
||||
/* Initialize default RSS LUT */
|
||||
err = idpf_init_rss_lut(vport, rss_data);
|
||||
if (err)
|
||||
goto free_rss_key;
|
||||
|
||||
@@ -1308,8 +1320,10 @@ static struct idpf_vport *idpf_vport_alloc(struct idpf_adapter *adapter,
|
||||
|
||||
free_rss_key:
|
||||
kfree(rss_data->rss_key);
|
||||
free_qreg_chunks:
|
||||
idpf_vport_deinit_queue_reg_chunks(adapter->vport_config[idx]);
|
||||
free_vector_idxs:
|
||||
kfree(vport->q_vector_idxs);
|
||||
kfree(rsrc->q_vector_idxs);
|
||||
free_vport:
|
||||
kfree(vport);
|
||||
|
||||
@@ -1346,7 +1360,8 @@ void idpf_statistics_task(struct work_struct *work)
|
||||
struct idpf_vport *vport = adapter->vports[i];
|
||||
|
||||
if (vport && !test_bit(IDPF_HR_RESET_IN_PROG, adapter->flags))
|
||||
idpf_send_get_stats_msg(vport);
|
||||
idpf_send_get_stats_msg(netdev_priv(vport->netdev),
|
||||
&vport->port_stats);
|
||||
}
|
||||
|
||||
queue_delayed_work(adapter->stats_wq, &adapter->stats_task,
|
||||
@@ -1369,7 +1384,7 @@ void idpf_mbx_task(struct work_struct *work)
|
||||
queue_delayed_work(adapter->mbx_wq, &adapter->mbx_task,
|
||||
usecs_to_jiffies(300));
|
||||
|
||||
idpf_recv_mb_msg(adapter);
|
||||
idpf_recv_mb_msg(adapter, adapter->hw.arq);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1417,9 +1432,10 @@ static void idpf_restore_features(struct idpf_vport *vport)
|
||||
*/
|
||||
static int idpf_set_real_num_queues(struct idpf_vport *vport)
|
||||
{
|
||||
int err, txq = vport->num_txq - vport->num_xdp_txq;
|
||||
int err, txq = vport->dflt_qv_rsrc.num_txq - vport->num_xdp_txq;
|
||||
|
||||
err = netif_set_real_num_rx_queues(vport->netdev, vport->num_rxq);
|
||||
err = netif_set_real_num_rx_queues(vport->netdev,
|
||||
vport->dflt_qv_rsrc.num_rxq);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -1444,24 +1460,22 @@ static void idpf_up_complete(struct idpf_vport *vport)
|
||||
|
||||
/**
|
||||
* idpf_rx_init_buf_tail - Write initial buffer ring tail value
|
||||
* @vport: virtual port struct
|
||||
* @rsrc: pointer to queue and vector resources
|
||||
*/
|
||||
static void idpf_rx_init_buf_tail(struct idpf_vport *vport)
|
||||
static void idpf_rx_init_buf_tail(struct idpf_q_vec_rsrc *rsrc)
|
||||
{
|
||||
int i, j;
|
||||
for (unsigned int i = 0; i < rsrc->num_rxq_grp; i++) {
|
||||
struct idpf_rxq_group *grp = &rsrc->rxq_grps[i];
|
||||
|
||||
for (i = 0; i < vport->num_rxq_grp; i++) {
|
||||
struct idpf_rxq_group *grp = &vport->rxq_grps[i];
|
||||
|
||||
if (idpf_is_queue_model_split(vport->rxq_model)) {
|
||||
for (j = 0; j < vport->num_bufqs_per_qgrp; j++) {
|
||||
if (idpf_is_queue_model_split(rsrc->rxq_model)) {
|
||||
for (unsigned int j = 0; j < rsrc->num_bufqs_per_qgrp; j++) {
|
||||
const struct idpf_buf_queue *q =
|
||||
&grp->splitq.bufq_sets[j].bufq;
|
||||
|
||||
writel(q->next_to_alloc, q->tail);
|
||||
}
|
||||
} else {
|
||||
for (j = 0; j < grp->singleq.num_rxq; j++) {
|
||||
for (unsigned int j = 0; j < grp->singleq.num_rxq; j++) {
|
||||
const struct idpf_rx_queue *q =
|
||||
grp->singleq.rxqs[j];
|
||||
|
||||
@@ -1479,7 +1493,12 @@ static void idpf_rx_init_buf_tail(struct idpf_vport *vport)
|
||||
static int idpf_vport_open(struct idpf_vport *vport, bool rtnl)
|
||||
{
|
||||
struct idpf_netdev_priv *np = netdev_priv(vport->netdev);
|
||||
struct idpf_q_vec_rsrc *rsrc = &vport->dflt_qv_rsrc;
|
||||
struct idpf_adapter *adapter = vport->adapter;
|
||||
struct idpf_vport_config *vport_config;
|
||||
struct idpf_queue_id_reg_info *chunks;
|
||||
struct idpf_rss_data *rss_data;
|
||||
u32 vport_id = vport->vport_id;
|
||||
int err;
|
||||
|
||||
if (test_bit(IDPF_VPORT_UP, np->state))
|
||||
@@ -1491,48 +1510,51 @@ static int idpf_vport_open(struct idpf_vport *vport, bool rtnl)
|
||||
/* we do not allow interface up just yet */
|
||||
netif_carrier_off(vport->netdev);
|
||||
|
||||
err = idpf_vport_intr_alloc(vport);
|
||||
err = idpf_vport_intr_alloc(vport, rsrc);
|
||||
if (err) {
|
||||
dev_err(&adapter->pdev->dev, "Failed to allocate interrupts for vport %u: %d\n",
|
||||
vport->vport_id, err);
|
||||
goto err_rtnl_unlock;
|
||||
}
|
||||
|
||||
err = idpf_vport_queues_alloc(vport);
|
||||
err = idpf_vport_queues_alloc(vport, rsrc);
|
||||
if (err)
|
||||
goto intr_rel;
|
||||
|
||||
err = idpf_vport_queue_ids_init(vport);
|
||||
vport_config = adapter->vport_config[vport->idx];
|
||||
chunks = &vport_config->qid_reg_info;
|
||||
|
||||
err = idpf_vport_queue_ids_init(vport, rsrc, chunks);
|
||||
if (err) {
|
||||
dev_err(&adapter->pdev->dev, "Failed to initialize queue ids for vport %u: %d\n",
|
||||
vport->vport_id, err);
|
||||
goto queues_rel;
|
||||
}
|
||||
|
||||
err = idpf_vport_intr_init(vport);
|
||||
err = idpf_vport_intr_init(vport, rsrc);
|
||||
if (err) {
|
||||
dev_err(&adapter->pdev->dev, "Failed to initialize interrupts for vport %u: %d\n",
|
||||
vport->vport_id, err);
|
||||
goto queues_rel;
|
||||
}
|
||||
|
||||
err = idpf_queue_reg_init(vport);
|
||||
err = idpf_queue_reg_init(vport, rsrc, chunks);
|
||||
if (err) {
|
||||
dev_err(&adapter->pdev->dev, "Failed to initialize queue registers for vport %u: %d\n",
|
||||
vport->vport_id, err);
|
||||
goto intr_deinit;
|
||||
}
|
||||
|
||||
err = idpf_rx_bufs_init_all(vport);
|
||||
err = idpf_rx_bufs_init_all(vport, rsrc);
|
||||
if (err) {
|
||||
dev_err(&adapter->pdev->dev, "Failed to initialize RX buffers for vport %u: %d\n",
|
||||
vport->vport_id, err);
|
||||
goto intr_deinit;
|
||||
}
|
||||
|
||||
idpf_rx_init_buf_tail(vport);
|
||||
idpf_rx_init_buf_tail(rsrc);
|
||||
|
||||
err = idpf_xdp_rxq_info_init_all(vport);
|
||||
err = idpf_xdp_rxq_info_init_all(rsrc);
|
||||
if (err) {
|
||||
netdev_err(vport->netdev,
|
||||
"Failed to initialize XDP RxQ info for vport %u: %pe\n",
|
||||
@@ -1540,16 +1562,17 @@ static int idpf_vport_open(struct idpf_vport *vport, bool rtnl)
|
||||
goto intr_deinit;
|
||||
}
|
||||
|
||||
idpf_vport_intr_ena(vport);
|
||||
idpf_vport_intr_ena(vport, rsrc);
|
||||
|
||||
err = idpf_send_config_queues_msg(vport);
|
||||
err = idpf_send_config_queues_msg(adapter, rsrc, vport_id);
|
||||
if (err) {
|
||||
dev_err(&adapter->pdev->dev, "Failed to configure queues for vport %u, %d\n",
|
||||
vport->vport_id, err);
|
||||
goto rxq_deinit;
|
||||
}
|
||||
|
||||
err = idpf_send_map_unmap_queue_vector_msg(vport, true);
|
||||
err = idpf_send_map_unmap_queue_vector_msg(adapter, rsrc, vport_id,
|
||||
true);
|
||||
if (err) {
|
||||
dev_err(&adapter->pdev->dev, "Failed to map queue vectors for vport %u: %d\n",
|
||||
vport->vport_id, err);
|
||||
@@ -1563,7 +1586,7 @@ static int idpf_vport_open(struct idpf_vport *vport, bool rtnl)
|
||||
goto unmap_queue_vectors;
|
||||
}
|
||||
|
||||
err = idpf_send_enable_vport_msg(vport);
|
||||
err = idpf_send_enable_vport_msg(adapter, vport_id);
|
||||
if (err) {
|
||||
dev_err(&adapter->pdev->dev, "Failed to enable vport %u: %d\n",
|
||||
vport->vport_id, err);
|
||||
@@ -1573,7 +1596,8 @@ static int idpf_vport_open(struct idpf_vport *vport, bool rtnl)
|
||||
|
||||
idpf_restore_features(vport);
|
||||
|
||||
err = idpf_config_rss(vport);
|
||||
rss_data = &vport_config->user_config.rss_data;
|
||||
err = idpf_config_rss(vport, rss_data);
|
||||
if (err) {
|
||||
dev_err(&adapter->pdev->dev, "Failed to configure RSS for vport %u: %d\n",
|
||||
vport->vport_id, err);
|
||||
@@ -1588,19 +1612,19 @@ static int idpf_vport_open(struct idpf_vport *vport, bool rtnl)
|
||||
return 0;
|
||||
|
||||
disable_vport:
|
||||
idpf_send_disable_vport_msg(vport);
|
||||
idpf_send_disable_vport_msg(adapter, vport_id);
|
||||
disable_queues:
|
||||
idpf_send_disable_queues_msg(vport);
|
||||
unmap_queue_vectors:
|
||||
idpf_send_map_unmap_queue_vector_msg(vport, false);
|
||||
idpf_send_map_unmap_queue_vector_msg(adapter, rsrc, vport_id, false);
|
||||
rxq_deinit:
|
||||
idpf_xdp_rxq_info_deinit_all(vport);
|
||||
idpf_xdp_rxq_info_deinit_all(rsrc);
|
||||
intr_deinit:
|
||||
idpf_vport_intr_deinit(vport);
|
||||
idpf_vport_intr_deinit(vport, rsrc);
|
||||
queues_rel:
|
||||
idpf_vport_queues_rel(vport);
|
||||
idpf_vport_queues_rel(vport, rsrc);
|
||||
intr_rel:
|
||||
idpf_vport_intr_rel(vport);
|
||||
idpf_vport_intr_rel(rsrc);
|
||||
|
||||
err_rtnl_unlock:
|
||||
if (rtnl)
|
||||
@@ -1658,10 +1682,6 @@ void idpf_init_task(struct work_struct *work)
|
||||
goto unwind_vports;
|
||||
}
|
||||
|
||||
err = idpf_send_get_rx_ptype_msg(vport);
|
||||
if (err)
|
||||
goto unwind_vports;
|
||||
|
||||
index = vport->idx;
|
||||
vport_config = adapter->vport_config[index];
|
||||
|
||||
@@ -1987,9 +2007,13 @@ int idpf_initiate_soft_reset(struct idpf_vport *vport,
|
||||
{
|
||||
struct idpf_netdev_priv *np = netdev_priv(vport->netdev);
|
||||
bool vport_is_up = test_bit(IDPF_VPORT_UP, np->state);
|
||||
struct idpf_q_vec_rsrc *rsrc = &vport->dflt_qv_rsrc;
|
||||
struct idpf_adapter *adapter = vport->adapter;
|
||||
struct idpf_vport_config *vport_config;
|
||||
struct idpf_q_vec_rsrc *new_rsrc;
|
||||
u32 vport_id = vport->vport_id;
|
||||
struct idpf_vport *new_vport;
|
||||
int err;
|
||||
int err, tmp_err = 0;
|
||||
|
||||
/* If the system is low on memory, we can end up in bad state if we
|
||||
* free all the memory for queue resources and try to allocate them
|
||||
@@ -2014,16 +2038,18 @@ int idpf_initiate_soft_reset(struct idpf_vport *vport,
|
||||
*/
|
||||
memcpy(new_vport, vport, offsetof(struct idpf_vport, link_up));
|
||||
|
||||
new_rsrc = &new_vport->dflt_qv_rsrc;
|
||||
|
||||
/* Adjust resource parameters prior to reallocating resources */
|
||||
switch (reset_cause) {
|
||||
case IDPF_SR_Q_CHANGE:
|
||||
err = idpf_vport_adjust_qs(new_vport);
|
||||
err = idpf_vport_adjust_qs(new_vport, new_rsrc);
|
||||
if (err)
|
||||
goto free_vport;
|
||||
break;
|
||||
case IDPF_SR_Q_DESC_CHANGE:
|
||||
/* Update queue parameters before allocating resources */
|
||||
idpf_vport_calc_num_q_desc(new_vport);
|
||||
idpf_vport_calc_num_q_desc(new_vport, new_rsrc);
|
||||
break;
|
||||
case IDPF_SR_MTU_CHANGE:
|
||||
idpf_idc_vdev_mtu_event(vport->vdev_info,
|
||||
@@ -2037,41 +2063,40 @@ int idpf_initiate_soft_reset(struct idpf_vport *vport,
|
||||
goto free_vport;
|
||||
}
|
||||
|
||||
vport_config = adapter->vport_config[vport->idx];
|
||||
|
||||
if (!vport_is_up) {
|
||||
idpf_send_delete_queues_msg(vport);
|
||||
idpf_send_delete_queues_msg(adapter, &vport_config->qid_reg_info,
|
||||
vport_id);
|
||||
} else {
|
||||
set_bit(IDPF_VPORT_DEL_QUEUES, vport->flags);
|
||||
idpf_vport_stop(vport, false);
|
||||
}
|
||||
|
||||
/* We're passing in vport here because we need its wait_queue
|
||||
* to send a message and it should be getting all the vport
|
||||
* config data out of the adapter but we need to be careful not
|
||||
* to add code to add_queues to change the vport config within
|
||||
* vport itself as it will be wiped with a memcpy later.
|
||||
*/
|
||||
err = idpf_send_add_queues_msg(vport, new_vport->num_txq,
|
||||
new_vport->num_complq,
|
||||
new_vport->num_rxq,
|
||||
new_vport->num_bufq);
|
||||
err = idpf_send_add_queues_msg(adapter, vport_config, new_rsrc,
|
||||
vport_id);
|
||||
if (err)
|
||||
goto err_reset;
|
||||
|
||||
/* Same comment as above regarding avoiding copying the wait_queues and
|
||||
* mutexes applies here. We do not want to mess with those if possible.
|
||||
/* Avoid copying the wait_queues and mutexes. We do not want to mess
|
||||
* with those if possible.
|
||||
*/
|
||||
memcpy(vport, new_vport, offsetof(struct idpf_vport, link_up));
|
||||
|
||||
if (reset_cause == IDPF_SR_Q_CHANGE)
|
||||
idpf_vport_alloc_vec_indexes(vport);
|
||||
idpf_vport_alloc_vec_indexes(vport, &vport->dflt_qv_rsrc);
|
||||
|
||||
err = idpf_set_real_num_queues(vport);
|
||||
if (err)
|
||||
goto err_open;
|
||||
|
||||
if (reset_cause == IDPF_SR_Q_CHANGE &&
|
||||
!netif_is_rxfh_configured(vport->netdev))
|
||||
idpf_fill_dflt_rss_lut(vport);
|
||||
!netif_is_rxfh_configured(vport->netdev)) {
|
||||
struct idpf_rss_data *rss_data;
|
||||
|
||||
rss_data = &vport_config->user_config.rss_data;
|
||||
idpf_fill_dflt_rss_lut(vport, rss_data);
|
||||
}
|
||||
|
||||
if (vport_is_up)
|
||||
err = idpf_vport_open(vport, false);
|
||||
@@ -2079,11 +2104,11 @@ int idpf_initiate_soft_reset(struct idpf_vport *vport,
|
||||
goto free_vport;
|
||||
|
||||
err_reset:
|
||||
idpf_send_add_queues_msg(vport, vport->num_txq, vport->num_complq,
|
||||
vport->num_rxq, vport->num_bufq);
|
||||
tmp_err = idpf_send_add_queues_msg(adapter, vport_config, rsrc,
|
||||
vport_id);
|
||||
|
||||
err_open:
|
||||
if (vport_is_up)
|
||||
if (!tmp_err && vport_is_up)
|
||||
idpf_vport_open(vport, false);
|
||||
|
||||
free_vport:
|
||||
@@ -2249,7 +2274,12 @@ static int idpf_set_features(struct net_device *netdev,
|
||||
* the HW when the interface is brought up.
|
||||
*/
|
||||
if (test_bit(IDPF_VPORT_UP, np->state)) {
|
||||
err = idpf_config_rss(vport);
|
||||
struct idpf_vport_config *vport_config;
|
||||
struct idpf_rss_data *rss_data;
|
||||
|
||||
vport_config = adapter->vport_config[vport->idx];
|
||||
rss_data = &vport_config->user_config.rss_data;
|
||||
err = idpf_config_rss(vport, rss_data);
|
||||
if (err)
|
||||
goto unlock_mutex;
|
||||
}
|
||||
@@ -2263,8 +2293,13 @@ static int idpf_set_features(struct net_device *netdev,
|
||||
}
|
||||
|
||||
if (changed & NETIF_F_LOOPBACK) {
|
||||
bool loopback_ena;
|
||||
|
||||
netdev->features ^= NETIF_F_LOOPBACK;
|
||||
err = idpf_send_ena_dis_loopback_msg(vport);
|
||||
loopback_ena = idpf_is_feature_ena(vport, NETIF_F_LOOPBACK);
|
||||
|
||||
err = idpf_send_ena_dis_loopback_msg(adapter, vport->vport_id,
|
||||
loopback_ena);
|
||||
}
|
||||
|
||||
unlock_mutex:
|
||||
|
||||
@@ -384,15 +384,17 @@ static int idpf_ptp_update_cached_phctime(struct idpf_adapter *adapter)
|
||||
WRITE_ONCE(adapter->ptp->cached_phc_jiffies, jiffies);
|
||||
|
||||
idpf_for_each_vport(adapter, vport) {
|
||||
struct idpf_q_vec_rsrc *rsrc;
|
||||
bool split;
|
||||
|
||||
if (!vport || !vport->rxq_grps)
|
||||
if (!vport || !vport->dflt_qv_rsrc.rxq_grps)
|
||||
continue;
|
||||
|
||||
split = idpf_is_queue_model_split(vport->rxq_model);
|
||||
rsrc = &vport->dflt_qv_rsrc;
|
||||
split = idpf_is_queue_model_split(rsrc->rxq_model);
|
||||
|
||||
for (u16 i = 0; i < vport->num_rxq_grp; i++) {
|
||||
struct idpf_rxq_group *grp = &vport->rxq_grps[i];
|
||||
for (u16 i = 0; i < rsrc->num_rxq_grp; i++) {
|
||||
struct idpf_rxq_group *grp = &rsrc->rxq_grps[i];
|
||||
|
||||
idpf_ptp_update_phctime_rxq_grp(grp, split, systime);
|
||||
}
|
||||
@@ -681,9 +683,10 @@ int idpf_ptp_request_ts(struct idpf_tx_queue *tx_q, struct sk_buff *skb,
|
||||
*/
|
||||
static void idpf_ptp_set_rx_tstamp(struct idpf_vport *vport, int rx_filter)
|
||||
{
|
||||
struct idpf_q_vec_rsrc *rsrc = &vport->dflt_qv_rsrc;
|
||||
bool enable = true, splitq;
|
||||
|
||||
splitq = idpf_is_queue_model_split(vport->rxq_model);
|
||||
splitq = idpf_is_queue_model_split(rsrc->rxq_model);
|
||||
|
||||
if (rx_filter == HWTSTAMP_FILTER_NONE) {
|
||||
enable = false;
|
||||
@@ -692,8 +695,8 @@ static void idpf_ptp_set_rx_tstamp(struct idpf_vport *vport, int rx_filter)
|
||||
vport->tstamp_config.rx_filter = HWTSTAMP_FILTER_ALL;
|
||||
}
|
||||
|
||||
for (u16 i = 0; i < vport->num_rxq_grp; i++) {
|
||||
struct idpf_rxq_group *grp = &vport->rxq_grps[i];
|
||||
for (u16 i = 0; i < rsrc->num_rxq_grp; i++) {
|
||||
struct idpf_rxq_group *grp = &rsrc->rxq_grps[i];
|
||||
struct idpf_rx_queue *rx_queue;
|
||||
u16 j, num_rxq;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -283,6 +283,7 @@ struct idpf_ptype_state {
|
||||
* @__IDPF_Q_FLOW_SCH_EN: Enable flow scheduling
|
||||
* @__IDPF_Q_SW_MARKER: Used to indicate TX queue marker completions
|
||||
* @__IDPF_Q_CRC_EN: enable CRC offload in singleq mode
|
||||
* @__IDPF_Q_RSC_EN: enable Receive Side Coalescing on Rx (splitq)
|
||||
* @__IDPF_Q_HSPLIT_EN: enable header split on Rx (splitq)
|
||||
* @__IDPF_Q_PTP: indicates whether the Rx timestamping is enabled for the
|
||||
* queue
|
||||
@@ -297,6 +298,7 @@ enum idpf_queue_flags_t {
|
||||
__IDPF_Q_FLOW_SCH_EN,
|
||||
__IDPF_Q_SW_MARKER,
|
||||
__IDPF_Q_CRC_EN,
|
||||
__IDPF_Q_RSC_EN,
|
||||
__IDPF_Q_HSPLIT_EN,
|
||||
__IDPF_Q_PTP,
|
||||
__IDPF_Q_NOIRQ,
|
||||
@@ -925,6 +927,7 @@ struct idpf_bufq_set {
|
||||
* @singleq.rxqs: Array of RX queue pointers
|
||||
* @splitq: Struct with split queue related members
|
||||
* @splitq.num_rxq_sets: Number of RX queue sets
|
||||
* @splitq.num_rxq_sets: Number of Buffer queue sets
|
||||
* @splitq.rxq_sets: Array of RX queue sets
|
||||
* @splitq.bufq_sets: Buffer queue set pointer
|
||||
*
|
||||
@@ -942,6 +945,7 @@ struct idpf_rxq_group {
|
||||
} singleq;
|
||||
struct {
|
||||
u16 num_rxq_sets;
|
||||
u16 num_bufq_sets;
|
||||
struct idpf_rxq_set *rxq_sets[IDPF_LARGE_MAX_Q];
|
||||
struct idpf_bufq_set *bufq_sets;
|
||||
} splitq;
|
||||
@@ -1072,25 +1076,35 @@ static inline u32 idpf_tx_splitq_get_free_bufs(struct idpf_sw_queue *refillq)
|
||||
|
||||
int idpf_vport_singleq_napi_poll(struct napi_struct *napi, int budget);
|
||||
void idpf_vport_init_num_qs(struct idpf_vport *vport,
|
||||
struct virtchnl2_create_vport *vport_msg);
|
||||
void idpf_vport_calc_num_q_desc(struct idpf_vport *vport);
|
||||
struct virtchnl2_create_vport *vport_msg,
|
||||
struct idpf_q_vec_rsrc *rsrc);
|
||||
void idpf_vport_calc_num_q_desc(struct idpf_vport *vport,
|
||||
struct idpf_q_vec_rsrc *rsrc);
|
||||
int idpf_vport_calc_total_qs(struct idpf_adapter *adapter, u16 vport_index,
|
||||
struct virtchnl2_create_vport *vport_msg,
|
||||
struct idpf_vport_max_q *max_q);
|
||||
void idpf_vport_calc_num_q_groups(struct idpf_vport *vport);
|
||||
int idpf_vport_queues_alloc(struct idpf_vport *vport);
|
||||
void idpf_vport_queues_rel(struct idpf_vport *vport);
|
||||
void idpf_vport_intr_rel(struct idpf_vport *vport);
|
||||
int idpf_vport_intr_alloc(struct idpf_vport *vport);
|
||||
void idpf_vport_calc_num_q_groups(struct idpf_q_vec_rsrc *rsrc);
|
||||
int idpf_vport_queues_alloc(struct idpf_vport *vport,
|
||||
struct idpf_q_vec_rsrc *rsrc);
|
||||
void idpf_vport_queues_rel(struct idpf_vport *vport,
|
||||
struct idpf_q_vec_rsrc *rsrc);
|
||||
void idpf_vport_intr_rel(struct idpf_q_vec_rsrc *rsrc);
|
||||
int idpf_vport_intr_alloc(struct idpf_vport *vport,
|
||||
struct idpf_q_vec_rsrc *rsrc);
|
||||
void idpf_vport_intr_update_itr_ena_irq(struct idpf_q_vector *q_vector);
|
||||
void idpf_vport_intr_deinit(struct idpf_vport *vport);
|
||||
int idpf_vport_intr_init(struct idpf_vport *vport);
|
||||
void idpf_vport_intr_ena(struct idpf_vport *vport);
|
||||
void idpf_fill_dflt_rss_lut(struct idpf_vport *vport);
|
||||
int idpf_config_rss(struct idpf_vport *vport);
|
||||
int idpf_init_rss_lut(struct idpf_vport *vport);
|
||||
void idpf_deinit_rss_lut(struct idpf_vport *vport);
|
||||
int idpf_rx_bufs_init_all(struct idpf_vport *vport);
|
||||
void idpf_vport_intr_deinit(struct idpf_vport *vport,
|
||||
struct idpf_q_vec_rsrc *rsrc);
|
||||
int idpf_vport_intr_init(struct idpf_vport *vport,
|
||||
struct idpf_q_vec_rsrc *rsrc);
|
||||
void idpf_vport_intr_ena(struct idpf_vport *vport,
|
||||
struct idpf_q_vec_rsrc *rsrc);
|
||||
void idpf_fill_dflt_rss_lut(struct idpf_vport *vport,
|
||||
struct idpf_rss_data *rss_data);
|
||||
int idpf_config_rss(struct idpf_vport *vport, struct idpf_rss_data *rss_data);
|
||||
int idpf_init_rss_lut(struct idpf_vport *vport, struct idpf_rss_data *rss_data);
|
||||
void idpf_deinit_rss_lut(struct idpf_rss_data *rss_data);
|
||||
int idpf_rx_bufs_init_all(struct idpf_vport *vport,
|
||||
struct idpf_q_vec_rsrc *rsrc);
|
||||
|
||||
struct idpf_q_vector *idpf_find_rxq_vec(const struct idpf_vport *vport,
|
||||
u32 q_num);
|
||||
|
||||
@@ -69,11 +69,13 @@ static void idpf_vf_mb_intr_reg_init(struct idpf_adapter *adapter)
|
||||
/**
|
||||
* idpf_vf_intr_reg_init - Initialize interrupt registers
|
||||
* @vport: virtual port structure
|
||||
* @rsrc: pointer to queue and vector resources
|
||||
*/
|
||||
static int idpf_vf_intr_reg_init(struct idpf_vport *vport)
|
||||
static int idpf_vf_intr_reg_init(struct idpf_vport *vport,
|
||||
struct idpf_q_vec_rsrc *rsrc)
|
||||
{
|
||||
struct idpf_adapter *adapter = vport->adapter;
|
||||
int num_vecs = vport->num_q_vectors;
|
||||
u16 num_vecs = rsrc->num_q_vectors;
|
||||
struct idpf_vec_regs *reg_vals;
|
||||
int num_regs, i, err = 0;
|
||||
u32 rx_itr, tx_itr, val;
|
||||
@@ -85,15 +87,15 @@ static int idpf_vf_intr_reg_init(struct idpf_vport *vport)
|
||||
if (!reg_vals)
|
||||
return -ENOMEM;
|
||||
|
||||
num_regs = idpf_get_reg_intr_vecs(vport, reg_vals);
|
||||
num_regs = idpf_get_reg_intr_vecs(adapter, reg_vals);
|
||||
if (num_regs < num_vecs) {
|
||||
err = -EINVAL;
|
||||
goto free_reg_vals;
|
||||
}
|
||||
|
||||
for (i = 0; i < num_vecs; i++) {
|
||||
struct idpf_q_vector *q_vector = &vport->q_vectors[i];
|
||||
u16 vec_id = vport->q_vector_idxs[i] - IDPF_MBX_Q_VEC;
|
||||
struct idpf_q_vector *q_vector = &rsrc->q_vectors[i];
|
||||
u16 vec_id = rsrc->q_vector_idxs[i] - IDPF_MBX_Q_VEC;
|
||||
struct idpf_intr_reg *intr = &q_vector->intr_reg;
|
||||
u32 spacing;
|
||||
|
||||
@@ -122,12 +124,12 @@ static int idpf_vf_intr_reg_init(struct idpf_vport *vport)
|
||||
|
||||
/* Data vector for NOIRQ queues */
|
||||
|
||||
val = reg_vals[vport->q_vector_idxs[i] - IDPF_MBX_Q_VEC].dyn_ctl_reg;
|
||||
vport->noirq_dyn_ctl = idpf_get_reg_addr(adapter, val);
|
||||
val = reg_vals[rsrc->q_vector_idxs[i] - IDPF_MBX_Q_VEC].dyn_ctl_reg;
|
||||
rsrc->noirq_dyn_ctl = idpf_get_reg_addr(adapter, val);
|
||||
|
||||
val = VF_INT_DYN_CTLN_WB_ON_ITR_M | VF_INT_DYN_CTLN_INTENA_MSK_M |
|
||||
FIELD_PREP(VF_INT_DYN_CTLN_ITR_INDX_M, IDPF_NO_ITR_UPDATE_IDX);
|
||||
vport->noirq_dyn_ctl_ena = val;
|
||||
rsrc->noirq_dyn_ctl_ena = val;
|
||||
|
||||
free_reg_vals:
|
||||
kfree(reg_vals);
|
||||
@@ -156,7 +158,8 @@ static void idpf_vf_trigger_reset(struct idpf_adapter *adapter,
|
||||
/* Do not send VIRTCHNL2_OP_RESET_VF message on driver unload */
|
||||
if (trig_cause == IDPF_HR_FUNC_RESET &&
|
||||
!test_bit(IDPF_REMOVE_IN_PROG, adapter->flags))
|
||||
idpf_send_mb_msg(adapter, VIRTCHNL2_OP_RESET_VF, 0, NULL, 0);
|
||||
idpf_send_mb_msg(adapter, adapter->hw.asq,
|
||||
VIRTCHNL2_OP_RESET_VF, 0, NULL, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -92,6 +92,7 @@ struct idpf_netdev_priv;
|
||||
struct idpf_vec_regs;
|
||||
struct idpf_vport;
|
||||
struct idpf_vport_max_q;
|
||||
struct idpf_vport_config;
|
||||
struct idpf_vport_user_config_data;
|
||||
|
||||
ssize_t idpf_vc_xn_exec(struct idpf_adapter *adapter,
|
||||
@@ -101,10 +102,20 @@ void idpf_deinit_dflt_mbx(struct idpf_adapter *adapter);
|
||||
int idpf_vc_core_init(struct idpf_adapter *adapter);
|
||||
void idpf_vc_core_deinit(struct idpf_adapter *adapter);
|
||||
|
||||
int idpf_get_reg_intr_vecs(struct idpf_vport *vport,
|
||||
int idpf_get_reg_intr_vecs(struct idpf_adapter *adapter,
|
||||
struct idpf_vec_regs *reg_vals);
|
||||
int idpf_queue_reg_init(struct idpf_vport *vport);
|
||||
int idpf_vport_queue_ids_init(struct idpf_vport *vport);
|
||||
int idpf_queue_reg_init(struct idpf_vport *vport,
|
||||
struct idpf_q_vec_rsrc *rsrc,
|
||||
struct idpf_queue_id_reg_info *chunks);
|
||||
int idpf_vport_queue_ids_init(struct idpf_vport *vport,
|
||||
struct idpf_q_vec_rsrc *rsrc,
|
||||
struct idpf_queue_id_reg_info *chunks);
|
||||
static inline void
|
||||
idpf_vport_deinit_queue_reg_chunks(struct idpf_vport_config *vport_cfg)
|
||||
{
|
||||
kfree(vport_cfg->qid_reg_info.queue_chunks);
|
||||
vport_cfg->qid_reg_info.queue_chunks = NULL;
|
||||
}
|
||||
|
||||
bool idpf_vport_is_cap_ena(struct idpf_vport *vport, u16 flag);
|
||||
bool idpf_sideband_flow_type_ena(struct idpf_vport *vport, u32 flow_type);
|
||||
@@ -112,9 +123,9 @@ bool idpf_sideband_action_ena(struct idpf_vport *vport,
|
||||
struct ethtool_rx_flow_spec *fsp);
|
||||
unsigned int idpf_fsteer_max_rules(struct idpf_vport *vport);
|
||||
|
||||
int idpf_recv_mb_msg(struct idpf_adapter *adapter);
|
||||
int idpf_send_mb_msg(struct idpf_adapter *adapter, u32 op,
|
||||
u16 msg_size, u8 *msg, u16 cookie);
|
||||
int idpf_recv_mb_msg(struct idpf_adapter *adapter, struct idpf_ctlq_info *arq);
|
||||
int idpf_send_mb_msg(struct idpf_adapter *adapter, struct idpf_ctlq_info *asq,
|
||||
u32 op, u16 msg_size, u8 *msg, u16 cookie);
|
||||
|
||||
struct idpf_queue_ptr {
|
||||
enum virtchnl2_queue_type type;
|
||||
@@ -127,60 +138,81 @@ struct idpf_queue_ptr {
|
||||
};
|
||||
|
||||
struct idpf_queue_set {
|
||||
struct idpf_vport *vport;
|
||||
struct idpf_adapter *adapter;
|
||||
struct idpf_q_vec_rsrc *qv_rsrc;
|
||||
u32 vport_id;
|
||||
|
||||
u32 num;
|
||||
struct idpf_queue_ptr qs[] __counted_by(num);
|
||||
};
|
||||
|
||||
struct idpf_queue_set *idpf_alloc_queue_set(struct idpf_vport *vport, u32 num);
|
||||
struct idpf_queue_set *idpf_alloc_queue_set(struct idpf_adapter *adapter,
|
||||
struct idpf_q_vec_rsrc *rsrc,
|
||||
u32 vport_id, u32 num);
|
||||
|
||||
int idpf_send_enable_queue_set_msg(const struct idpf_queue_set *qs);
|
||||
int idpf_send_disable_queue_set_msg(const struct idpf_queue_set *qs);
|
||||
int idpf_send_config_queue_set_msg(const struct idpf_queue_set *qs);
|
||||
|
||||
int idpf_send_disable_queues_msg(struct idpf_vport *vport);
|
||||
int idpf_send_config_queues_msg(struct idpf_vport *vport);
|
||||
int idpf_send_enable_queues_msg(struct idpf_vport *vport);
|
||||
int idpf_send_config_queues_msg(struct idpf_adapter *adapter,
|
||||
struct idpf_q_vec_rsrc *rsrc,
|
||||
u32 vport_id);
|
||||
|
||||
void idpf_vport_init(struct idpf_vport *vport, struct idpf_vport_max_q *max_q);
|
||||
int idpf_vport_init(struct idpf_vport *vport, struct idpf_vport_max_q *max_q);
|
||||
u32 idpf_get_vport_id(struct idpf_vport *vport);
|
||||
int idpf_send_create_vport_msg(struct idpf_adapter *adapter,
|
||||
struct idpf_vport_max_q *max_q);
|
||||
int idpf_send_destroy_vport_msg(struct idpf_vport *vport);
|
||||
int idpf_send_enable_vport_msg(struct idpf_vport *vport);
|
||||
int idpf_send_disable_vport_msg(struct idpf_vport *vport);
|
||||
int idpf_send_destroy_vport_msg(struct idpf_adapter *adapter, u32 vport_id);
|
||||
int idpf_send_enable_vport_msg(struct idpf_adapter *adapter, u32 vport_id);
|
||||
int idpf_send_disable_vport_msg(struct idpf_adapter *adapter, u32 vport_id);
|
||||
|
||||
int idpf_vport_adjust_qs(struct idpf_vport *vport);
|
||||
int idpf_vport_adjust_qs(struct idpf_vport *vport,
|
||||
struct idpf_q_vec_rsrc *rsrc);
|
||||
int idpf_vport_alloc_max_qs(struct idpf_adapter *adapter,
|
||||
struct idpf_vport_max_q *max_q);
|
||||
void idpf_vport_dealloc_max_qs(struct idpf_adapter *adapter,
|
||||
struct idpf_vport_max_q *max_q);
|
||||
int idpf_send_add_queues_msg(const struct idpf_vport *vport, u16 num_tx_q,
|
||||
u16 num_complq, u16 num_rx_q, u16 num_rx_bufq);
|
||||
int idpf_send_delete_queues_msg(struct idpf_vport *vport);
|
||||
int idpf_send_add_queues_msg(struct idpf_adapter *adapter,
|
||||
struct idpf_vport_config *vport_config,
|
||||
struct idpf_q_vec_rsrc *rsrc,
|
||||
u32 vport_id);
|
||||
int idpf_send_delete_queues_msg(struct idpf_adapter *adapter,
|
||||
struct idpf_queue_id_reg_info *chunks,
|
||||
u32 vport_id);
|
||||
|
||||
int idpf_vport_alloc_vec_indexes(struct idpf_vport *vport);
|
||||
int idpf_vport_alloc_vec_indexes(struct idpf_vport *vport,
|
||||
struct idpf_q_vec_rsrc *rsrc);
|
||||
int idpf_get_vec_ids(struct idpf_adapter *adapter,
|
||||
u16 *vecids, int num_vecids,
|
||||
struct virtchnl2_vector_chunks *chunks);
|
||||
int idpf_send_alloc_vectors_msg(struct idpf_adapter *adapter, u16 num_vectors);
|
||||
int idpf_send_dealloc_vectors_msg(struct idpf_adapter *adapter);
|
||||
int idpf_send_map_unmap_queue_vector_msg(struct idpf_vport *vport, bool map);
|
||||
int idpf_send_map_unmap_queue_vector_msg(struct idpf_adapter *adapter,
|
||||
struct idpf_q_vec_rsrc *rsrc,
|
||||
u32 vport_id,
|
||||
bool map);
|
||||
|
||||
int idpf_add_del_mac_filters(struct idpf_vport *vport,
|
||||
struct idpf_netdev_priv *np,
|
||||
int idpf_add_del_mac_filters(struct idpf_adapter *adapter,
|
||||
struct idpf_vport_config *vport_config,
|
||||
const u8 *default_mac_addr, u32 vport_id,
|
||||
bool add, bool async);
|
||||
int idpf_set_promiscuous(struct idpf_adapter *adapter,
|
||||
struct idpf_vport_user_config_data *config_data,
|
||||
u32 vport_id);
|
||||
int idpf_check_supported_desc_ids(struct idpf_vport *vport);
|
||||
int idpf_send_get_rx_ptype_msg(struct idpf_vport *vport);
|
||||
int idpf_send_ena_dis_loopback_msg(struct idpf_vport *vport);
|
||||
int idpf_send_get_stats_msg(struct idpf_vport *vport);
|
||||
int idpf_send_ena_dis_loopback_msg(struct idpf_adapter *adapter, u32 vport_id,
|
||||
bool loopback_ena);
|
||||
int idpf_send_get_stats_msg(struct idpf_netdev_priv *np,
|
||||
struct idpf_port_stats *port_stats);
|
||||
int idpf_send_set_sriov_vfs_msg(struct idpf_adapter *adapter, u16 num_vfs);
|
||||
int idpf_send_get_set_rss_key_msg(struct idpf_vport *vport, bool get);
|
||||
int idpf_send_get_set_rss_lut_msg(struct idpf_vport *vport, bool get);
|
||||
int idpf_send_get_set_rss_key_msg(struct idpf_adapter *adapter,
|
||||
struct idpf_rss_data *rss_data,
|
||||
u32 vport_id, bool get);
|
||||
int idpf_send_get_set_rss_lut_msg(struct idpf_adapter *adapter,
|
||||
struct idpf_rss_data *rss_data,
|
||||
u32 vport_id, bool get);
|
||||
void idpf_vc_xn_shutdown(struct idpf_vc_xn_manager *vcxn_mngr);
|
||||
int idpf_idc_rdma_vc_send_sync(struct iidc_rdma_core_dev_info *cdev_info,
|
||||
u8 *send_msg, u16 msg_size,
|
||||
|
||||
@@ -6,17 +6,17 @@
|
||||
#include "xdp.h"
|
||||
#include "xsk.h"
|
||||
|
||||
static int idpf_rxq_for_each(const struct idpf_vport *vport,
|
||||
static int idpf_rxq_for_each(const struct idpf_q_vec_rsrc *rsrc,
|
||||
int (*fn)(struct idpf_rx_queue *rxq, void *arg),
|
||||
void *arg)
|
||||
{
|
||||
bool splitq = idpf_is_queue_model_split(vport->rxq_model);
|
||||
bool splitq = idpf_is_queue_model_split(rsrc->rxq_model);
|
||||
|
||||
if (!vport->rxq_grps)
|
||||
if (!rsrc->rxq_grps)
|
||||
return -ENETDOWN;
|
||||
|
||||
for (u32 i = 0; i < vport->num_rxq_grp; i++) {
|
||||
const struct idpf_rxq_group *rx_qgrp = &vport->rxq_grps[i];
|
||||
for (u32 i = 0; i < rsrc->num_rxq_grp; i++) {
|
||||
const struct idpf_rxq_group *rx_qgrp = &rsrc->rxq_grps[i];
|
||||
u32 num_rxq;
|
||||
|
||||
if (splitq)
|
||||
@@ -45,7 +45,8 @@ static int idpf_rxq_for_each(const struct idpf_vport *vport,
|
||||
static int __idpf_xdp_rxq_info_init(struct idpf_rx_queue *rxq, void *arg)
|
||||
{
|
||||
const struct idpf_vport *vport = rxq->q_vector->vport;
|
||||
bool split = idpf_is_queue_model_split(vport->rxq_model);
|
||||
const struct idpf_q_vec_rsrc *rsrc;
|
||||
bool split;
|
||||
int err;
|
||||
|
||||
err = __xdp_rxq_info_reg(&rxq->xdp_rxq, vport->netdev, rxq->idx,
|
||||
@@ -54,6 +55,9 @@ static int __idpf_xdp_rxq_info_init(struct idpf_rx_queue *rxq, void *arg)
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
rsrc = &vport->dflt_qv_rsrc;
|
||||
split = idpf_is_queue_model_split(rsrc->rxq_model);
|
||||
|
||||
if (idpf_queue_has(XSK, rxq)) {
|
||||
err = xdp_rxq_info_reg_mem_model(&rxq->xdp_rxq,
|
||||
MEM_TYPE_XSK_BUFF_POOL,
|
||||
@@ -70,7 +74,7 @@ static int __idpf_xdp_rxq_info_init(struct idpf_rx_queue *rxq, void *arg)
|
||||
if (!split)
|
||||
return 0;
|
||||
|
||||
rxq->xdpsqs = &vport->txqs[vport->xdp_txq_offset];
|
||||
rxq->xdpsqs = &vport->txqs[rsrc->xdp_txq_offset];
|
||||
rxq->num_xdp_txq = vport->num_xdp_txq;
|
||||
|
||||
return 0;
|
||||
@@ -86,9 +90,9 @@ int idpf_xdp_rxq_info_init(struct idpf_rx_queue *rxq)
|
||||
return __idpf_xdp_rxq_info_init(rxq, NULL);
|
||||
}
|
||||
|
||||
int idpf_xdp_rxq_info_init_all(const struct idpf_vport *vport)
|
||||
int idpf_xdp_rxq_info_init_all(const struct idpf_q_vec_rsrc *rsrc)
|
||||
{
|
||||
return idpf_rxq_for_each(vport, __idpf_xdp_rxq_info_init, NULL);
|
||||
return idpf_rxq_for_each(rsrc, __idpf_xdp_rxq_info_init, NULL);
|
||||
}
|
||||
|
||||
static int __idpf_xdp_rxq_info_deinit(struct idpf_rx_queue *rxq, void *arg)
|
||||
@@ -111,10 +115,10 @@ void idpf_xdp_rxq_info_deinit(struct idpf_rx_queue *rxq, u32 model)
|
||||
__idpf_xdp_rxq_info_deinit(rxq, (void *)(size_t)model);
|
||||
}
|
||||
|
||||
void idpf_xdp_rxq_info_deinit_all(const struct idpf_vport *vport)
|
||||
void idpf_xdp_rxq_info_deinit_all(const struct idpf_q_vec_rsrc *rsrc)
|
||||
{
|
||||
idpf_rxq_for_each(vport, __idpf_xdp_rxq_info_deinit,
|
||||
(void *)(size_t)vport->rxq_model);
|
||||
idpf_rxq_for_each(rsrc, __idpf_xdp_rxq_info_deinit,
|
||||
(void *)(size_t)rsrc->rxq_model);
|
||||
}
|
||||
|
||||
static int idpf_xdp_rxq_assign_prog(struct idpf_rx_queue *rxq, void *arg)
|
||||
@@ -132,10 +136,10 @@ static int idpf_xdp_rxq_assign_prog(struct idpf_rx_queue *rxq, void *arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void idpf_xdp_copy_prog_to_rqs(const struct idpf_vport *vport,
|
||||
void idpf_xdp_copy_prog_to_rqs(const struct idpf_q_vec_rsrc *rsrc,
|
||||
struct bpf_prog *xdp_prog)
|
||||
{
|
||||
idpf_rxq_for_each(vport, idpf_xdp_rxq_assign_prog, xdp_prog);
|
||||
idpf_rxq_for_each(rsrc, idpf_xdp_rxq_assign_prog, xdp_prog);
|
||||
}
|
||||
|
||||
static void idpf_xdp_tx_timer(struct work_struct *work);
|
||||
@@ -165,7 +169,7 @@ int idpf_xdpsqs_get(const struct idpf_vport *vport)
|
||||
}
|
||||
|
||||
dev = vport->netdev;
|
||||
sqs = vport->xdp_txq_offset;
|
||||
sqs = vport->dflt_qv_rsrc.xdp_txq_offset;
|
||||
|
||||
for (u32 i = sqs; i < vport->num_txq; i++) {
|
||||
struct idpf_tx_queue *xdpsq = vport->txqs[i];
|
||||
@@ -202,7 +206,7 @@ void idpf_xdpsqs_put(const struct idpf_vport *vport)
|
||||
return;
|
||||
|
||||
dev = vport->netdev;
|
||||
sqs = vport->xdp_txq_offset;
|
||||
sqs = vport->dflt_qv_rsrc.xdp_txq_offset;
|
||||
|
||||
for (u32 i = sqs; i < vport->num_txq; i++) {
|
||||
struct idpf_tx_queue *xdpsq = vport->txqs[i];
|
||||
@@ -358,12 +362,15 @@ int idpf_xdp_xmit(struct net_device *dev, int n, struct xdp_frame **frames,
|
||||
{
|
||||
const struct idpf_netdev_priv *np = netdev_priv(dev);
|
||||
const struct idpf_vport *vport = np->vport;
|
||||
u32 xdp_txq_offset;
|
||||
|
||||
if (unlikely(!netif_carrier_ok(dev) || !vport->link_up))
|
||||
return -ENETDOWN;
|
||||
|
||||
xdp_txq_offset = vport->dflt_qv_rsrc.xdp_txq_offset;
|
||||
|
||||
return libeth_xdp_xmit_do_bulk(dev, n, frames, flags,
|
||||
&vport->txqs[vport->xdp_txq_offset],
|
||||
&vport->txqs[xdp_txq_offset],
|
||||
vport->num_xdp_txq,
|
||||
idpf_xdp_xmit_flush_bulk,
|
||||
idpf_xdp_tx_finalize);
|
||||
@@ -397,7 +404,7 @@ static const struct xdp_metadata_ops idpf_xdpmo = {
|
||||
|
||||
void idpf_xdp_set_features(const struct idpf_vport *vport)
|
||||
{
|
||||
if (!idpf_is_queue_model_split(vport->rxq_model))
|
||||
if (!idpf_is_queue_model_split(vport->dflt_qv_rsrc.rxq_model))
|
||||
return;
|
||||
|
||||
libeth_xdp_set_features_noredir(vport->netdev, &idpf_xdpmo,
|
||||
@@ -409,6 +416,7 @@ static int idpf_xdp_setup_prog(struct idpf_vport *vport,
|
||||
const struct netdev_bpf *xdp)
|
||||
{
|
||||
const struct idpf_netdev_priv *np = netdev_priv(vport->netdev);
|
||||
const struct idpf_q_vec_rsrc *rsrc = &vport->dflt_qv_rsrc;
|
||||
struct bpf_prog *old, *prog = xdp->prog;
|
||||
struct idpf_vport_config *cfg;
|
||||
int ret;
|
||||
@@ -419,7 +427,7 @@ static int idpf_xdp_setup_prog(struct idpf_vport *vport,
|
||||
!test_bit(IDPF_VPORT_REG_NETDEV, cfg->flags) ||
|
||||
!!vport->xdp_prog == !!prog) {
|
||||
if (test_bit(IDPF_VPORT_UP, np->state))
|
||||
idpf_xdp_copy_prog_to_rqs(vport, prog);
|
||||
idpf_xdp_copy_prog_to_rqs(rsrc, prog);
|
||||
|
||||
old = xchg(&vport->xdp_prog, prog);
|
||||
if (old)
|
||||
@@ -464,7 +472,7 @@ int idpf_xdp(struct net_device *dev, struct netdev_bpf *xdp)
|
||||
idpf_vport_ctrl_lock(dev);
|
||||
vport = idpf_netdev_to_vport(dev);
|
||||
|
||||
if (!idpf_is_queue_model_split(vport->txq_model))
|
||||
if (!idpf_is_queue_model_split(vport->dflt_qv_rsrc.txq_model))
|
||||
goto notsupp;
|
||||
|
||||
switch (xdp->command) {
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
#include "idpf_txrx.h"
|
||||
|
||||
int idpf_xdp_rxq_info_init(struct idpf_rx_queue *rxq);
|
||||
int idpf_xdp_rxq_info_init_all(const struct idpf_vport *vport);
|
||||
int idpf_xdp_rxq_info_init_all(const struct idpf_q_vec_rsrc *rsrc);
|
||||
void idpf_xdp_rxq_info_deinit(struct idpf_rx_queue *rxq, u32 model);
|
||||
void idpf_xdp_rxq_info_deinit_all(const struct idpf_vport *vport);
|
||||
void idpf_xdp_copy_prog_to_rqs(const struct idpf_vport *vport,
|
||||
void idpf_xdp_rxq_info_deinit_all(const struct idpf_q_vec_rsrc *rsrc);
|
||||
void idpf_xdp_copy_prog_to_rqs(const struct idpf_q_vec_rsrc *rsrc,
|
||||
struct bpf_prog *xdp_prog);
|
||||
|
||||
int idpf_xdpsqs_get(const struct idpf_vport *vport);
|
||||
|
||||
@@ -26,13 +26,14 @@ static void idpf_xsk_setup_rxq(const struct idpf_vport *vport,
|
||||
static void idpf_xsk_setup_bufq(const struct idpf_vport *vport,
|
||||
struct idpf_buf_queue *bufq)
|
||||
{
|
||||
const struct idpf_q_vec_rsrc *rsrc = &vport->dflt_qv_rsrc;
|
||||
struct xsk_buff_pool *pool;
|
||||
u32 qid = U32_MAX;
|
||||
|
||||
for (u32 i = 0; i < vport->num_rxq_grp; i++) {
|
||||
const struct idpf_rxq_group *grp = &vport->rxq_grps[i];
|
||||
for (u32 i = 0; i < rsrc->num_rxq_grp; i++) {
|
||||
const struct idpf_rxq_group *grp = &rsrc->rxq_grps[i];
|
||||
|
||||
for (u32 j = 0; j < vport->num_bufqs_per_qgrp; j++) {
|
||||
for (u32 j = 0; j < rsrc->num_bufqs_per_qgrp; j++) {
|
||||
if (&grp->splitq.bufq_sets[j].bufq == bufq) {
|
||||
qid = grp->splitq.rxq_sets[0]->rxq.idx;
|
||||
goto setup;
|
||||
@@ -61,7 +62,7 @@ static void idpf_xsk_setup_txq(const struct idpf_vport *vport,
|
||||
if (!idpf_queue_has(XDP, txq))
|
||||
return;
|
||||
|
||||
qid = txq->idx - vport->xdp_txq_offset;
|
||||
qid = txq->idx - vport->dflt_qv_rsrc.xdp_txq_offset;
|
||||
|
||||
pool = xsk_get_pool_from_qid(vport->netdev, qid);
|
||||
if (!pool || !pool->dev)
|
||||
@@ -86,7 +87,8 @@ static void idpf_xsk_setup_complq(const struct idpf_vport *vport,
|
||||
if (!idpf_queue_has(XDP, complq))
|
||||
return;
|
||||
|
||||
qid = complq->txq_grp->txqs[0]->idx - vport->xdp_txq_offset;
|
||||
qid = complq->txq_grp->txqs[0]->idx -
|
||||
vport->dflt_qv_rsrc.xdp_txq_offset;
|
||||
|
||||
pool = xsk_get_pool_from_qid(vport->netdev, qid);
|
||||
if (!pool || !pool->dev)
|
||||
|
||||
Reference in New Issue
Block a user