DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, Chaoyong He <chaoyong.he@corigine.com>,
	Shujing Dong <shujing.dong@corigine.com>,
	Long Wu <long.wu@corigine.com>,
	Peng Zhang <peng.zhang@corigine.com>
Subject: [PATCH v3 18/25] drivers/vdpa: introduce the NFP vDPA library
Date: Thu, 26 Oct 2023 14:43:17 +0800	[thread overview]
Message-ID: <20231026064324.177531-19-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20231026064324.177531-1-chaoyong.he@corigine.com>

Introduce the very basic NFP vDPA library.

Signed-off-by: Shujing Dong <shujing.dong@corigine.com>
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 MAINTAINERS                          |  6 ++++
 doc/guides/vdpadevs/features/nfp.ini |  8 +++++
 doc/guides/vdpadevs/index.rst        |  1 +
 doc/guides/vdpadevs/nfp.rst          | 54 ++++++++++++++++++++++++++++
 drivers/vdpa/meson.build             |  1 +
 drivers/vdpa/nfp/meson.build         | 13 +++++++
 drivers/vdpa/nfp/nfp_vdpa_log.c      |  9 +++++
 drivers/vdpa/nfp/nfp_vdpa_log.h      | 21 +++++++++++
 8 files changed, 113 insertions(+)
 create mode 100644 doc/guides/vdpadevs/features/nfp.ini
 create mode 100644 doc/guides/vdpadevs/nfp.rst
 create mode 100644 drivers/vdpa/nfp/meson.build
 create mode 100644 drivers/vdpa/nfp/nfp_vdpa_log.c
 create mode 100644 drivers/vdpa/nfp/nfp_vdpa_log.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 5273ab9812..f463188f1d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1301,6 +1301,12 @@ vDPA Drivers
 T: git://dpdk.org/next/dpdk-next-virtio
 F: drivers/vdpa/meson.build
 
+Corigine nfp vDPA
+M: Chaoyong He <chaoyong.he@corigine.com>
+F: drivers/vdpa/nfp/
+F: doc/guides/vpdadevs/nfp.rst
+F: doc/guides/vdpadevs/features/nfp.ini
+
 Intel ifc
 M: Xiao Wang <xiao.w.wang@intel.com>
 F: drivers/vdpa/ifc/
diff --git a/doc/guides/vdpadevs/features/nfp.ini b/doc/guides/vdpadevs/features/nfp.ini
new file mode 100644
index 0000000000..d830feafe0
--- /dev/null
+++ b/doc/guides/vdpadevs/features/nfp.ini
@@ -0,0 +1,8 @@
+;
+; Supported features of the 'nfp' vDPA driver.
+;
+; Refer to default.ini for the full list of available driver features.
+;
+[Features]
+Linux                   = Y
+x86-64                  = Y
diff --git a/doc/guides/vdpadevs/index.rst b/doc/guides/vdpadevs/index.rst
index cc2f858042..b0191a3a1d 100644
--- a/doc/guides/vdpadevs/index.rst
+++ b/doc/guides/vdpadevs/index.rst
@@ -14,4 +14,5 @@ which can be used from an application through vhost API.
     features_overview
     ifc
     mlx5
+    nfp
     sfc
