1cb7dd712SShinas Rasheed // SPDX-License-Identifier: GPL-2.0
2cb7dd712SShinas Rasheed /* Marvell Octeon EP (EndPoint) VF Ethernet Driver
3cb7dd712SShinas Rasheed *
4cb7dd712SShinas Rasheed * Copyright (C) 2020 Marvell.
5cb7dd712SShinas Rasheed *
6cb7dd712SShinas Rasheed */
7cb7dd712SShinas Rasheed
8cb7dd712SShinas Rasheed #include <linux/pci.h>
9cb7dd712SShinas Rasheed #include <linux/netdevice.h>
10cb7dd712SShinas Rasheed #include <linux/etherdevice.h>
11cb7dd712SShinas Rasheed
12cb7dd712SShinas Rasheed #include "octep_vf_config.h"
13cb7dd712SShinas Rasheed #include "octep_vf_main.h"
14cb7dd712SShinas Rasheed #include "octep_vf_regs_cnxk.h"
15cb7dd712SShinas Rasheed
162c0c32c7SShinas Rasheed /* Dump useful hardware IQ/OQ CSRs for debug purpose */
cnxk_vf_dump_q_regs(struct octep_vf_device * oct,int qno)172c0c32c7SShinas Rasheed static void cnxk_vf_dump_q_regs(struct octep_vf_device *oct, int qno)
182c0c32c7SShinas Rasheed {
192c0c32c7SShinas Rasheed struct device *dev = &oct->pdev->dev;
202c0c32c7SShinas Rasheed
212c0c32c7SShinas Rasheed dev_info(dev, "IQ-%d register dump\n", qno);
222c0c32c7SShinas Rasheed dev_info(dev, "R[%d]_IN_INSTR_DBELL[0x%llx]: 0x%016llx\n",
232c0c32c7SShinas Rasheed qno, CNXK_VF_SDP_R_IN_INSTR_DBELL(qno),
242c0c32c7SShinas Rasheed octep_vf_read_csr64(oct, CNXK_VF_SDP_R_IN_INSTR_DBELL(qno)));
252c0c32c7SShinas Rasheed dev_info(dev, "R[%d]_IN_CONTROL[0x%llx]: 0x%016llx\n",
262c0c32c7SShinas Rasheed qno, CNXK_VF_SDP_R_IN_CONTROL(qno),
272c0c32c7SShinas Rasheed octep_vf_read_csr64(oct, CNXK_VF_SDP_R_IN_CONTROL(qno)));
282c0c32c7SShinas Rasheed dev_info(dev, "R[%d]_IN_ENABLE[0x%llx]: 0x%016llx\n",
292c0c32c7SShinas Rasheed qno, CNXK_VF_SDP_R_IN_ENABLE(qno),
302c0c32c7SShinas Rasheed octep_vf_read_csr64(oct, CNXK_VF_SDP_R_IN_ENABLE(qno)));
312c0c32c7SShinas Rasheed dev_info(dev, "R[%d]_IN_INSTR_BADDR[0x%llx]: 0x%016llx\n",
322c0c32c7SShinas Rasheed qno, CNXK_VF_SDP_R_IN_INSTR_BADDR(qno),
332c0c32c7SShinas Rasheed octep_vf_read_csr64(oct, CNXK_VF_SDP_R_IN_INSTR_BADDR(qno)));
342c0c32c7SShinas Rasheed dev_info(dev, "R[%d]_IN_INSTR_RSIZE[0x%llx]: 0x%016llx\n",
352c0c32c7SShinas Rasheed qno, CNXK_VF_SDP_R_IN_INSTR_RSIZE(qno),
362c0c32c7SShinas Rasheed octep_vf_read_csr64(oct, CNXK_VF_SDP_R_IN_INSTR_RSIZE(qno)));
372c0c32c7SShinas Rasheed dev_info(dev, "R[%d]_IN_CNTS[0x%llx]: 0x%016llx\n",
382c0c32c7SShinas Rasheed qno, CNXK_VF_SDP_R_IN_CNTS(qno),
392c0c32c7SShinas Rasheed octep_vf_read_csr64(oct, CNXK_VF_SDP_R_IN_CNTS(qno)));
402c0c32c7SShinas Rasheed dev_info(dev, "R[%d]_IN_INT_LEVELS[0x%llx]: 0x%016llx\n",
412c0c32c7SShinas Rasheed qno, CNXK_VF_SDP_R_IN_INT_LEVELS(qno),
422c0c32c7SShinas Rasheed octep_vf_read_csr64(oct, CNXK_VF_SDP_R_IN_INT_LEVELS(qno)));
432c0c32c7SShinas Rasheed dev_info(dev, "R[%d]_IN_PKT_CNT[0x%llx]: 0x%016llx\n",
442c0c32c7SShinas Rasheed qno, CNXK_VF_SDP_R_IN_PKT_CNT(qno),
452c0c32c7SShinas Rasheed octep_vf_read_csr64(oct, CNXK_VF_SDP_R_IN_PKT_CNT(qno)));
462c0c32c7SShinas Rasheed dev_info(dev, "R[%d]_IN_BYTE_CNT[0x%llx]: 0x%016llx\n",
472c0c32c7SShinas Rasheed qno, CNXK_VF_SDP_R_IN_BYTE_CNT(qno),
482c0c32c7SShinas Rasheed octep_vf_read_csr64(oct, CNXK_VF_SDP_R_IN_BYTE_CNT(qno)));
492c0c32c7SShinas Rasheed
502c0c32c7SShinas Rasheed dev_info(dev, "OQ-%d register dump\n", qno);
512c0c32c7SShinas Rasheed dev_info(dev, "R[%d]_OUT_SLIST_DBELL[0x%llx]: 0x%016llx\n",
522c0c32c7SShinas Rasheed qno, CNXK_VF_SDP_R_OUT_SLIST_DBELL(qno),
532c0c32c7SShinas Rasheed octep_vf_read_csr64(oct, CNXK_VF_SDP_R_OUT_SLIST_DBELL(qno)));
542c0c32c7SShinas Rasheed dev_info(dev, "R[%d]_OUT_CONTROL[0x%llx]: 0x%016llx\n",
552c0c32c7SShinas Rasheed qno, CNXK_VF_SDP_R_OUT_CONTROL(qno),
562c0c32c7SShinas Rasheed octep_vf_read_csr64(oct, CNXK_VF_SDP_R_OUT_CONTROL(qno)));
572c0c32c7SShinas Rasheed dev_info(dev, "R[%d]_OUT_ENABLE[0x%llx]: 0x%016llx\n",
582c0c32c7SShinas Rasheed qno, CNXK_VF_SDP_R_OUT_ENABLE(qno),
592c0c32c7SShinas Rasheed octep_vf_read_csr64(oct, CNXK_VF_SDP_R_OUT_ENABLE(qno)));
602c0c32c7SShinas Rasheed dev_info(dev, "R[%d]_OUT_SLIST_BADDR[0x%llx]: 0x%016llx\n",
612c0c32c7SShinas Rasheed qno, CNXK_VF_SDP_R_OUT_SLIST_BADDR(qno),
622c0c32c7SShinas Rasheed octep_vf_read_csr64(oct, CNXK_VF_SDP_R_OUT_SLIST_BADDR(qno)));
632c0c32c7SShinas Rasheed dev_info(dev, "R[%d]_OUT_SLIST_RSIZE[0x%llx]: 0x%016llx\n",
642c0c32c7SShinas Rasheed qno, CNXK_VF_SDP_R_OUT_SLIST_RSIZE(qno),
652c0c32c7SShinas Rasheed octep_vf_read_csr64(oct, CNXK_VF_SDP_R_OUT_SLIST_RSIZE(qno)));
662c0c32c7SShinas Rasheed dev_info(dev, "R[%d]_OUT_CNTS[0x%llx]: 0x%016llx\n",
672c0c32c7SShinas Rasheed qno, CNXK_VF_SDP_R_OUT_CNTS(qno),
682c0c32c7SShinas Rasheed octep_vf_read_csr64(oct, CNXK_VF_SDP_R_OUT_CNTS(qno)));
692c0c32c7SShinas Rasheed dev_info(dev, "R[%d]_OUT_INT_LEVELS[0x%llx]: 0x%016llx\n",
702c0c32c7SShinas Rasheed qno, CNXK_VF_SDP_R_OUT_INT_LEVELS(qno),
712c0c32c7SShinas Rasheed octep_vf_read_csr64(oct, CNXK_VF_SDP_R_OUT_INT_LEVELS(qno)));
722c0c32c7SShinas Rasheed dev_info(dev, "R[%d]_OUT_PKT_CNT[0x%llx]: 0x%016llx\n",
732c0c32c7SShinas Rasheed qno, CNXK_VF_SDP_R_OUT_PKT_CNT(qno),
742c0c32c7SShinas Rasheed octep_vf_read_csr64(oct, CNXK_VF_SDP_R_OUT_PKT_CNT(qno)));
752c0c32c7SShinas Rasheed dev_info(dev, "R[%d]_OUT_BYTE_CNT[0x%llx]: 0x%016llx\n",
762c0c32c7SShinas Rasheed qno, CNXK_VF_SDP_R_OUT_BYTE_CNT(qno),
772c0c32c7SShinas Rasheed octep_vf_read_csr64(oct, CNXK_VF_SDP_R_OUT_BYTE_CNT(qno)));
782c0c32c7SShinas Rasheed dev_info(dev, "R[%d]_ERR_TYPE[0x%llx]: 0x%016llx\n",
792c0c32c7SShinas Rasheed qno, CNXK_VF_SDP_R_ERR_TYPE(qno),
802c0c32c7SShinas Rasheed octep_vf_read_csr64(oct, CNXK_VF_SDP_R_ERR_TYPE(qno)));
812c0c32c7SShinas Rasheed }
822c0c32c7SShinas Rasheed
832c0c32c7SShinas Rasheed /* Reset Hardware Tx queue */
cnxk_vf_reset_iq(struct octep_vf_device * oct,int q_no)842c0c32c7SShinas Rasheed static void cnxk_vf_reset_iq(struct octep_vf_device *oct, int q_no)
852c0c32c7SShinas Rasheed {
862c0c32c7SShinas Rasheed u64 val = ULL(0);
872c0c32c7SShinas Rasheed
882c0c32c7SShinas Rasheed dev_dbg(&oct->pdev->dev, "Reset VF IQ-%d\n", q_no);
892c0c32c7SShinas Rasheed
902c0c32c7SShinas Rasheed /* Disable the Tx/Instruction Ring */
912c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_IN_ENABLE(q_no), val);
922c0c32c7SShinas Rasheed
932c0c32c7SShinas Rasheed /* clear the Instruction Ring packet/byte counts and doorbell CSRs */
942c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_IN_INT_LEVELS(q_no), val);
952c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_IN_PKT_CNT(q_no), val);
962c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_IN_BYTE_CNT(q_no), val);
972c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_IN_INSTR_BADDR(q_no), val);
982c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_IN_INSTR_RSIZE(q_no), val);
992c0c32c7SShinas Rasheed
1002c0c32c7SShinas Rasheed val = GENMASK_ULL(31, 0);
1012c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_IN_INSTR_DBELL(q_no), val);
1022c0c32c7SShinas Rasheed
1032c0c32c7SShinas Rasheed val = octep_vf_read_csr64(oct, CNXK_VF_SDP_R_IN_CNTS(q_no));
1042c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_IN_CNTS(q_no), val & GENMASK_ULL(31, 0));
1052c0c32c7SShinas Rasheed }
1062c0c32c7SShinas Rasheed
1072c0c32c7SShinas Rasheed /* Reset Hardware Rx queue */
cnxk_vf_reset_oq(struct octep_vf_device * oct,int q_no)1082c0c32c7SShinas Rasheed static void cnxk_vf_reset_oq(struct octep_vf_device *oct, int q_no)
1092c0c32c7SShinas Rasheed {
1102c0c32c7SShinas Rasheed u64 val = ULL(0);
1112c0c32c7SShinas Rasheed
1122c0c32c7SShinas Rasheed /* Disable Output (Rx) Ring */
1132c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_OUT_ENABLE(q_no), val);
1142c0c32c7SShinas Rasheed
1152c0c32c7SShinas Rasheed /* Clear count CSRs */
1162c0c32c7SShinas Rasheed val = octep_vf_read_csr(oct, CNXK_VF_SDP_R_OUT_CNTS(q_no));
1172c0c32c7SShinas Rasheed octep_vf_write_csr(oct, CNXK_VF_SDP_R_OUT_CNTS(q_no), val);
1182c0c32c7SShinas Rasheed
1192c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_OUT_PKT_CNT(q_no), GENMASK_ULL(35, 0));
1202c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_OUT_SLIST_DBELL(q_no), GENMASK_ULL(31, 0));
1212c0c32c7SShinas Rasheed }
1222c0c32c7SShinas Rasheed
123cb7dd712SShinas Rasheed /* Reset all hardware Tx/Rx queues */
octep_vf_reset_io_queues_cnxk(struct octep_vf_device * oct)124cb7dd712SShinas Rasheed static void octep_vf_reset_io_queues_cnxk(struct octep_vf_device *oct)
125cb7dd712SShinas Rasheed {
1262c0c32c7SShinas Rasheed struct pci_dev *pdev = oct->pdev;
1272c0c32c7SShinas Rasheed int q;
1282c0c32c7SShinas Rasheed
1292c0c32c7SShinas Rasheed dev_dbg(&pdev->dev, "Reset OCTEP_CNXK VF IO Queues\n");
1302c0c32c7SShinas Rasheed
1312c0c32c7SShinas Rasheed for (q = 0; q < CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf); q++) {
1322c0c32c7SShinas Rasheed cnxk_vf_reset_iq(oct, q);
1332c0c32c7SShinas Rasheed cnxk_vf_reset_oq(oct, q);
1342c0c32c7SShinas Rasheed }
135cb7dd712SShinas Rasheed }
136cb7dd712SShinas Rasheed
137cb7dd712SShinas Rasheed /* Initialize configuration limits and initial active config */
octep_vf_init_config_cnxk_vf(struct octep_vf_device * oct)138cb7dd712SShinas Rasheed static void octep_vf_init_config_cnxk_vf(struct octep_vf_device *oct)
139cb7dd712SShinas Rasheed {
140cb7dd712SShinas Rasheed struct octep_vf_config *conf = oct->conf;
141cb7dd712SShinas Rasheed u64 reg_val;
142cb7dd712SShinas Rasheed
143cb7dd712SShinas Rasheed reg_val = octep_vf_read_csr64(oct, CNXK_VF_SDP_R_IN_CONTROL(0));
144cb7dd712SShinas Rasheed conf->ring_cfg.max_io_rings = (reg_val >> CNXK_VF_R_IN_CTL_RPVF_POS) &
145cb7dd712SShinas Rasheed CNXK_VF_R_IN_CTL_RPVF_MASK;
146cb7dd712SShinas Rasheed conf->ring_cfg.active_io_rings = conf->ring_cfg.max_io_rings;
147cb7dd712SShinas Rasheed
148cb7dd712SShinas Rasheed conf->iq.num_descs = OCTEP_VF_IQ_MAX_DESCRIPTORS;
149cb7dd712SShinas Rasheed conf->iq.instr_type = OCTEP_VF_64BYTE_INSTR;
150cb7dd712SShinas Rasheed conf->iq.db_min = OCTEP_VF_DB_MIN;
151cb7dd712SShinas Rasheed conf->iq.intr_threshold = OCTEP_VF_IQ_INTR_THRESHOLD;
152cb7dd712SShinas Rasheed
153cb7dd712SShinas Rasheed conf->oq.num_descs = OCTEP_VF_OQ_MAX_DESCRIPTORS;
154cb7dd712SShinas Rasheed conf->oq.buf_size = OCTEP_VF_OQ_BUF_SIZE;
155cb7dd712SShinas Rasheed conf->oq.refill_threshold = OCTEP_VF_OQ_REFILL_THRESHOLD;
156cb7dd712SShinas Rasheed conf->oq.oq_intr_pkt = OCTEP_VF_OQ_INTR_PKT_THRESHOLD;
157cb7dd712SShinas Rasheed conf->oq.oq_intr_time = OCTEP_VF_OQ_INTR_TIME_THRESHOLD;
158cb7dd712SShinas Rasheed conf->oq.wmark = OCTEP_VF_OQ_WMARK_MIN;
159cb7dd712SShinas Rasheed
160cb7dd712SShinas Rasheed conf->msix_cfg.ioq_msix = conf->ring_cfg.active_io_rings;
161cb7dd712SShinas Rasheed }
162cb7dd712SShinas Rasheed
163cb7dd712SShinas Rasheed /* Setup registers for a hardware Tx Queue */
octep_vf_setup_iq_regs_cnxk(struct octep_vf_device * oct,int iq_no)164cb7dd712SShinas Rasheed static void octep_vf_setup_iq_regs_cnxk(struct octep_vf_device *oct, int iq_no)
165cb7dd712SShinas Rasheed {
1662c0c32c7SShinas Rasheed struct octep_vf_iq *iq = oct->iq[iq_no];
1672c0c32c7SShinas Rasheed u32 reset_instr_cnt;
1682c0c32c7SShinas Rasheed u64 reg_val;
1692c0c32c7SShinas Rasheed
1702c0c32c7SShinas Rasheed reg_val = octep_vf_read_csr64(oct, CNXK_VF_SDP_R_IN_CONTROL(iq_no));
1712c0c32c7SShinas Rasheed
1722c0c32c7SShinas Rasheed /* wait for IDLE to set to 1 */
1732c0c32c7SShinas Rasheed if (!(reg_val & CNXK_VF_R_IN_CTL_IDLE)) {
1742c0c32c7SShinas Rasheed do {
1752c0c32c7SShinas Rasheed reg_val = octep_vf_read_csr64(oct, CNXK_VF_SDP_R_IN_CONTROL(iq_no));
1762c0c32c7SShinas Rasheed } while (!(reg_val & CNXK_VF_R_IN_CTL_IDLE));
1772c0c32c7SShinas Rasheed }
1782c0c32c7SShinas Rasheed reg_val |= CNXK_VF_R_IN_CTL_RDSIZE;
1792c0c32c7SShinas Rasheed reg_val |= CNXK_VF_R_IN_CTL_IS_64B;
1802c0c32c7SShinas Rasheed reg_val |= CNXK_VF_R_IN_CTL_ESR;
1812c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_IN_CONTROL(iq_no), reg_val);
1822c0c32c7SShinas Rasheed
1832c0c32c7SShinas Rasheed /* Write the start of the input queue's ring and its size */
1842c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_IN_INSTR_BADDR(iq_no), iq->desc_ring_dma);
1852c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_IN_INSTR_RSIZE(iq_no), iq->max_count);
1862c0c32c7SShinas Rasheed
1872c0c32c7SShinas Rasheed /* Remember the doorbell & instruction count register addr for this queue */
1882c0c32c7SShinas Rasheed iq->doorbell_reg = oct->mmio.hw_addr + CNXK_VF_SDP_R_IN_INSTR_DBELL(iq_no);
1892c0c32c7SShinas Rasheed iq->inst_cnt_reg = oct->mmio.hw_addr + CNXK_VF_SDP_R_IN_CNTS(iq_no);
1902c0c32c7SShinas Rasheed iq->intr_lvl_reg = oct->mmio.hw_addr + CNXK_VF_SDP_R_IN_INT_LEVELS(iq_no);
1912c0c32c7SShinas Rasheed
1922c0c32c7SShinas Rasheed /* Store the current instruction counter (used in flush_iq calculation) */
1932c0c32c7SShinas Rasheed reset_instr_cnt = readl(iq->inst_cnt_reg);
1942c0c32c7SShinas Rasheed writel(reset_instr_cnt, iq->inst_cnt_reg);
1952c0c32c7SShinas Rasheed
1962c0c32c7SShinas Rasheed /* INTR_THRESHOLD is set to max(FFFFFFFF) to disable the INTR */
1972c0c32c7SShinas Rasheed reg_val = CFG_GET_IQ_INTR_THRESHOLD(oct->conf) & GENMASK_ULL(31, 0);
1982c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_IN_INT_LEVELS(iq_no), reg_val);
199cb7dd712SShinas Rasheed }
200cb7dd712SShinas Rasheed
201cb7dd712SShinas Rasheed /* Setup registers for a hardware Rx Queue */
octep_vf_setup_oq_regs_cnxk(struct octep_vf_device * oct,int oq_no)202cb7dd712SShinas Rasheed static void octep_vf_setup_oq_regs_cnxk(struct octep_vf_device *oct, int oq_no)
203cb7dd712SShinas Rasheed {
2042c0c32c7SShinas Rasheed struct octep_vf_oq *oq = oct->oq[oq_no];
2052c0c32c7SShinas Rasheed u32 time_threshold = 0;
2062c0c32c7SShinas Rasheed u64 oq_ctl = ULL(0);
2072c0c32c7SShinas Rasheed u64 reg_val;
2082c0c32c7SShinas Rasheed
2092c0c32c7SShinas Rasheed reg_val = octep_vf_read_csr64(oct, CNXK_VF_SDP_R_OUT_CONTROL(oq_no));
2102c0c32c7SShinas Rasheed
2112c0c32c7SShinas Rasheed /* wait for IDLE to set to 1 */
2122c0c32c7SShinas Rasheed if (!(reg_val & CNXK_VF_R_OUT_CTL_IDLE)) {
2132c0c32c7SShinas Rasheed do {
2142c0c32c7SShinas Rasheed reg_val = octep_vf_read_csr64(oct, CNXK_VF_SDP_R_OUT_CONTROL(oq_no));
2152c0c32c7SShinas Rasheed } while (!(reg_val & CNXK_VF_R_OUT_CTL_IDLE));
2162c0c32c7SShinas Rasheed }
2172c0c32c7SShinas Rasheed
2182c0c32c7SShinas Rasheed reg_val &= ~(CNXK_VF_R_OUT_CTL_IMODE);
2192c0c32c7SShinas Rasheed reg_val &= ~(CNXK_VF_R_OUT_CTL_ROR_P);
2202c0c32c7SShinas Rasheed reg_val &= ~(CNXK_VF_R_OUT_CTL_NSR_P);
2212c0c32c7SShinas Rasheed reg_val &= ~(CNXK_VF_R_OUT_CTL_ROR_I);
2222c0c32c7SShinas Rasheed reg_val &= ~(CNXK_VF_R_OUT_CTL_NSR_I);
2232c0c32c7SShinas Rasheed reg_val &= ~(CNXK_VF_R_OUT_CTL_ES_I);
2242c0c32c7SShinas Rasheed reg_val &= ~(CNXK_VF_R_OUT_CTL_ROR_D);
2252c0c32c7SShinas Rasheed reg_val &= ~(CNXK_VF_R_OUT_CTL_NSR_D);
2262c0c32c7SShinas Rasheed reg_val &= ~(CNXK_VF_R_OUT_CTL_ES_D);
2272c0c32c7SShinas Rasheed reg_val |= (CNXK_VF_R_OUT_CTL_ES_P);
2282c0c32c7SShinas Rasheed
2292c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_OUT_CONTROL(oq_no), reg_val);
2302c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_OUT_SLIST_BADDR(oq_no), oq->desc_ring_dma);
2312c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_OUT_SLIST_RSIZE(oq_no), oq->max_count);
2322c0c32c7SShinas Rasheed
2332c0c32c7SShinas Rasheed oq_ctl = octep_vf_read_csr64(oct, CNXK_VF_SDP_R_OUT_CONTROL(oq_no));
2342c0c32c7SShinas Rasheed /* Clear the ISIZE and BSIZE (22-0) */
2352c0c32c7SShinas Rasheed oq_ctl &= ~GENMASK_ULL(22, 0);
2362c0c32c7SShinas Rasheed /* Populate the BSIZE (15-0) */
2372c0c32c7SShinas Rasheed oq_ctl |= (oq->buffer_size & GENMASK_ULL(15, 0));
2382c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_OUT_CONTROL(oq_no), oq_ctl);
2392c0c32c7SShinas Rasheed
2402c0c32c7SShinas Rasheed /* Get the mapped address of the pkt_sent and pkts_credit regs */
2412c0c32c7SShinas Rasheed oq->pkts_sent_reg = oct->mmio.hw_addr + CNXK_VF_SDP_R_OUT_CNTS(oq_no);
2422c0c32c7SShinas Rasheed oq->pkts_credit_reg = oct->mmio.hw_addr + CNXK_VF_SDP_R_OUT_SLIST_DBELL(oq_no);
2432c0c32c7SShinas Rasheed
2442c0c32c7SShinas Rasheed time_threshold = CFG_GET_OQ_INTR_TIME(oct->conf);
2452c0c32c7SShinas Rasheed reg_val = ((u64)time_threshold << 32) | CFG_GET_OQ_INTR_PKT(oct->conf);
2462c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_OUT_INT_LEVELS(oq_no), reg_val);
2472c0c32c7SShinas Rasheed
2482c0c32c7SShinas Rasheed /* set watermark for backpressure */
2492c0c32c7SShinas Rasheed reg_val = octep_vf_read_csr64(oct, CNXK_VF_SDP_R_OUT_WMARK(oq_no));
2502c0c32c7SShinas Rasheed reg_val &= ~GENMASK_ULL(31, 0);
2512c0c32c7SShinas Rasheed reg_val |= CFG_GET_OQ_WMARK(oct->conf);
2522c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_OUT_WMARK(oq_no), reg_val);
253cb7dd712SShinas Rasheed }
254cb7dd712SShinas Rasheed
255cb7dd712SShinas Rasheed /* Setup registers for a VF mailbox */
octep_vf_setup_mbox_regs_cnxk(struct octep_vf_device * oct,int q_no)256cb7dd712SShinas Rasheed static void octep_vf_setup_mbox_regs_cnxk(struct octep_vf_device *oct, int q_no)
257cb7dd712SShinas Rasheed {
2582c0c32c7SShinas Rasheed struct octep_vf_mbox *mbox = oct->mbox;
2592c0c32c7SShinas Rasheed
2602c0c32c7SShinas Rasheed /* PF to VF DATA reg. VF reads from this reg */
2612c0c32c7SShinas Rasheed mbox->mbox_read_reg = oct->mmio.hw_addr + CNXK_VF_SDP_R_MBOX_PF_VF_DATA(q_no);
2622c0c32c7SShinas Rasheed
2632c0c32c7SShinas Rasheed /* VF mbox interrupt reg */
2642c0c32c7SShinas Rasheed mbox->mbox_int_reg = oct->mmio.hw_addr + CNXK_VF_SDP_R_MBOX_PF_VF_INT(q_no);
2652c0c32c7SShinas Rasheed
2662c0c32c7SShinas Rasheed /* VF to PF DATA reg. VF writes into this reg */
2672c0c32c7SShinas Rasheed mbox->mbox_write_reg = oct->mmio.hw_addr + CNXK_VF_SDP_R_MBOX_VF_PF_DATA(q_no);
2682c0c32c7SShinas Rasheed }
2692c0c32c7SShinas Rasheed
2702c0c32c7SShinas Rasheed /* Mailbox Interrupt handler */
cnxk_handle_vf_mbox_intr(struct octep_vf_device * oct)2712c0c32c7SShinas Rasheed static void cnxk_handle_vf_mbox_intr(struct octep_vf_device *oct)
2722c0c32c7SShinas Rasheed {
2732c0c32c7SShinas Rasheed if (oct->mbox)
2742c0c32c7SShinas Rasheed schedule_work(&oct->mbox->wk.work);
2752c0c32c7SShinas Rasheed else
2762c0c32c7SShinas Rasheed dev_err(&oct->pdev->dev, "cannot schedule work on invalid mbox\n");
277cb7dd712SShinas Rasheed }
278cb7dd712SShinas Rasheed
279cb7dd712SShinas Rasheed /* Tx/Rx queue interrupt handler */
octep_vf_ioq_intr_handler_cnxk(void * data)280cb7dd712SShinas Rasheed static irqreturn_t octep_vf_ioq_intr_handler_cnxk(void *data)
281cb7dd712SShinas Rasheed {
2822c0c32c7SShinas Rasheed struct octep_vf_ioq_vector *vector = data;
2832c0c32c7SShinas Rasheed struct octep_vf_device *oct;
2842c0c32c7SShinas Rasheed struct octep_vf_oq *oq;
2852c0c32c7SShinas Rasheed u64 reg_val;
2862c0c32c7SShinas Rasheed
2872c0c32c7SShinas Rasheed oct = vector->octep_vf_dev;
2882c0c32c7SShinas Rasheed oq = vector->oq;
2892c0c32c7SShinas Rasheed /* Mailbox interrupt arrives along with interrupt of tx/rx ring pair 0 */
2902c0c32c7SShinas Rasheed if (oq->q_no == 0) {
2912c0c32c7SShinas Rasheed reg_val = octep_vf_read_csr64(oct, CNXK_VF_SDP_R_MBOX_PF_VF_INT(0));
2922c0c32c7SShinas Rasheed if (reg_val & CNXK_VF_SDP_R_MBOX_PF_VF_INT_STATUS) {
2932c0c32c7SShinas Rasheed cnxk_handle_vf_mbox_intr(oct);
2942c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_MBOX_PF_VF_INT(0), reg_val);
2952c0c32c7SShinas Rasheed }
2962c0c32c7SShinas Rasheed }
2972c0c32c7SShinas Rasheed napi_schedule_irqoff(oq->napi);
298cb7dd712SShinas Rasheed return IRQ_HANDLED;
299cb7dd712SShinas Rasheed }
300cb7dd712SShinas Rasheed
301cb7dd712SShinas Rasheed /* Re-initialize Octeon hardware registers */
octep_vf_reinit_regs_cnxk(struct octep_vf_device * oct)302cb7dd712SShinas Rasheed static void octep_vf_reinit_regs_cnxk(struct octep_vf_device *oct)
303cb7dd712SShinas Rasheed {
3042c0c32c7SShinas Rasheed u32 i;
3052c0c32c7SShinas Rasheed
3062c0c32c7SShinas Rasheed for (i = 0; i < CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf); i++)
3072c0c32c7SShinas Rasheed oct->hw_ops.setup_iq_regs(oct, i);
3082c0c32c7SShinas Rasheed
3092c0c32c7SShinas Rasheed for (i = 0; i < CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf); i++)
3102c0c32c7SShinas Rasheed oct->hw_ops.setup_oq_regs(oct, i);
3112c0c32c7SShinas Rasheed
3122c0c32c7SShinas Rasheed oct->hw_ops.enable_interrupts(oct);
3132c0c32c7SShinas Rasheed oct->hw_ops.enable_io_queues(oct);
3142c0c32c7SShinas Rasheed
3152c0c32c7SShinas Rasheed for (i = 0; i < CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf); i++)
3162c0c32c7SShinas Rasheed writel(oct->oq[i]->max_count, oct->oq[i]->pkts_credit_reg);
317cb7dd712SShinas Rasheed }
318cb7dd712SShinas Rasheed
319cb7dd712SShinas Rasheed /* Enable all interrupts */
octep_vf_enable_interrupts_cnxk(struct octep_vf_device * oct)320cb7dd712SShinas Rasheed static void octep_vf_enable_interrupts_cnxk(struct octep_vf_device *oct)
321cb7dd712SShinas Rasheed {
3222c0c32c7SShinas Rasheed int num_rings, q;
3232c0c32c7SShinas Rasheed u64 reg_val;
3242c0c32c7SShinas Rasheed
3252c0c32c7SShinas Rasheed num_rings = CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf);
3262c0c32c7SShinas Rasheed for (q = 0; q < num_rings; q++) {
3272c0c32c7SShinas Rasheed reg_val = octep_vf_read_csr64(oct, CNXK_VF_SDP_R_IN_INT_LEVELS(q));
3282c0c32c7SShinas Rasheed reg_val |= BIT_ULL_MASK(62);
3292c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_IN_INT_LEVELS(q), reg_val);
3302c0c32c7SShinas Rasheed
3312c0c32c7SShinas Rasheed reg_val = octep_vf_read_csr64(oct, CNXK_VF_SDP_R_OUT_INT_LEVELS(q));
3322c0c32c7SShinas Rasheed reg_val |= BIT_ULL_MASK(62);
3332c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_OUT_INT_LEVELS(q), reg_val);
3342c0c32c7SShinas Rasheed }
3352c0c32c7SShinas Rasheed /* Enable PF to VF mbox interrupt by setting 2nd bit*/
3362c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_MBOX_PF_VF_INT(0),
3372c0c32c7SShinas Rasheed CNXK_VF_SDP_R_MBOX_PF_VF_INT_ENAB);
338cb7dd712SShinas Rasheed }
339cb7dd712SShinas Rasheed
340cb7dd712SShinas Rasheed /* Disable all interrupts */
octep_vf_disable_interrupts_cnxk(struct octep_vf_device * oct)341cb7dd712SShinas Rasheed static void octep_vf_disable_interrupts_cnxk(struct octep_vf_device *oct)
342cb7dd712SShinas Rasheed {
3432c0c32c7SShinas Rasheed int num_rings, q;
3442c0c32c7SShinas Rasheed u64 reg_val;
3452c0c32c7SShinas Rasheed
3462c0c32c7SShinas Rasheed /* Disable PF to VF mbox interrupt by setting 2nd bit*/
3472c0c32c7SShinas Rasheed if (oct->mbox)
3482c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_MBOX_PF_VF_INT(0), 0x0);
3492c0c32c7SShinas Rasheed
3502c0c32c7SShinas Rasheed num_rings = CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf);
3512c0c32c7SShinas Rasheed for (q = 0; q < num_rings; q++) {
3522c0c32c7SShinas Rasheed reg_val = octep_vf_read_csr64(oct, CNXK_VF_SDP_R_IN_INT_LEVELS(q));
3532c0c32c7SShinas Rasheed reg_val &= ~BIT_ULL_MASK(62);
3542c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_IN_INT_LEVELS(q), reg_val);
3552c0c32c7SShinas Rasheed
3562c0c32c7SShinas Rasheed reg_val = octep_vf_read_csr64(oct, CNXK_VF_SDP_R_OUT_INT_LEVELS(q));
3572c0c32c7SShinas Rasheed reg_val &= ~BIT_ULL_MASK(62);
3582c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_OUT_INT_LEVELS(q), reg_val);
3592c0c32c7SShinas Rasheed }
360cb7dd712SShinas Rasheed }
361cb7dd712SShinas Rasheed
362cb7dd712SShinas Rasheed /* Get new Octeon Read Index: index of descriptor that Octeon reads next. */
octep_vf_update_iq_read_index_cnxk(struct octep_vf_iq * iq)363cb7dd712SShinas Rasheed static u32 octep_vf_update_iq_read_index_cnxk(struct octep_vf_iq *iq)
364cb7dd712SShinas Rasheed {
3652c0c32c7SShinas Rasheed u32 pkt_in_done = readl(iq->inst_cnt_reg);
3662c0c32c7SShinas Rasheed u32 last_done, new_idx;
3672c0c32c7SShinas Rasheed
3682c0c32c7SShinas Rasheed last_done = pkt_in_done - iq->pkt_in_done;
3692c0c32c7SShinas Rasheed iq->pkt_in_done = pkt_in_done;
3702c0c32c7SShinas Rasheed
3712c0c32c7SShinas Rasheed new_idx = (iq->octep_vf_read_index + last_done) % iq->max_count;
3722c0c32c7SShinas Rasheed
3732c0c32c7SShinas Rasheed return new_idx;
374cb7dd712SShinas Rasheed }
375cb7dd712SShinas Rasheed
376cb7dd712SShinas Rasheed /* Enable a hardware Tx Queue */
octep_vf_enable_iq_cnxk(struct octep_vf_device * oct,int iq_no)377cb7dd712SShinas Rasheed static void octep_vf_enable_iq_cnxk(struct octep_vf_device *oct, int iq_no)
378cb7dd712SShinas Rasheed {
3792c0c32c7SShinas Rasheed u64 loop = HZ;
3802c0c32c7SShinas Rasheed u64 reg_val;
3812c0c32c7SShinas Rasheed
3822c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_IN_INSTR_DBELL(iq_no), GENMASK_ULL(31, 0));
3832c0c32c7SShinas Rasheed
3842c0c32c7SShinas Rasheed while (octep_vf_read_csr64(oct, CNXK_VF_SDP_R_IN_INSTR_DBELL(iq_no)) &&
3852c0c32c7SShinas Rasheed loop--) {
3862c0c32c7SShinas Rasheed schedule_timeout_interruptible(1);
3872c0c32c7SShinas Rasheed }
3882c0c32c7SShinas Rasheed
3892c0c32c7SShinas Rasheed reg_val = octep_vf_read_csr64(oct, CNXK_VF_SDP_R_IN_INT_LEVELS(iq_no));
3902c0c32c7SShinas Rasheed reg_val |= BIT_ULL_MASK(62);
3912c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_IN_INT_LEVELS(iq_no), reg_val);
3922c0c32c7SShinas Rasheed
3932c0c32c7SShinas Rasheed reg_val = octep_vf_read_csr64(oct, CNXK_VF_SDP_R_IN_ENABLE(iq_no));
3942c0c32c7SShinas Rasheed reg_val |= ULL(1);
3952c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_IN_ENABLE(iq_no), reg_val);
396cb7dd712SShinas Rasheed }
397cb7dd712SShinas Rasheed
398cb7dd712SShinas Rasheed /* Enable a hardware Rx Queue */
octep_vf_enable_oq_cnxk(struct octep_vf_device * oct,int oq_no)399cb7dd712SShinas Rasheed static void octep_vf_enable_oq_cnxk(struct octep_vf_device *oct, int oq_no)
400cb7dd712SShinas Rasheed {
4012c0c32c7SShinas Rasheed u64 reg_val;
4022c0c32c7SShinas Rasheed
4032c0c32c7SShinas Rasheed reg_val = octep_vf_read_csr64(oct, CNXK_VF_SDP_R_OUT_INT_LEVELS(oq_no));
4042c0c32c7SShinas Rasheed reg_val |= BIT_ULL_MASK(62);
4052c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_OUT_INT_LEVELS(oq_no), reg_val);
4062c0c32c7SShinas Rasheed
4072c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_OUT_SLIST_DBELL(oq_no), GENMASK_ULL(31, 0));
4082c0c32c7SShinas Rasheed
4092c0c32c7SShinas Rasheed reg_val = octep_vf_read_csr64(oct, CNXK_VF_SDP_R_OUT_ENABLE(oq_no));
4102c0c32c7SShinas Rasheed reg_val |= ULL(1);
4112c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_OUT_ENABLE(oq_no), reg_val);
412cb7dd712SShinas Rasheed }
413cb7dd712SShinas Rasheed
414cb7dd712SShinas Rasheed /* Enable all hardware Tx/Rx Queues assigned to VF */
octep_vf_enable_io_queues_cnxk(struct octep_vf_device * oct)415cb7dd712SShinas Rasheed static void octep_vf_enable_io_queues_cnxk(struct octep_vf_device *oct)
416cb7dd712SShinas Rasheed {
4172c0c32c7SShinas Rasheed u8 q;
4182c0c32c7SShinas Rasheed
4192c0c32c7SShinas Rasheed for (q = 0; q < CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf); q++) {
4202c0c32c7SShinas Rasheed octep_vf_enable_iq_cnxk(oct, q);
4212c0c32c7SShinas Rasheed octep_vf_enable_oq_cnxk(oct, q);
4222c0c32c7SShinas Rasheed }
423cb7dd712SShinas Rasheed }
424cb7dd712SShinas Rasheed
425cb7dd712SShinas Rasheed /* Disable a hardware Tx Queue assigned to VF */
octep_vf_disable_iq_cnxk(struct octep_vf_device * oct,int iq_no)426cb7dd712SShinas Rasheed static void octep_vf_disable_iq_cnxk(struct octep_vf_device *oct, int iq_no)
427cb7dd712SShinas Rasheed {
4282c0c32c7SShinas Rasheed u64 reg_val;
4292c0c32c7SShinas Rasheed
4302c0c32c7SShinas Rasheed reg_val = octep_vf_read_csr64(oct, CNXK_VF_SDP_R_IN_ENABLE(iq_no));
4312c0c32c7SShinas Rasheed reg_val &= ~ULL(1);
4322c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_IN_ENABLE(iq_no), reg_val);
433cb7dd712SShinas Rasheed }
434cb7dd712SShinas Rasheed
435cb7dd712SShinas Rasheed /* Disable a hardware Rx Queue assigned to VF */
octep_vf_disable_oq_cnxk(struct octep_vf_device * oct,int oq_no)436cb7dd712SShinas Rasheed static void octep_vf_disable_oq_cnxk(struct octep_vf_device *oct, int oq_no)
437cb7dd712SShinas Rasheed {
4382c0c32c7SShinas Rasheed u64 reg_val;
4392c0c32c7SShinas Rasheed
4402c0c32c7SShinas Rasheed reg_val = octep_vf_read_csr64(oct, CNXK_VF_SDP_R_OUT_ENABLE(oq_no));
4412c0c32c7SShinas Rasheed reg_val &= ~ULL(1);
4422c0c32c7SShinas Rasheed octep_vf_write_csr64(oct, CNXK_VF_SDP_R_OUT_ENABLE(oq_no), reg_val);
443cb7dd712SShinas Rasheed }
444cb7dd712SShinas Rasheed
445cb7dd712SShinas Rasheed /* Disable all hardware Tx/Rx Queues assigned to VF */
octep_vf_disable_io_queues_cnxk(struct octep_vf_device * oct)446cb7dd712SShinas Rasheed static void octep_vf_disable_io_queues_cnxk(struct octep_vf_device *oct)
447cb7dd712SShinas Rasheed {
4482c0c32c7SShinas Rasheed int q;
4492c0c32c7SShinas Rasheed
4502c0c32c7SShinas Rasheed for (q = 0; q < CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf); q++) {
4512c0c32c7SShinas Rasheed octep_vf_disable_iq_cnxk(oct, q);
4522c0c32c7SShinas Rasheed octep_vf_disable_oq_cnxk(oct, q);
4532c0c32c7SShinas Rasheed }
454cb7dd712SShinas Rasheed }
455cb7dd712SShinas Rasheed
456cb7dd712SShinas Rasheed /* Dump hardware registers (including Tx/Rx queues) for debugging. */
octep_vf_dump_registers_cnxk(struct octep_vf_device * oct)457cb7dd712SShinas Rasheed static void octep_vf_dump_registers_cnxk(struct octep_vf_device *oct)
458cb7dd712SShinas Rasheed {
4592c0c32c7SShinas Rasheed u8 num_rings, q;
4602c0c32c7SShinas Rasheed
4612c0c32c7SShinas Rasheed num_rings = CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf);
4622c0c32c7SShinas Rasheed for (q = 0; q < num_rings; q++)
4632c0c32c7SShinas Rasheed cnxk_vf_dump_q_regs(oct, q);
464cb7dd712SShinas Rasheed }
465cb7dd712SShinas Rasheed
466cb7dd712SShinas Rasheed /**
467cb7dd712SShinas Rasheed * octep_vf_device_setup_cnxk() - Setup Octeon device.
468cb7dd712SShinas Rasheed *
469cb7dd712SShinas Rasheed * @oct: Octeon device private data structure.
470cb7dd712SShinas Rasheed *
471cb7dd712SShinas Rasheed * - initialize hardware operations.
472cb7dd712SShinas Rasheed * - get target side pcie port number for the device.
473cb7dd712SShinas Rasheed * - set initial configuration and max limits.
474cb7dd712SShinas Rasheed */
octep_vf_device_setup_cnxk(struct octep_vf_device * oct)475cb7dd712SShinas Rasheed void octep_vf_device_setup_cnxk(struct octep_vf_device *oct)
476cb7dd712SShinas Rasheed {
477cb7dd712SShinas Rasheed oct->hw_ops.setup_iq_regs = octep_vf_setup_iq_regs_cnxk;
478cb7dd712SShinas Rasheed oct->hw_ops.setup_oq_regs = octep_vf_setup_oq_regs_cnxk;
479cb7dd712SShinas Rasheed oct->hw_ops.setup_mbox_regs = octep_vf_setup_mbox_regs_cnxk;
480cb7dd712SShinas Rasheed
481cb7dd712SShinas Rasheed oct->hw_ops.ioq_intr_handler = octep_vf_ioq_intr_handler_cnxk;
482cb7dd712SShinas Rasheed oct->hw_ops.reinit_regs = octep_vf_reinit_regs_cnxk;
483cb7dd712SShinas Rasheed
484cb7dd712SShinas Rasheed oct->hw_ops.enable_interrupts = octep_vf_enable_interrupts_cnxk;
485cb7dd712SShinas Rasheed oct->hw_ops.disable_interrupts = octep_vf_disable_interrupts_cnxk;
486cb7dd712SShinas Rasheed
487cb7dd712SShinas Rasheed oct->hw_ops.update_iq_read_idx = octep_vf_update_iq_read_index_cnxk;
488cb7dd712SShinas Rasheed
489cb7dd712SShinas Rasheed oct->hw_ops.enable_iq = octep_vf_enable_iq_cnxk;
490cb7dd712SShinas Rasheed oct->hw_ops.enable_oq = octep_vf_enable_oq_cnxk;
491cb7dd712SShinas Rasheed oct->hw_ops.enable_io_queues = octep_vf_enable_io_queues_cnxk;
492cb7dd712SShinas Rasheed
493cb7dd712SShinas Rasheed oct->hw_ops.disable_iq = octep_vf_disable_iq_cnxk;
494cb7dd712SShinas Rasheed oct->hw_ops.disable_oq = octep_vf_disable_oq_cnxk;
495cb7dd712SShinas Rasheed oct->hw_ops.disable_io_queues = octep_vf_disable_io_queues_cnxk;
496cb7dd712SShinas Rasheed oct->hw_ops.reset_io_queues = octep_vf_reset_io_queues_cnxk;
497cb7dd712SShinas Rasheed
498cb7dd712SShinas Rasheed oct->hw_ops.dump_registers = octep_vf_dump_registers_cnxk;
499cb7dd712SShinas Rasheed octep_vf_init_config_cnxk_vf(oct);
500cb7dd712SShinas Rasheed }
501