From: Rasesh Mody Date: Thu, 5 Jan 2017 07:03:50 +0000 (-0800) Subject: net/qede/base: fix updating VF queue zone id X-Git-Tag: spdx-start~4894 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=7d8fddd4da06f8577a6ae558244c821ac4fed4d7;p=dpdk.git net/qede/base: fix updating VF queue zone id Pass the absolute qzone_id when creating queues. Fixes: 5cdd769a26ec ("qede: add L2 support") Signed-off-by: Rasesh Mody --- diff --git a/drivers/net/qede/base/ecore_dev.c b/drivers/net/qede/base/ecore_dev.c index 1d906b73f3..8b7d1da0e4 100644 --- a/drivers/net/qede/base/ecore_dev.c +++ b/drivers/net/qede/base/ecore_dev.c @@ -542,11 +542,14 @@ enum _ecore_status_t ecore_resc_alloc(struct ecore_dev *p_dev) /* Allocate Memory for the Queue->CID mapping */ for_each_hwfn(p_dev, i) { struct ecore_hwfn *p_hwfn = &p_dev->hwfns[i]; + u32 num_tx_conns = RESC_NUM(p_hwfn, ECORE_L2_QUEUE); + int tx_size, rx_size; /* @@@TMP - resc management, change to actual required size */ - int tx_size = sizeof(struct ecore_hw_cid_data) * - RESC_NUM(p_hwfn, ECORE_L2_QUEUE); - int rx_size = sizeof(struct ecore_hw_cid_data) * + if (p_hwfn->pf_params.eth_pf_params.num_cons > num_tx_conns) + num_tx_conns = p_hwfn->pf_params.eth_pf_params.num_cons; + tx_size = sizeof(struct ecore_hw_cid_data) * num_tx_conns; + rx_size = sizeof(struct ecore_hw_cid_data) * RESC_NUM(p_hwfn, ECORE_L2_QUEUE); p_hwfn->p_tx_cids = OSAL_ZALLOC(p_hwfn->p_dev, GFP_KERNEL, diff --git a/drivers/net/qede/base/ecore_l2.c b/drivers/net/qede/base/ecore_l2.c index b139c3987a..9cb554c676 100644 --- a/drivers/net/qede/base/ecore_l2.c +++ b/drivers/net/qede/base/ecore_l2.c @@ -663,7 +663,7 @@ ecore_sp_eth_rx_queue_start(struct ecore_hwfn *p_hwfn, if (IS_VF(p_hwfn->p_dev)) { return ecore_vf_pf_rxq_start(p_hwfn, - p_params->queue_id, + (u8)p_params->queue_id, p_params->sb, (u8)p_params->sb_idx, bd_max_bytes, @@ -840,9 +840,9 @@ ecore_sp_eth_txq_start_ramrod(struct ecore_hwfn *p_hwfn, struct ecore_spq_entry *p_ent = OSAL_NULL; struct ecore_sp_init_data init_data; struct ecore_hw_cid_data *p_tx_cid; - u16 pq_id, abs_tx_q_id = 0; - u8 abs_vport_id; + u16 pq_id, abs_tx_qzone_id = 0; enum _ecore_status_t rc = ECORE_NOTIMPL; + u8 abs_vport_id; /* Store information for the stop */ p_tx_cid = &p_hwfn->p_tx_cids[p_params->queue_id]; @@ -853,7 +853,7 @@ ecore_sp_eth_txq_start_ramrod(struct ecore_hwfn *p_hwfn, if (rc != ECORE_SUCCESS) return rc; - rc = ecore_fw_l2_queue(p_hwfn, p_params->queue_id, &abs_tx_q_id); + rc = ecore_fw_l2_queue(p_hwfn, p_params->qzone_id, &abs_tx_qzone_id); if (rc != ECORE_SUCCESS) return rc; @@ -876,7 +876,7 @@ ecore_sp_eth_txq_start_ramrod(struct ecore_hwfn *p_hwfn, p_ramrod->sb_index = (u8)p_params->sb_idx; p_ramrod->stats_counter_id = p_params->stats_id; - p_ramrod->queue_zone_id = OSAL_CPU_TO_LE16(abs_tx_q_id); + p_ramrod->queue_zone_id = OSAL_CPU_TO_LE16(abs_tx_qzone_id); p_ramrod->pbl_size = OSAL_CPU_TO_LE16(pbl_size); DMA_REGPAIR_LE(p_ramrod->pbl_base_addr, pbl_addr); diff --git a/drivers/net/qede/base/ecore_l2_api.h b/drivers/net/qede/base/ecore_l2_api.h index c12d97c9f4..247316b8fd 100644 --- a/drivers/net/qede/base/ecore_l2_api.h +++ b/drivers/net/qede/base/ecore_l2_api.h @@ -28,10 +28,17 @@ enum ecore_rss_caps { #endif struct ecore_queue_start_common_params { - /* Rx/Tx queue id */ - u8 queue_id; + /* Rx/Tx queue relative id to keep obtained cid in corresponding array + * RX - upper-bounded by number of FW-queues + */ + u16 queue_id; u8 vport_id; + /* q_zone_id is relative, may be different from queue id + * currently used by Tx-only, upper-bounded by number of FW-queues + */ + u8 qzone_id; + /* stats_id is relative or absolute depends on function */ u8 stats_id; u16 sb; diff --git a/drivers/net/qede/base/ecore_sriov.c b/drivers/net/qede/base/ecore_sriov.c index bdf916471d..0e2b324888 100644 --- a/drivers/net/qede/base/ecore_sriov.c +++ b/drivers/net/qede/base/ecore_sriov.c @@ -2107,6 +2107,7 @@ static void ecore_iov_vf_mbx_start_txq(struct ecore_hwfn *p_hwfn, goto out; p_params.queue_id = (u8)vf->vf_queues[req->tx_qid].fw_tx_qid; + p_params.qzone_id = (u8)vf->vf_queues[req->tx_qid].fw_tx_qid; p_params.vport_id = vf->vport_id; p_params.stats_id = vf->abs_vf_id + 0x10, p_params.sb = req->hw_sb; diff --git a/drivers/net/qede/qede_eth_if.c b/drivers/net/qede/qede_eth_if.c index 7d212003a5..d0f6e87ae4 100644 --- a/drivers/net/qede/qede_eth_if.c +++ b/drivers/net/qede/qede_eth_if.c @@ -213,6 +213,7 @@ qed_start_txq(struct ecore_dev *edev, p_hwfn = &edev->hwfns[hwfn_index]; p_params->queue_id = p_params->queue_id / edev->num_hwfns; + p_params->qzone_id = p_params->queue_id; p_params->stats_id = p_params->vport_id; rc = ecore_sp_eth_tx_queue_start(p_hwfn,