diff --git a/doc/guides/vdpadevs/nfp.rst b/doc/guides/vdpadevs/nfp.rst
new file mode 100644
index 0000000000..63636b2882
--- /dev/null
+++ b/doc/guides/vdpadevs/nfp.rst
@@ -0,0 +1,54 @@
+..  SPDX-License-Identifier: BSD-3-Clause
+    Copyright (c) 2023 Corigine, Inc.
+
+NFP vDPA driver
+===============
+
+The NFP vDPA (vhost data path acceleration) driver (**librte_nfp_vdpa**)
+provides support for the Netronome and Corigine's NFP-6xxx, NFP-4xxx
+and NFP-38xx product lines.
+
+NFP vDPA implementation
+-----------------------
+
+NFP VF device can be configured in the net device or vDPA mode.
+Adding "class=vdpa" parameter helps to specify that this device is to
+be used in vDPA mode. If this parameter is not specified, device
+will be probed by net/nfp driver and will used as a VF net device.
+
+This PMD uses (common/nfp) code to access the device firmware.
+
+Per-Device Parameters
+~~~~~~~~~~~~~~~~~~~~~
+
+The following per-device parameters can be passed via EAL PCI device
+allowlist option like "-a 02:00.0,arg1=value1,...".
+
+- ``class`` [net|vdpa] (default **net**)
+
+  Choose the mode of operation of nfp device.
+  **net** device will work as network device and will be probed by net/nfp driver.
+  **vdpa** device will work as vdpa device and will be probed by vdpa/nfp driver.
+  If this parameter is not specified then nfp device will operate as network device.
+
+Dynamic Logging Parameters
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+One may leverage EAL option "--log-level" to change default levels
+for the log types supported by the driver. The option is used with
+an argument typically consisting of two parts separated by a colon.
+
+Level value is the last part which takes a symbolic name (or integer).
+Log type is the former part which may shell match syntax.
+Depending on the choice of the expression, the given log level may
+be used either for some specific log type or for a subset of types.
+
+NFP vDPA PMD provides the following log types available for control:
+
+- ``pmd.vdpa.nfp.vdpa`` (default level is **notice**)
+
+  Affects driver-wide messages unrelated to any particular devices.
+
+- ``pmd.vdpa.nfp.core`` (default level is **notice**)
+
+  Affects the core logic of this PMD.
diff --git a/drivers/vdpa/meson.build b/drivers/vdpa/meson.build
index 77412c7d09..896e8e0304 100644
--- a/drivers/vdpa/meson.build
+++ b/drivers/vdpa/meson.build
@@ -8,6 +8,7 @@ endif
 drivers = [
         'ifc',
         'mlx5',
+        'nfp',
         'sfc',
 ]
 std_deps = ['bus_pci', 'kvargs']
