On 6/16/2022 3:39 AM, Jin Liu wrote:
Add support for a new type of NIC NFP3800 card, and update some
network card data acquisition interface functions.
Signed-off-by: Jin Liu <jin....@corigine.com>
Signed-off-by: Diana Wang <na.w...@corigine.com>
Signed-off-by: Peng Zhang <peng.zh...@corigine.com>
Signed-off-by: Chaoyong He <chaoyong...@corigine.com>
Signed-off-by: Niklas Söderlund <niklas.soderl...@corigine.com>
---
drivers/net/nfp/nfp_common.h | 33 +++++++++++++++++++++++++--
drivers/net/nfp/nfp_ethdev.c | 28 ++++++++++++++++++++---
drivers/net/nfp/nfp_ethdev_vf.c | 9 ++++++--
drivers/net/nfp/nfpcore/nfp_cpp.h | 2 +-
drivers/net/nfp/nfpcore/nfp_nsp_eth.c | 20 ++++++++++++----
5 files changed, 79 insertions(+), 13 deletions(-)
diff --git a/drivers/net/nfp/nfp_common.h b/drivers/net/nfp/nfp_common.h
index 8e1b4fb6a4..274d188527 100644
--- a/drivers/net/nfp/nfp_common.h
+++ b/drivers/net/nfp/nfp_common.h
@@ -16,9 +16,11 @@
#define NFP_NET_PMD_VERSION "0.1"
#define PCI_VENDOR_ID_NETRONOME 0x19ee
+#define PCI_DEVICE_ID_NFP3800_PF_NIC 0x3800
+#define PCI_DEVICE_ID_NFP3800_VF_NIC 0x3803
#define PCI_DEVICE_ID_NFP4000_PF_NIC 0x4000
#define PCI_DEVICE_ID_NFP6000_PF_NIC 0x6000
-#define PCI_DEVICE_ID_NFP6000_VF_NIC 0x6003
+#define PCI_DEVICE_ID_NFP6000_VF_NIC 0x6003 /* Include NFP4000VF */
/* Forward declaration */
struct nfp_net_adapter;
@@ -41,8 +43,16 @@ struct nfp_net_adapter;
#define NFP_QCP_QUEUE_STS_HI 0x000c
#define NFP_QCP_QUEUE_STS_HI_WRITEPTR_mask (0x3ffff)
+#define NFP_PCIE_QCP_NFP3800_OFFSET 0x400000
+#define NFP_PCIE_QCP_NFP6000_OFFSET 0x80000
+#define NFP_PCIE_QUEUE_NFP3800_MASK 0x1ff
+#define NFP_PCIE_QUEUE_NFP6000_MASK 0xff
+#define NFP_PCIE_QCP_PF_OFFSET 0x0
+#define NFP_PCIE_QCP_VF_OFFSET 0x0
+
/* The offset of the queue controller queues in the PCIe Target */
-#define NFP_PCIE_QUEUE(_q) (0x80000 + (NFP_QCP_QUEUE_ADDR_SZ * ((_q) & 0xff)))
+#define NFP_PCIE_QUEUE(_offset, _q, _mask) \
+ ((_offset) + (NFP_QCP_QUEUE_ADDR_SZ * ((_q) & (_mask))))
/* Interrupt definitions */
#define NFP_NET_IRQ_LSC_IDX 0
@@ -342,6 +352,25 @@ nfp_qcp_read(uint8_t *q, enum nfp_qcp_ptr ptr)
return val & NFP_QCP_QUEUE_STS_HI_WRITEPTR_mask;
}
+static inline uint32_t nfp_pci_queue(struct rte_pci_device *pdev, uint16_t queue)
+{
One of the previous patch in this set fixes syntax like above, and this
patch is adding more, can you please update as:
static inline uint32_t
nfp_pci_queue(struct rte_pci_device *pdev, uint16_t queue)