From: Xinying Yu <xinying...@corigine.com>

Reconfigure the NIC will fail because lack of the
initialization logic of queue configuration pointer.
Fix this by adding the correct initialization logic.

Fixes: d89f4990c14e ("vdpa/nfp: add hardware init")
Cc: chaoyong...@corigine.com
Cc: sta...@dpdk.org

Signed-off-by: Xinying Yu <xinying...@corigine.com>
Reviewed-by: Chaoyong He <chaoyong...@corigine.com>
Reviewed-by: Long Wu <long...@corigine.com>
Reviewed-by: Peng Zhang <peng.zh...@corigine.com>
---
 drivers/vdpa/nfp/nfp_vdpa_core.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/vdpa/nfp/nfp_vdpa_core.c b/drivers/vdpa/nfp/nfp_vdpa_core.c
index 7b877605e4..291798196c 100644
--- a/drivers/vdpa/nfp/nfp_vdpa_core.c
+++ b/drivers/vdpa/nfp/nfp_vdpa_core.c
@@ -55,7 +55,10 @@ nfp_vdpa_hw_init(struct nfp_vdpa_hw *vdpa_hw,
                struct rte_pci_device *pci_dev)
 {
        uint32_t queue;
+       uint8_t *tx_bar;
+       uint32_t start_q;
        struct nfp_hw *hw;
+       uint32_t tx_bar_off;
        uint8_t *notify_base;
 
        hw = &vdpa_hw->super;
@@ -82,6 +85,12 @@ nfp_vdpa_hw_init(struct nfp_vdpa_hw *vdpa_hw,
                                idx + 1, vdpa_hw->notify_addr[idx + 1]);
        }
 
+       /* NFP vDPA cfg queue setup */
+       start_q = nn_cfg_readl(hw, NFP_NET_CFG_START_TXQ);
+       tx_bar_off = start_q * NFP_QCP_QUEUE_ADDR_SZ;
+       tx_bar = (uint8_t *)pci_dev->mem_resource[2].addr + tx_bar_off;
+       hw->qcp_cfg = tx_bar + NFP_QCP_QUEUE_ADDR_SZ;
+
        vdpa_hw->features = (1ULL << VIRTIO_F_VERSION_1) |
                        (1ULL << VIRTIO_F_IN_ORDER) |
                        (1ULL << VHOST_USER_F_PROTOCOL_FEATURES);
-- 
2.39.1

Reply via email to