diff --git a/drivers/vdpa/nfp/meson.build b/drivers/vdpa/nfp/meson.build
new file mode 100644
index 0000000000..5eff240055
--- /dev/null
+++ b/drivers/vdpa/nfp/meson.build
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2023 Corigine, Inc.
+
+if not is_linux or not dpdk_conf.get('RTE_ARCH_64')
+    build = false
+    reason = 'only supported on 64-bit Linux'
+endif
+
+sources = files(
+        'nfp_vdpa_log.c',
+)
+
+deps += ['vhost']
diff --git a/drivers/vdpa/nfp/nfp_vdpa_log.c b/drivers/vdpa/nfp/nfp_vdpa_log.c
new file mode 100644
index 0000000000..f5ada20713
--- /dev/null
+++ b/drivers/vdpa/nfp/nfp_vdpa_log.c
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Corigine, Inc.
+ * All rights reserved.
+ */
+
+#include "nfp_vdpa_log.h"
+
+RTE_LOG_REGISTER_SUFFIX(nfp_logtype_core, core, NOTICE);
+RTE_LOG_REGISTER_SUFFIX(nfp_logtype_vdpa, vdpa, NOTICE);
diff --git a/drivers/vdpa/nfp/nfp_vdpa_log.h b/drivers/vdpa/nfp/nfp_vdpa_log.h
new file mode 100644
index 0000000000..cf342329b1
--- /dev/null
+++ b/drivers/vdpa/nfp/nfp_vdpa_log.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2023 Corigine, Inc.
+ * All rights reserved.
+ */
+
+#ifndef __NFP_VDPA_LOG_H__
+#define __NFP_VDPA_LOG_H__
+
+#include <rte_log.h>
+
+extern int nfp_logtype_vdpa;
+#define DRV_VDPA_LOG(level, fmt, args...) \
+	rte_log(RTE_LOG_ ## level, nfp_logtype_vdpa, \
+		"NFP_VDPA: %s(): " fmt "\n", __func__, ## args)
+
+extern int nfp_logtype_core;
+#define DRV_CORE_LOG(level, fmt, args...) \
+	rte_log(RTE_LOG_ ## level, nfp_logtype_core, \
+		"NFP_CORE: %s(): " fmt "\n", __func__, ## args)
+
+#endif /* __NFP_VDPA_LOG_H__ */
-- 
2.39.1


  parent reply	other threads:[~2023-10-26  6:47 UTC|newest]

Thread overview: 121+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-17  5:45 [PATCH 00/25] add the NFP vDPA PMD Chaoyong He
2023-10-17  5:45 ` [PATCH 01/25] drivers: introduce the NFP common library Chaoyong He
2023-10-17  5:45 ` [PATCH 02/25] net/nfp: make VF PMD using of NFP common module Chaoyong He
2023-10-17  5:45 ` [PATCH 03/25] net/nfp: rename common module name Chaoyong He
2023-10-17  5:45 ` [PATCH 04/25] net/nfp: rename ctrl " Chaoyong He
2023-10-17  5:45 ` [PATCH 05/25] net/nfp: extract the cap data field Chaoyong He
2023-10-17  5:45 ` [PATCH 06/25] net/nfp: extract the qcp " Chaoyong He
2023-10-17  5:45 ` [PATCH 07/25] net/nfp: extract the ctrl BAR " Chaoyong He
2023-10-17  5:45 ` [PATCH 08/25] net/nfp: extract the ctrl " Chaoyong He
2023-10-17  5:45 ` [PATCH 09/25] net/nfp: change the parameter of APIs Chaoyong He
2023-10-17  5:45 ` [PATCH 10/25] net/nfp: change the parameter of reconfig Chaoyong He
2023-10-17  5:45 ` [PATCH 11/25] net/nfp: extract the MAC address data field Chaoyong He
2023-10-17  5:45 ` [PATCH 12/25] net/nfp: rename parameter in related logic Chaoyong He
2023-10-17  5:45 ` [PATCH 13/25] drivers: add the common ctrl module Chaoyong He
2023-10-17  5:45 ` [PATCH 14/25] drivers: add the nfp common module Chaoyong He
2023-10-17  5:45 ` [PATCH 15/25] drivers: move queue logic to " Chaoyong He
2023-10-17  5:45 ` [PATCH 16/25] drivers: move platform module to common library Chaoyong He
2023-10-17  5:45 ` [PATCH 17/25] drivers: move device " Chaoyong He
2023-10-17  5:45 ` [PATCH 18/25] drivers/vdpa: introduce the NFP vDPA library Chaoyong He
2023-10-17  5:45 ` [PATCH 19/25] drivers: add the basic framework of vDPA PMD Chaoyong He
2023-10-17  5:45 ` [PATCH 20/25] vdpa/nfp: add the logic of remap PCI memory Chaoyong He
2023-10-17  5:45 ` [PATCH 21/25] vdpa/nfp: add the hardware init logic Chaoyong He
2023-10-17  5:45 ` [PATCH 22/25] drivers: add the datapath update logic Chaoyong He
2023-10-17  5:45 ` [PATCH 23/25] vdpa/nfp: add the notify related logic Chaoyong He
2023-10-17  5:45 ` [PATCH 24/25] vdpa/nfp: add nfp vDPA device operations Chaoyong He
2023-10-17  5:45 ` [PATCH 25/25] doc: add the common and vDPA document Chaoyong He
2023-10-24  2:28 ` [PATCH v2 00/25] add the NFP vDPA PMD Chaoyong He
2023-10-24  2:28   ` [PATCH v2 01/25] drivers: introduce the NFP common library Chaoyong He
2023-10-24  2:28   ` [PATCH v2 02/25] net/nfp: make VF PMD using of NFP common module Chaoyong He
2023-10-25 16:09     ` Ferruh Yigit
2023-10-26  1:34       ` Chaoyong He
2023-10-24  2:28   ` [PATCH v2 03/25] net/nfp: rename common module name Chaoyong He
2023-10-24  2:28   ` [PATCH v2 04/25] net/nfp: rename ctrl " Chaoyong He
2023-10-24  2:28   ` [PATCH v2 05/25] net/nfp: extract the cap data field Chaoyong He
2023-10-24  2:28   ` [PATCH v2 06/25] net/nfp: extract the qcp " Chaoyong He
2023-10-24  2:28   ` [PATCH v2 07/25] net/nfp: extract the ctrl BAR " Chaoyong He
2023-10-24  2:28   ` [PATCH v2 08/25] net/nfp: extract the ctrl " Chaoyong He
2023-10-24  2:28   ` [PATCH v2 09/25] net/nfp: change the parameter of APIs Chaoyong He
2023-10-24  2:28   ` [PATCH v2 10/25] net/nfp: change the parameter of reconfig Chaoyong He
2023-10-24  2:28   ` [PATCH v2 11/25] net/nfp: extract the MAC address data field Chaoyong He
2023-10-24  2:28   ` [PATCH v2 12/25] net/nfp: rename parameter in related logic Chaoyong He
2023-10-24  2:28   ` [PATCH v2 13/25] drivers: add the common ctrl module Chaoyong He
2023-10-24  2:28   ` [PATCH v2 14/25] drivers: add the nfp common module Chaoyong He
2023-10-24  2:28   ` [PATCH v2 15/25] drivers: move queue logic to " Chaoyong He
2023-10-24  2:28   ` [PATCH v2 16/25] drivers: move platform module to common library Chaoyong He
2023-10-24  2:28   ` [PATCH v2 17/25] drivers: move device " Chaoyong He
2023-10-24  2:28   ` [PATCH v2 18/25] drivers/vdpa: introduce the NFP vDPA library Chaoyong He
2023-10-25 16:09     ` Ferruh Yigit
2023-10-26  1:39       ` Chaoyong He
2023-10-24  2:28   ` [PATCH v2 19/25] drivers: add the basic framework of vDPA PMD Chaoyong He
2023-10-25 16:10     ` Ferruh Yigit
2023-10-26  1:39       ` Chaoyong He
2023-10-24  2:28   ` [PATCH v2 20/25] vdpa/nfp: add the logic of remap PCI memory Chaoyong He
2023-10-24  2:28   ` [PATCH v2 21/25] vdpa/nfp: add the hardware init logic Chaoyong He
2023-10-24  2:28   ` [PATCH v2 22/25] drivers: add the datapath update logic Chaoyong He
2023-10-24  2:28   ` [PATCH v2 23/25] vdpa/nfp: add the notify related logic Chaoyong He
2023-10-24  2:28   ` [PATCH v2 24/25] vdpa/nfp: add nfp vDPA device operations Chaoyong He
2023-10-24  2:28   ` [PATCH v2 25/25] doc: add the common and vDPA document Chaoyong He
2023-10-25 16:11     ` Ferruh Yigit
2023-10-26  1:41       ` Chaoyong He
2023-10-25 16:09   ` [PATCH v2 00/25] add the NFP vDPA PMD Ferruh Yigit
2023-10-26  1:33     ` Chaoyong He
2023-10-26  2:50       ` Chaoyong He
2023-10-26 11:30         ` Ferruh Yigit
2023-10-26 11:33           ` Chaoyong He
2023-10-26  6:42   ` [PATCH v3 " Chaoyong He
2023-10-26  6:43     ` [PATCH v3 01/25] drivers: introduce the NFP common library Chaoyong He
2023-10-26  6:43     ` [PATCH v3 02/25] net/nfp: make VF PMD using of NFP common module Chaoyong He
2023-10-26  6:43     ` [PATCH v3 03/25] net/nfp: rename common module name Chaoyong He
2023-10-26  6:43     ` [PATCH v3 04/25] net/nfp: rename ctrl " Chaoyong He
2023-10-26  6:43     ` [PATCH v3 05/25] net/nfp: extract the cap data field Chaoyong He
2023-10-26  6:43     ` [PATCH v3 06/25] net/nfp: extract the qcp " Chaoyong He
2023-10-26  6:43     ` [PATCH v3 07/25] net/nfp: extract the ctrl BAR " Chaoyong He
2023-10-26  6:43     ` [PATCH v3 08/25] net/nfp: extract the ctrl " Chaoyong He
2023-10-26  6:43     ` [PATCH v3 09/25] net/nfp: change the parameter of APIs Chaoyong He
2023-10-26  6:43     ` [PATCH v3 10/25] net/nfp: change the parameter of reconfig Chaoyong He
2023-10-26  6:43     ` [PATCH v3 11/25] net/nfp: extract the MAC address data field Chaoyong He
2023-10-26  6:43     ` [PATCH v3 12/25] net/nfp: rename parameter in related logic Chaoyong He
2023-10-26  6:43     ` [PATCH v3 13/25] drivers: add the common ctrl module Chaoyong He
2023-10-26  6:43     ` [PATCH v3 14/25] drivers: add the nfp common module Chaoyong He
2023-10-26  6:43     ` [PATCH v3 15/25] drivers: move queue logic to " Chaoyong He
2023-10-26  6:43     ` [PATCH v3 16/25] drivers: move platform module to common library Chaoyong He
2023-10-26  6:43     ` [PATCH v3 17/25] drivers: move device " Chaoyong He
2023-10-26  6:43     ` Chaoyong He [this message]
2023-10-26  6:43     ` [PATCH v3 19/25] drivers: add the basic framework of vDPA PMD Chaoyong He
2023-10-26  6:43     ` [PATCH v3 20/25] vdpa/nfp: add the logic of remap PCI memory Chaoyong He
2023-10-26  6:43     ` [PATCH v3 21/25] vdpa/nfp: add the hardware init logic Chaoyong He
2023-10-26  6:43     ` [PATCH v3 22/25] drivers: add the datapath update logic Chaoyong He
2023-10-26  6:43     ` [PATCH v3 23/25] vdpa/nfp: add the notify related logic Chaoyong He
2023-10-26  6:43     ` [PATCH v3 24/25] vdpa/nfp: add nfp vDPA device operations Chaoyong He
2023-10-26  6:43     ` [PATCH v3 25/25] doc: add a entry in the release notes Chaoyong He
2023-10-26 14:55       ` Ferruh Yigit
2023-10-26 14:47     ` [PATCH v3 00/25] add the NFP vDPA PMD Ferruh Yigit
2023-10-26 14:55     ` Ferruh Yigit
2023-10-27  1:23       ` Chaoyong He
2023-10-27  2:59     ` [PATCH v4 00/24] " Chaoyong He
2023-10-27  2:59       ` [PATCH v4 01/24] common/nfp: introduce driver Chaoyong He
2023-10-27  2:59       ` [PATCH v4 02/24] net/nfp: make VF PMD use NFP common driver Chaoyong He
2023-10-27  2:59       ` [PATCH v4 03/24] net/nfp: rename net common module Chaoyong He
2023-10-27  2:59       ` [PATCH v4 04/24] net/nfp: rename ctrl module Chaoyong He
2023-10-27  2:59       ` [PATCH v4 05/24] net/nfp: extract cap data field Chaoyong He
2023-10-27  2:59       ` [PATCH v4 06/24] net/nfp: extract qcp " Chaoyong He
2023-10-27  2:59       ` [PATCH v4 07/24] net/nfp: extract ctrl BAR " Chaoyong He
2023-10-27  2:59       ` [PATCH v4 08/24] net/nfp: extract ctrl " Chaoyong He
2023-10-27  2:59       ` [PATCH v4 09/24] net/nfp: change parameter of functions Chaoyong He
2023-10-27  2:59       ` [PATCH v4 10/24] net/nfp: change parameter of reconfig Chaoyong He
2023-10-27  2:59       ` [PATCH v4 11/24] net/nfp: extract MAC address data field Chaoyong He
2023-10-27  2:59       ` [PATCH v4 12/24] net/nfp: rename parameter in related logic Chaoyong He
2023-10-27  2:59       ` [PATCH v4 13/24] common/nfp: add common ctrl module Chaoyong He
2023-10-27  2:59       ` [PATCH v4 14/24] common/nfp: add common module Chaoyong He
2023-10-27  2:59       ` [PATCH v4 15/24] common/nfp: move queue logic Chaoyong He
2023-10-27  2:59       ` [PATCH v4 16/24] common/nfp: move platform module Chaoyong He
2023-10-27  2:59       ` [PATCH v4 17/24] common/nfp: move device module Chaoyong He
2023-10-27  2:59       ` [PATCH v4 18/24] vdpa/nfp: introduce driver Chaoyong He
2023-10-27  2:59       ` [PATCH v4 19/24] vdpa/nfp: add basic framework Chaoyong He
2023-10-27  2:59       ` [PATCH v4 20/24] vdpa/nfp: add remap PCI memory Chaoyong He
2023-10-27  2:59       ` [PATCH v4 21/24] vdpa/nfp: add hardware init Chaoyong He
2023-10-27  2:59       ` [PATCH v4 22/24] vdpa/nfp: add datapath update Chaoyong He
2023-10-27  3:00       ` [PATCH v4 23/24] vdpa/nfp: add notify related logic Chaoyong He
2023-10-27  3:00       ` [PATCH v4 24/24] vdpa/nfp: add device operations Chaoyong He
2023-10-27 13:38       ` [PATCH v4 00/24] add the NFP vDPA PMD Ferruh Yigit

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=20231026064324.177531-19-chaoyong.he@corigine.com \
    --to=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=long.wu@corigine.com \
    --cc=oss-drivers@corigine.com \
    --cc=peng.zhang@corigine.com \
    --cc=shujing.dong@corigine.com \
    /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).