From: Akhil Goyal <gakhil@marvell.com>
To: <dev@dpdk.org>
Cc: <thomas@monjalon.net>, <david.marchand@redhat.com>,
<hemant.agrawal@nxp.com>, <jerinj@marvell.com>,
<hkalra@marvell.com>, <stephen@networkplumber.org>,
<sachin.saxena@oss.nxp.com>, <ferruh.yigit@amd.com>,
Akhil Goyal <gakhil@marvell.com>
Subject: [PATCH v5 1/9] drivers/raw: introduce cnxk rvu lf device driver
Date: Thu, 24 Oct 2024 18:47:51 +0530 [thread overview]
Message-ID: <20241024131759.3337333-2-gakhil@marvell.com> (raw)
In-Reply-To: <20241024131759.3337333-1-gakhil@marvell.com>
CNXK product families can have a use case to allow PF and VF
applications to communicate using mailboxes and also get notified
of any interrupt that may occur on the device.
Hence, a new raw device driver is added for such RVU LF devices.
These devices can map to a PF or a VF which can send mailboxes to
each other.
Signed-off-by: Akhil Goyal <gakhil@marvell.com>
---
MAINTAINERS | 6 ++
doc/guides/rawdevs/cnxk_rvu_lf.rst | 40 +++++++++
doc/guides/rawdevs/index.rst | 1 +
drivers/common/cnxk/meson.build | 1 +
drivers/common/cnxk/roc_api.h | 3 +
drivers/common/cnxk/roc_constants.h | 3 +
drivers/common/cnxk/roc_dev_priv.h | 1 +
drivers/common/cnxk/roc_idev.c | 46 ++++++++++
drivers/common/cnxk/roc_idev.h | 4 +
drivers/common/cnxk/roc_idev_priv.h | 1 +
drivers/common/cnxk/roc_priv.h | 2 +
drivers/common/cnxk/roc_rvu_lf.c | 63 +++++++++++++
drivers/common/cnxk/roc_rvu_lf.h | 24 +++++
drivers/common/cnxk/roc_rvu_lf_priv.h | 32 +++++++
drivers/common/cnxk/roc_utils.c | 2 +
drivers/common/cnxk/version.map | 5 ++
drivers/raw/cnxk_rvu_lf/cnxk_rvu_lf.c | 123 ++++++++++++++++++++++++++
drivers/raw/cnxk_rvu_lf/cnxk_rvu_lf.h | 24 +++++
drivers/raw/cnxk_rvu_lf/meson.build | 9 ++
drivers/raw/meson.build | 1 +
20 files changed, 391 insertions(+)
create mode 100644 doc/guides/rawdevs/cnxk_rvu_lf.rst
create mode 100644 drivers/common/cnxk/roc_rvu_lf.c
create mode 100644 drivers/common/cnxk/roc_rvu_lf.h
create mode 100644 drivers/common/cnxk/roc_rvu_lf_priv.h
create mode 100644 drivers/raw/cnxk_rvu_lf/cnxk_rvu_lf.c
create mode 100644 drivers/raw/cnxk_rvu_lf/cnxk_rvu_lf.h
create mode 100644 drivers/raw/cnxk_rvu_lf/meson.build
diff --git a/MAINTAINERS b/MAINTAINERS
index cd78bc7db1..fe1464d06a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1503,6 +1503,12 @@ T: git://dpdk.org/next/dpdk-next-net-mrvl
F: doc/guides/rawdevs/cnxk_gpio.rst
F: drivers/raw/cnxk_gpio/
+Marvell CNXK RVU LF
+M: Akhil Goyal <gakhil@marvell.com>
+T: git://dpdk.org/next/dpdk-next-net-mrvl
+F: doc/guides/rawdevs/cnxk_rvu_lf.rst
+F: drivers/raw/cnxk_rvu_lf/
+
NTB
M: Jingjing Wu <jingjing.wu@intel.com>
F: drivers/raw/ntb/
diff --git a/doc/guides/rawdevs/cnxk_rvu_lf.rst b/doc/guides/rawdevs/cnxk_rvu_lf.rst
new file mode 100644
index 0000000000..8a0bc22dd5
--- /dev/null
+++ b/doc/guides/rawdevs/cnxk_rvu_lf.rst
@@ -0,0 +1,40 @@
+.. SPDX-License-Identifier: BSD-3-Clause
+ Copyright(c) 2024 Marvell.
+
+Marvell CNXK RVU LF Driver
+==========================
+
+CNXK product families can have a use case to allow PF and VF
+applications to communicate using mailboxes and also get notified
+of any interrupt that may occur on the device.
+Hence, a new raw device driver is added for such RVU LF devices.
+These devices can map to a PF or a VF which can send mailboxes to
+each other.
+
+Features
+--------
+
+The RVU LF device implements following features in the rawdev API:
+
+- Register mailbox callbacks for the other side to process mailboxes.
+- Register interrupt handler callbacks.
+- Process mailbox.
+- Set range of message IDs allowed for communication.
+
+Limitations
+-----------
+
+In multiprocess mode user-space application must ensure
+no resources sharing takes place.
+Otherwise, user-space application should ensure synchronization.
+
+Device Setup
+------------
+
+The RVU LF devices will need to be bound to a user-space IO driver for use.
+The script ``dpdk-devbind.py`` included with DPDK can be used to
+view the state of the devices and to bind them to a suitable DPDK-supported
+kernel driver. When querying the status of the devices, they will appear under
+the category of "Misc (rawdev) devices", i.e. the command
+``dpdk-devbind.py --status-dev misc`` can be used to see the state of those
+devices alone.
diff --git a/doc/guides/rawdevs/index.rst b/doc/guides/rawdevs/index.rst
index f34315f051..8e07cf4d6c 100644
--- a/doc/guides/rawdevs/index.rst
+++ b/doc/guides/rawdevs/index.rst
@@ -13,6 +13,7 @@ application through rawdev API.
cnxk_bphy
cnxk_gpio
+ cnxk_rvu_lf
dpaa2_cmdif
ifpga
ntb
diff --git a/drivers/common/cnxk/meson.build b/drivers/common/cnxk/meson.build
index abb0f6f01f..cb0ffd5d40 100644
--- a/drivers/common/cnxk/meson.build
+++ b/drivers/common/cnxk/meson.build
@@ -71,6 +71,7 @@ sources = files(
'roc_tim_irq.c',
'roc_utils.c',
'roc_ree.c',
+ 'roc_rvu_lf.c',
)
# Security common code
diff --git a/drivers/common/cnxk/roc_api.h b/drivers/common/cnxk/roc_api.h
index 6a86863c57..93e7bf11bb 100644
--- a/drivers/common/cnxk/roc_api.h
+++ b/drivers/common/cnxk/roc_api.h
@@ -120,4 +120,7 @@
/* Eswitch */
#include "roc_eswitch.h"
+/* RVU LF */
+#include "roc_rvu_lf.h"
+
#endif /* _ROC_API_H_ */
diff --git a/drivers/common/cnxk/roc_constants.h b/drivers/common/cnxk/roc_constants.h
index 0e7495a37c..67cd74b28a 100644
--- a/drivers/common/cnxk/roc_constants.h
+++ b/drivers/common/cnxk/roc_constants.h
@@ -45,6 +45,8 @@
#define PCI_DEVID_CNXK_RVU_REE_VF 0xA0f5
#define PCI_DEVID_CNXK_RVU_ESWITCH_PF 0xA0E0
#define PCI_DEVID_CNXK_RVU_ESWITCH_VF 0xA0E1
+#define PCI_DEVID_CNXK_RVU_BPHY_PF 0xA0E4
+#define PCI_DEVID_CNXK_RVU_BPHY_VF 0xA0E5
#define PCI_DEVID_CN9K_CGX 0xA059
#define PCI_DEVID_CN10K_RPM 0xA060
@@ -63,6 +65,7 @@
#define PCI_SUBSYSTEM_DEVID_CNF10KB 0xBC00
#define PCI_SUBSYSTEM_DEVID_CN20KA 0xA020
+#define PCI_SUBSYSTEM_DEVID_CNF20KA 0xA000
#define PCI_SUBSYSTEM_DEVID_CN9KA 0x0000
#define PCI_SUBSYSTEM_DEVID_CN9KB 0xb400
diff --git a/drivers/common/cnxk/roc_dev_priv.h b/drivers/common/cnxk/roc_dev_priv.h
index 5ab4f72f8f..dd4949b32c 100644
--- a/drivers/common/cnxk/roc_dev_priv.h
+++ b/drivers/common/cnxk/roc_dev_priv.h
@@ -141,6 +141,7 @@ struct dev {
void *roc_cpt;
void *roc_tim;
void *roc_ml;
+ void *roc_rvu_lf;
bool disable_shared_lmt; /* false(default): shared lmt mode enabled */
const struct plt_memzone *lmt_mz;
struct mbox_sync sync;
diff --git a/drivers/common/cnxk/roc_idev.c b/drivers/common/cnxk/roc_idev.c
index 0778d51d1e..84812f73e0 100644
--- a/drivers/common/cnxk/roc_idev.c
+++ b/drivers/common/cnxk/roc_idev.c
@@ -38,6 +38,7 @@ idev_set_defaults(struct idev_cfg *idev)
idev->num_lmtlines = 0;
idev->bphy = NULL;
idev->cpt = NULL;
+ TAILQ_INIT(&idev->rvu_lf_list);
TAILQ_INIT(&idev->mcs_list);
idev->nix_inl_dev = NULL;
TAILQ_INIT(&idev->roc_nix_list);
@@ -188,6 +189,51 @@ roc_idev_cpt_get(void)
return NULL;
}
+struct roc_rvu_lf *
+roc_idev_rvu_lf_get(uint8_t rvu_lf_idx)
+{
+ struct idev_cfg *idev = idev_get_cfg();
+ struct roc_rvu_lf *rvu_lf = NULL;
+
+ if (idev != NULL) {
+ TAILQ_FOREACH(rvu_lf, &idev->rvu_lf_list, next) {
+ if (rvu_lf->idx == rvu_lf_idx)
+ return rvu_lf;
+ }
+ }
+
+ return NULL;
+}
+
+void
+roc_idev_rvu_lf_set(struct roc_rvu_lf *rvu)
+{
+ struct idev_cfg *idev = idev_get_cfg();
+ struct roc_rvu_lf *rvu_lf_iter = NULL;
+
+ if (idev != NULL) {
+ TAILQ_FOREACH(rvu_lf_iter, &idev->rvu_lf_list, next) {
+ if (rvu_lf_iter->idx == rvu->idx)
+ return;
+ }
+ TAILQ_INSERT_TAIL(&idev->rvu_lf_list, rvu, next);
+ }
+}
+
+void
+roc_idev_rvu_lf_free(struct roc_rvu_lf *rvu)
+{
+ struct idev_cfg *idev = idev_get_cfg();
+ struct roc_rvu_lf *rvu_lf_iter = NULL;
+
+ if (idev != NULL) {
+ TAILQ_FOREACH(rvu_lf_iter, &idev->rvu_lf_list, next) {
+ if (rvu_lf_iter->idx == rvu->idx)
+ TAILQ_REMOVE(&idev->rvu_lf_list, rvu, next);
+ }
+ }
+}
+
struct roc_mcs *
roc_idev_mcs_get(uint8_t mcs_idx)
{
diff --git a/drivers/common/cnxk/roc_idev.h b/drivers/common/cnxk/roc_idev.h
index fc0f7db54e..6edb5f83b2 100644
--- a/drivers/common/cnxk/roc_idev.h
+++ b/drivers/common/cnxk/roc_idev.h
@@ -29,4 +29,8 @@ uint16_t *__roc_api roc_idev_nix_rx_chan_base_get(void);
void __roc_api roc_idev_nix_rx_chan_set(uint16_t port, uint16_t chan);
uint16_t __roc_api roc_idev_nix_inl_dev_pffunc_get(void);
+
+struct roc_rvu_lf *__roc_api roc_idev_rvu_lf_get(uint8_t rvu_lf_idx);
+void __roc_api roc_idev_rvu_lf_set(struct roc_rvu_lf *rvu);
+void __roc_api roc_idev_rvu_lf_free(struct roc_rvu_lf *rvu);
#endif /* _ROC_IDEV_H_ */
diff --git a/drivers/common/cnxk/roc_idev_priv.h b/drivers/common/cnxk/roc_idev_priv.h
index 6628b18152..98b6286bfe 100644
--- a/drivers/common/cnxk/roc_idev_priv.h
+++ b/drivers/common/cnxk/roc_idev_priv.h
@@ -36,6 +36,7 @@ struct idev_cfg {
struct roc_bphy *bphy;
struct roc_cpt *cpt;
struct roc_sso *sso;
+ struct roc_rvu_lf_head rvu_lf_list;
struct roc_mcs_head mcs_list;
struct nix_inl_dev *nix_inl_dev;
struct idev_nix_inl_cfg inl_cfg;
diff --git a/drivers/common/cnxk/roc_priv.h b/drivers/common/cnxk/roc_priv.h
index 254a2d3310..8732a05ac3 100644
--- a/drivers/common/cnxk/roc_priv.h
+++ b/drivers/common/cnxk/roc_priv.h
@@ -53,4 +53,6 @@
/* ML */
#include "roc_ml_priv.h"
+/* RVU LF */
+#include "roc_rvu_lf_priv.h"
#endif /* _ROC_PRIV_H_ */
diff --git a/drivers/common/cnxk/roc_rvu_lf.c b/drivers/common/cnxk/roc_rvu_lf.c
new file mode 100644
index 0000000000..1ae39e746e
--- /dev/null
+++ b/drivers/common/cnxk/roc_rvu_lf.c
@@ -0,0 +1,63 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(C) 2024 Marvell.
+ */
+
+#include "roc_api.h"
+#include "roc_priv.h"
+
+int
+roc_rvu_lf_dev_init(struct roc_rvu_lf *roc_rvu_lf)
+{
+ struct plt_pci_device *pci_dev;
+ struct dev *dev;
+ struct rvu_lf *rvu;
+ int rc;
+
+ if (roc_rvu_lf == NULL || roc_rvu_lf->pci_dev == NULL)
+ return RVU_ERR_PARAM;
+
+ rvu = roc_rvu_lf_to_rvu_priv(roc_rvu_lf);
+ pci_dev = roc_rvu_lf->pci_dev;
+ dev = &rvu->dev;
+
+ if (rvu->dev.drv_inited)
+ return 0;
+
+ if (dev->mbox_active)
+ goto skip_dev_init;
+
+ memset(rvu, 0, sizeof(*rvu));
+
+ /* Initialize device */
+ rc = dev_init(dev, pci_dev);
+ if (rc) {
+ plt_err("Failed to init roc device");
+ goto fail;
+ }
+
+skip_dev_init:
+ dev->roc_rvu_lf = roc_rvu_lf;
+ rvu->pci_dev = pci_dev;
+
+ roc_idev_rvu_lf_set(roc_rvu_lf);
+ rvu->dev.drv_inited = true;
+
+ return 0;
+fail:
+ return rc;
+}
+
+int
+roc_rvu_lf_dev_fini(struct roc_rvu_lf *roc_rvu_lf)
+{
+ struct rvu_lf *rvu = roc_rvu_lf_to_rvu_priv(roc_rvu_lf);
+
+ if (rvu == NULL)
+ return NIX_ERR_PARAM;
+
+ rvu->dev.drv_inited = false;
+
+ roc_idev_rvu_lf_free(roc_rvu_lf);
+
+ return dev_fini(&rvu->dev, rvu->pci_dev);
+}
diff --git a/drivers/common/cnxk/roc_rvu_lf.h b/drivers/common/cnxk/roc_rvu_lf.h
new file mode 100644
index 0000000000..7ce8065a8b
--- /dev/null
+++ b/drivers/common/cnxk/roc_rvu_lf.h
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(C) 2024 Marvell.
+ */
+
+#ifndef _ROC_RVU_LF_H_
+#define _ROC_RVU_LF_H_
+
+#include "roc_platform.h"
+
+struct roc_rvu_lf {
+ TAILQ_ENTRY(roc_rvu_lf) next;
+ struct plt_pci_device *pci_dev;
+ uint8_t idx;
+#define ROC_RVU_MEM_SZ (6 * 1024)
+ uint8_t reserved[ROC_RVU_MEM_SZ] __plt_cache_aligned;
+};
+
+TAILQ_HEAD(roc_rvu_lf_head, roc_rvu_lf);
+
+/* Dev */
+int __roc_api roc_rvu_lf_dev_init(struct roc_rvu_lf *roc_rvu_lf);
+int __roc_api roc_rvu_lf_dev_fini(struct roc_rvu_lf *roc_rvu_lf);
+
+#endif /* _ROC_RVU_LF_H_ */
diff --git a/drivers/common/cnxk/roc_rvu_lf_priv.h b/drivers/common/cnxk/roc_rvu_lf_priv.h
new file mode 100644
index 0000000000..8feff82961
--- /dev/null
+++ b/drivers/common/cnxk/roc_rvu_lf_priv.h
@@ -0,0 +1,32 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(C) 2024 Marvell.
+ */
+
+#ifndef _ROC_RVU_LF_PRIV_H_
+#define _ROC_RVU_LF_PRIV_H_
+
+enum rvu_err_status {
+ RVU_ERR_PARAM = -1,
+ RVU_ERR_NO_MEM = -2,
+};
+
+struct rvu_lf {
+ struct plt_pci_device *pci_dev;
+ struct dev dev;
+ uint16_t msg_id_from;
+ uint16_t msg_id_to;
+};
+
+static inline struct rvu_lf *
+roc_rvu_lf_to_rvu_priv(struct roc_rvu_lf *roc_rvu_lf)
+{
+ return (struct rvu_lf *)&roc_rvu_lf->reserved[0];
+}
+
+static inline struct roc_rvu_lf *
+rvu_priv_to_roc_rvu_lf(struct rvu_lf *rvu_lf)
+{
+ return (struct roc_rvu_lf *)((char *)rvu_lf - offsetof(struct roc_rvu_lf, reserved));
+}
+
+#endif /* _ROC_RVU_LF_PRIV_H_ */
diff --git a/drivers/common/cnxk/roc_utils.c b/drivers/common/cnxk/roc_utils.c
index 9af2ae9b69..bcc0d2de38 100644
--- a/drivers/common/cnxk/roc_utils.c
+++ b/drivers/common/cnxk/roc_utils.c
@@ -17,11 +17,13 @@ roc_error_msg_get(int errorcode)
case NPC_ERR_PARAM:
case SSO_ERR_PARAM:
case MCS_ERR_PARAM:
+ case RVU_ERR_PARAM:
case UTIL_ERR_PARAM:
err_msg = "Invalid parameter";
break;
case NIX_ERR_NO_MEM:
case NPC_ERR_NO_MEM:
+ case RVU_ERR_NO_MEM:
err_msg = "Out of memory";
break;
case NIX_ERR_INVALID_RANGE:
diff --git a/drivers/common/cnxk/version.map b/drivers/common/cnxk/version.map
index 877333b80c..777e260731 100644
--- a/drivers/common/cnxk/version.map
+++ b/drivers/common/cnxk/version.map
@@ -119,6 +119,9 @@ INTERNAL {
roc_idev_nix_rx_chan_set;
roc_idev_nix_rx_inject_get;
roc_idev_nix_rx_inject_set;
+ roc_idev_rvu_lf_free;
+ roc_idev_rvu_lf_get;
+ roc_idev_rvu_lf_set;
roc_ml_reg_read64;
roc_ml_reg_write64;
roc_ml_reg_read32;
@@ -544,5 +547,7 @@ INTERNAL {
roc_ree_rule_db_get;
roc_ree_rule_db_len_get;
roc_ree_rule_db_prog;
+ roc_rvu_lf_dev_fini;
+ roc_rvu_lf_dev_init;
local: *;
};
diff --git a/drivers/raw/cnxk_rvu_lf/cnxk_rvu_lf.c b/drivers/raw/cnxk_rvu_lf/cnxk_rvu_lf.c
new file mode 100644
index 0000000000..1ed12d6979
--- /dev/null
+++ b/drivers/raw/cnxk_rvu_lf/cnxk_rvu_lf.c
@@ -0,0 +1,123 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(C) 2024 Marvell.
+ */
+
+#include <bus_pci_driver.h>
+#include <rte_common.h>
+#include <dev_driver.h>
+#include <rte_eal.h>
+#include <rte_lcore.h>
+#include <rte_pci.h>
+#include <rte_rawdev.h>
+#include <rte_rawdev_pmd.h>
+
+#include <roc_api.h>
+
+#include "cnxk_rvu_lf.h"
+
+static const struct rte_rawdev_ops rvu_lf_rawdev_ops = {
+ .dev_selftest = NULL,
+};
+
+static void
+rvu_lf_rawdev_get_name(char *name, struct rte_pci_device *pci_dev)
+{
+ snprintf(name, RTE_RAWDEV_NAME_MAX_LEN, "RVU LF:%02x:%02x.%x",
+ pci_dev->addr.bus, pci_dev->addr.devid,
+ pci_dev->addr.function);
+}
+
+static int
+rvu_lf_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
+{
+ char name[RTE_RAWDEV_NAME_MAX_LEN];
+ struct rte_rawdev *rvu_lf_rawdev;
+ struct roc_rvu_lf *roc_rvu_lf;
+ int ret;
+
+ RTE_SET_USED(pci_drv);
+
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return 0;
+
+ if (!pci_dev->mem_resource[2].addr) {
+ CNXK_RVU_LF_LOG(ERR, "BARs have invalid values: BAR0 %p, BAR2 %p",
+ pci_dev->mem_resource[2].addr, pci_dev->mem_resource[4].addr);
+ return -ENODEV;
+ }
+
+ ret = roc_plt_init();
+ if (ret)
+ return ret;
+
+ rvu_lf_rawdev_get_name(name, pci_dev);
+ rvu_lf_rawdev = rte_rawdev_pmd_allocate(name, sizeof(*roc_rvu_lf),
+ rte_socket_id());
+ if (rvu_lf_rawdev == NULL) {
+ CNXK_RVU_LF_LOG(ERR, "Failed to allocate rawdev");
+ return -ENOMEM;
+ }
+
+ rvu_lf_rawdev->dev_ops = &rvu_lf_rawdev_ops;
+ rvu_lf_rawdev->device = &pci_dev->device;
+ rvu_lf_rawdev->driver_name = pci_dev->driver->driver.name;
+
+ roc_rvu_lf = (struct roc_rvu_lf *)rvu_lf_rawdev->dev_private;
+ roc_rvu_lf->pci_dev = pci_dev;
+
+ ret = roc_rvu_lf_dev_init(roc_rvu_lf);
+ if (ret) {
+ rte_rawdev_pmd_release(rvu_lf_rawdev);
+ return ret;
+ }
+
+ return 0;
+}
+
+static int
+rvu_lf_remove(struct rte_pci_device *pci_dev)
+{
+ char name[RTE_RAWDEV_NAME_MAX_LEN];
+ struct roc_rvu_lf *roc_rvu_lf;
+ struct rte_rawdev *rawdev;
+
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return 0;
+
+ if (pci_dev == NULL) {
+ CNXK_RVU_LF_LOG(ERR, "invalid pci_dev");
+ return -EINVAL;
+ }
+
+ rvu_lf_rawdev_get_name(name, pci_dev);
+ rawdev = rte_rawdev_pmd_get_named_dev(name);
+ if (rawdev == NULL) {
+ CNXK_RVU_LF_LOG(ERR, "invalid device name (%s)", name);
+ return -EINVAL;
+ }
+
+ roc_rvu_lf = (struct roc_rvu_lf *)rawdev->dev_private;
+ roc_rvu_lf_dev_fini(roc_rvu_lf);
+
+ return rte_rawdev_pmd_release(rawdev);
+}
+
+static const struct rte_pci_id pci_rvu_lf_map[] = {
+ CNXK_PCI_ID(PCI_SUBSYSTEM_DEVID_CNF20KA, PCI_DEVID_CNXK_RVU_BPHY_PF),
+ CNXK_PCI_ID(PCI_SUBSYSTEM_DEVID_CNF20KA, PCI_DEVID_CNXK_RVU_BPHY_VF),
+ {
+ .vendor_id = 0,
+ },
+};
+
+static struct rte_pci_driver cnxk_rvu_lf_rawdev_pmd = {
+ .id_table = pci_rvu_lf_map,
+ .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_NEED_IOVA_AS_VA,
+ .probe = rvu_lf_probe,
+ .remove = rvu_lf_remove,
+};
+
+RTE_PMD_REGISTER_PCI(rvu_lf_rawdev_pci_driver, cnxk_rvu_lf_rawdev_pmd);
+RTE_PMD_REGISTER_PCI_TABLE(rvu_lf_rawdev_pci_driver, pci_rvu_lf_map);
+RTE_PMD_REGISTER_KMOD_DEP(rvu_lf_rawdev_pci_driver, "vfio-pci");
+RTE_LOG_REGISTER_SUFFIX(cnxk_logtype_rvu_lf, rvu_lf, INFO);
diff --git a/drivers/raw/cnxk_rvu_lf/cnxk_rvu_lf.h b/drivers/raw/cnxk_rvu_lf/cnxk_rvu_lf.h
new file mode 100644
index 0000000000..65cc1bb64d
--- /dev/null
+++ b/drivers/raw/cnxk_rvu_lf/cnxk_rvu_lf.h
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(C) 2024 Marvell.
+ */
+
+#ifndef _CNXK_RVU_LF_H_
+#define _CNXK_RVU_LF_H_
+
+#include <stdint.h>
+
+#include <rte_common.h>
+
+/**
+ * @file cnxk_rvu_lf.h
+ *
+ * Marvell RVU LF raw PMD specific internal structures
+ *
+ */
+
+extern int cnxk_logtype_rvu_lf;
+#define RTE_LOGTYPE_CNXK_RVU_LF cnxk_logtype_rvu_lf
+#define CNXK_RVU_LF_LOG(level, ...) \
+ RTE_LOG_LINE_PREFIX(level, CNXK_RVU_LF, "%s(): ", __func__, __VA_ARGS__)
+
+#endif /* _CNXK_RVU_LF_H_ */
diff --git a/drivers/raw/cnxk_rvu_lf/meson.build b/drivers/raw/cnxk_rvu_lf/meson.build
new file mode 100644
index 0000000000..32081e147f
--- /dev/null
+++ b/drivers/raw/cnxk_rvu_lf/meson.build
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(C) 2024 Marvell.
+#
+
+deps += ['bus_pci', 'common_cnxk', 'rawdev']
+sources = files(
+ 'cnxk_rvu_lf.c',
+)
+require_iova_in_mbuf = false
diff --git a/drivers/raw/meson.build b/drivers/raw/meson.build
index 05cad143fe..54221643d5 100644
--- a/drivers/raw/meson.build
+++ b/drivers/raw/meson.build
@@ -8,6 +8,7 @@ endif
drivers = [
'cnxk_bphy',
'cnxk_gpio',
+ 'cnxk_rvu_lf',
'dpaa2_cmdif',
'ifpga',
'ntb',
--
2.25.1
next prev parent reply other threads:[~2024-10-24 13:19 UTC|newest]
Thread overview: 81+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-07 19:33 [PATCH 0/9] " Akhil Goyal
2024-09-07 19:33 ` [PATCH 1/9] rawdev: add API to get device from index Akhil Goyal
2024-09-23 15:23 ` Jerin Jacob
2024-10-08 7:40 ` [PATCH v2] " Akhil Goyal
2024-10-08 11:59 ` David Marchand
2024-10-08 12:00 ` [EXTERNAL] " Akhil Goyal
2024-10-09 21:13 ` Akhil Goyal
2024-10-21 10:48 ` Akhil Goyal
2024-10-09 6:11 ` Hemant Agrawal
2024-10-22 19:12 ` David Marchand
2024-09-07 19:33 ` [PATCH 2/9] drivers/raw: introduce cnxk rvu lf device driver Akhil Goyal
2024-09-23 15:28 ` Jerin Jacob
2024-10-08 10:54 ` [PATCH v2 0/9] " Akhil Goyal
2024-10-08 10:54 ` [PATCH v2 1/9] " Akhil Goyal
2024-10-08 10:54 ` [PATCH v2 2/9] raw/cnxk_rvu_lf: add PMD API to get npa/sso pffunc Akhil Goyal
2024-10-08 10:54 ` [PATCH v2 3/9] raw/cnxk_rvu_lf: add PMD API to get BAR addresses Akhil Goyal
2024-10-08 10:54 ` [PATCH v2 4/9] raw/cnxk_rvu_lf: register/unregister interrupt handler Akhil Goyal
2024-10-08 10:54 ` [PATCH v2 5/9] raw/cnxk_rvu_lf: register/unregister msg handler Akhil Goyal
2024-10-08 10:54 ` [PATCH v2 6/9] raw/cnxk_rvu_lf: set message ID range Akhil Goyal
2024-10-08 10:54 ` [PATCH v2 7/9] raw/cnxk_rvu_lf: process mailbox message Akhil Goyal
2024-10-08 10:54 ` [PATCH v2 8/9] raw/cnxk_rvu_lf: add selftest Akhil Goyal
2024-10-08 10:54 ` [PATCH v2 9/9] raw/cnxk_rvu_lf: add PMD API to get device pffunc Akhil Goyal
2024-10-08 11:52 ` [PATCH v2 0/9] drivers/raw: introduce cnxk rvu lf device driver David Marchand
2024-10-08 12:10 ` [EXTERNAL] " Akhil Goyal
2024-10-08 18:49 ` [PATCH v3 " Akhil Goyal
2024-10-08 18:49 ` [PATCH v3 1/9] " Akhil Goyal
2024-10-08 20:44 ` Stephen Hemminger
2024-10-09 18:09 ` Stephen Hemminger
2024-10-09 18:14 ` [EXTERNAL] " Akhil Goyal
2024-10-23 14:01 ` David Marchand
2024-10-08 18:49 ` [PATCH v3 2/9] raw/cnxk_rvu_lf: add PMD API to get npa/sso pffunc Akhil Goyal
2024-10-23 14:13 ` David Marchand
2024-10-08 18:49 ` [PATCH v3 3/9] raw/cnxk_rvu_lf: add PMD API to get BAR addresses Akhil Goyal
2024-10-21 21:30 ` Thomas Monjalon
2024-10-22 2:46 ` Jerin Jacob
2024-10-22 6:05 ` [EXTERNAL] " Akhil Goyal
2024-10-22 9:27 ` Thomas Monjalon
2024-10-22 10:08 ` David Marchand
2024-10-22 12:06 ` Akhil Goyal
2024-10-23 16:00 ` Thomas Monjalon
2024-10-23 19:14 ` Akhil Goyal
2024-10-23 19:29 ` Thomas Monjalon
2024-10-24 13:03 ` Akhil Goyal
2024-10-22 15:30 ` Stephen Hemminger
2024-10-22 17:06 ` Jerin Jacob
2024-10-08 18:49 ` [PATCH v3 4/9] raw/cnxk_rvu_lf: register/unregister interrupt handler Akhil Goyal
2024-10-08 18:49 ` [PATCH v3 5/9] raw/cnxk_rvu_lf: register/unregister msg handler Akhil Goyal
2024-10-08 18:49 ` [PATCH v3 6/9] raw/cnxk_rvu_lf: set message ID range Akhil Goyal
2024-10-08 18:49 ` [PATCH v3 7/9] raw/cnxk_rvu_lf: process mailbox message Akhil Goyal
2024-10-08 18:49 ` [PATCH v3 8/9] raw/cnxk_rvu_lf: add selftest Akhil Goyal
2024-10-23 14:16 ` David Marchand
2024-10-08 18:49 ` [PATCH v3 9/9] raw/cnxk_rvu_lf: add PMD API to get device pffunc Akhil Goyal
2024-10-24 13:01 ` [PATCH v4 0/9] drivers/raw: introduce cnxk rvu lf device driver Akhil Goyal
2024-10-24 13:01 ` [PATCH v4 1/9] " Akhil Goyal
2024-10-24 13:01 ` [PATCH v4 2/9] raw/cnxk_rvu_lf: add API to get NPA/SSO pffunc Akhil Goyal
2024-10-24 13:01 ` [PATCH v4 3/9] raw/cnxk_rvu_lf: register/unregister interrupt handler Akhil Goyal
2024-10-24 13:01 ` [PATCH v4 4/9] raw/cnxk_rvu_lf: register/unregister msg handler Akhil Goyal
2024-10-24 13:01 ` [PATCH v4 5/9] raw/cnxk_rvu_lf: set message ID range Akhil Goyal
2024-10-24 13:01 ` [PATCH v4 6/9] raw/cnxk_rvu_lf: process mailbox message Akhil Goyal
2024-10-24 13:01 ` [PATCH v4 7/9] raw/cnxk_rvu_lf: add API to get device pffunc Akhil Goyal
2024-10-24 13:01 ` [PATCH v4 8/9] raw/cnxk_rvu_lf: add API to get BAR addresses Akhil Goyal
2024-10-24 13:01 ` [PATCH v4 9/9] raw/cnxk_rvu_lf: add selftest Akhil Goyal
2024-10-24 13:17 ` [PATCH v5 0/9] drivers/raw: introduce cnxk rvu lf device driver Akhil Goyal
2024-10-24 13:17 ` Akhil Goyal [this message]
2024-10-24 15:59 ` [PATCH v5 1/9] " Jerin Jacob
2024-10-24 13:17 ` [PATCH v5 2/9] raw/cnxk_rvu_lf: add API to get NPA/SSO pffunc Akhil Goyal
2024-10-24 13:17 ` [PATCH v5 3/9] raw/cnxk_rvu_lf: register/unregister interrupt handler Akhil Goyal
2024-10-24 13:17 ` [PATCH v5 4/9] raw/cnxk_rvu_lf: register/unregister msg handler Akhil Goyal
2024-10-24 13:17 ` [PATCH v5 5/9] raw/cnxk_rvu_lf: set message ID range Akhil Goyal
2024-10-24 13:17 ` [PATCH v5 6/9] raw/cnxk_rvu_lf: process mailbox message Akhil Goyal
2024-10-24 13:17 ` [PATCH v5 7/9] raw/cnxk_rvu_lf: add API to get device pffunc Akhil Goyal
2024-10-24 13:17 ` [PATCH v5 8/9] raw/cnxk_rvu_lf: add API to get BAR addresses Akhil Goyal
2024-10-24 13:17 ` [PATCH v5 9/9] raw/cnxk_rvu_lf: add selftest Akhil Goyal
2024-10-24 16:26 ` Stephen Hemminger
2024-09-07 19:33 ` [PATCH 3/9] raw/cnxk_rvu_lf: add PMD API to get npa/sso pffunc Akhil Goyal
2024-09-07 19:33 ` [PATCH 4/9] raw/cnxk_rvu_lf: add PMD API to get BAR addresses Akhil Goyal
2024-09-07 19:33 ` [PATCH 5/9] raw/cnxk_rvu_lf: register/unregister interrupt handler Akhil Goyal
2024-09-07 19:33 ` [PATCH 6/9] raw/cnxk_rvu_lf: register/unregister msg handler Akhil Goyal
2024-09-07 19:33 ` [PATCH 7/9] raw/cnxk_rvu_lf: set message ID range Akhil Goyal
2024-09-07 19:33 ` [PATCH 8/9] raw/cnxk_rvu_lf: process mailbox message Akhil Goyal
2024-09-07 19:33 ` [PATCH 9/9] raw/cnxk_rvu_lf: add selftest Akhil Goyal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241024131759.3337333-2-gakhil@marvell.com \
--to=gakhil@marvell.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@amd.com \
--cc=hemant.agrawal@nxp.com \
--cc=hkalra@marvell.com \
--cc=jerinj@marvell.com \
--cc=sachin.saxena@oss.nxp.com \
--cc=stephen@networkplumber.org \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).