[v3,17/25] drivers: move device module to common library

Message ID 20231026064324.177531-18-chaoyong.he@corigine.com (mailing list archive)
State Changes Requested, archived
Delegated to: Ferruh Yigit
Headers
Series add the NFP vDPA PMD |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Chaoyong He Oct. 26, 2023, 6:43 a.m. UTC
  Move the device module to the common library.

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>
---
 drivers/common/nfp/meson.build                    | 1 +
 drivers/{net/nfp/nfpcore => common/nfp}/nfp_dev.c | 0
 drivers/{net/nfp/nfpcore => common/nfp}/nfp_dev.h | 3 +++
 drivers/common/nfp/version.map                    | 1 +
 drivers/net/nfp/meson.build                       | 1 -
 drivers/net/nfp/nfp_net_common.h                  | 2 +-
 drivers/net/nfp/nfpcore/nfp6000_pcie.h            | 2 +-
 7 files changed, 7 insertions(+), 3 deletions(-)
 rename drivers/{net/nfp/nfpcore => common/nfp}/nfp_dev.c (100%)
 rename drivers/{net/nfp/nfpcore => common/nfp}/nfp_dev.h (96%)
  

Patch

diff --git a/drivers/common/nfp/meson.build b/drivers/common/nfp/meson.build
index cca7fb7796..a09d1e25e2 100644
--- a/drivers/common/nfp/meson.build
+++ b/drivers/common/nfp/meson.build
@@ -10,6 +10,7 @@  sources = files(
         'nfp_common.c',
         'nfp_common_log.c',
         'nfp_common_pci.c',
+        'nfp_dev.c',
 )
 
 deps += ['bus_pci', 'net']
diff --git a/drivers/net/nfp/nfpcore/nfp_dev.c b/drivers/common/nfp/nfp_dev.c
similarity index 100%
rename from drivers/net/nfp/nfpcore/nfp_dev.c
rename to drivers/common/nfp/nfp_dev.c
diff --git a/drivers/net/nfp/nfpcore/nfp_dev.h b/drivers/common/nfp/nfp_dev.h
similarity index 96%
rename from drivers/net/nfp/nfpcore/nfp_dev.h
rename to drivers/common/nfp/nfp_dev.h
index b0fffff619..ffcdd17227 100644
--- a/drivers/net/nfp/nfpcore/nfp_dev.h
+++ b/drivers/common/nfp/nfp_dev.h
@@ -8,6 +8,8 @@ 
 
 #include <stdint.h>
 
+#include <rte_compat.h>
+
 #define PCI_VENDOR_ID_NETRONOME         0x19ee
 #define PCI_VENDOR_ID_CORIGINE          0x1da8
 
@@ -39,6 +41,7 @@  struct nfp_dev_info {
 	uint8_t pf_num_per_unit;
 };
 
+__rte_internal
 const struct nfp_dev_info *nfp_dev_info_get(uint16_t device_id);
 
 #endif /* __NFP_DEV_H__ */
diff --git a/drivers/common/nfp/version.map b/drivers/common/nfp/version.map
index c1e03d8b8d..c8a04b1b95 100644
--- a/drivers/common/nfp/version.map
+++ b/drivers/common/nfp/version.map
@@ -10,6 +10,7 @@  INTERNAL {
 	nfp_write_mac;
 	nfp_enable_queues;
 	nfp_disable_queues;
+	nfp_dev_info_get;
 
 	local: *;
 };
diff --git a/drivers/net/nfp/meson.build b/drivers/net/nfp/meson.build
index fa99c3b6aa..cf9c16266d 100644
--- a/drivers/net/nfp/meson.build
+++ b/drivers/net/nfp/meson.build
@@ -16,7 +16,6 @@  sources = files(
         'nfdk/nfp_nfdk_dp.c',
         'nfpcore/nfp_cppcore.c',
         'nfpcore/nfp_crc.c',
-        'nfpcore/nfp_dev.c',
         'nfpcore/nfp_hwinfo.c',
         'nfpcore/nfp_mip.c',
         'nfpcore/nfp_mutex.c',
diff --git a/drivers/net/nfp/nfp_net_common.h b/drivers/net/nfp/nfp_net_common.h
index 9461440d0b..6607175460 100644
--- a/drivers/net/nfp/nfp_net_common.h
+++ b/drivers/net/nfp/nfp_net_common.h
@@ -9,10 +9,10 @@ 
 #include <bus_pci_driver.h>
 #include <ethdev_driver.h>
 #include <nfp_common.h>
+#include <nfp_dev.h>
 #include <rte_spinlock.h>
 
 #include "nfp_net_ctrl.h"
-#include "nfpcore/nfp_dev.h"
 
 /* Interrupt definitions */
 #define NFP_NET_IRQ_LSC_IDX             0
diff --git a/drivers/net/nfp/nfpcore/nfp6000_pcie.h b/drivers/net/nfp/nfpcore/nfp6000_pcie.h
index 8e2cfb69e6..59b58ddd04 100644
--- a/drivers/net/nfp/nfpcore/nfp6000_pcie.h
+++ b/drivers/net/nfp/nfpcore/nfp6000_pcie.h
@@ -7,9 +7,9 @@ 
 #define __NFP6000_PCIE_H__
 
 #include <ethdev_pci.h>
+#include <nfp_dev.h>
 
 #include "nfp_cpp.h"
-#include "nfp_dev.h"
 
 const struct nfp_cpp_operations *nfp_cpp_transport_operations(void);