diff mbox series

[02/14] common/ark: create common subdirectory for baseband support

Message ID 20221026194613.1008232-2-john.miller@atomicrules.com (mailing list archive)
State Changes Requested
Delegated to: Maxime Coquelin
Headers show
Series [01/14] doc/guides/bbdevs: add ark baseband device documentation | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

John Miller Oct. 26, 2022, 7:46 p.m. UTC
Create a common directory in drivers/common and move common
ark files to prepare support for Arkville baseband device.

Signed-off-by: John Miller <john.miller@atomicrules.com>
---
 MAINTAINERS                               |  1 +
 drivers/{net => common}/ark/ark_ddm.c     |  2 +-
 drivers/{net => common}/ark/ark_ddm.h     |  0
 drivers/{net => common}/ark/ark_mpu.c     |  2 +-
 drivers/{net => common}/ark/ark_mpu.h     |  0
 drivers/{net => common}/ark/ark_pktchkr.c |  2 +-
 drivers/{net => common}/ark/ark_pktchkr.h | 22 ++++++++++++++++++
 drivers/{net => common}/ark/ark_pktdir.c  |  5 +++--
 drivers/{net => common}/ark/ark_pktdir.h  |  7 ++++++
 drivers/{net => common}/ark/ark_pktgen.c  |  2 +-
 drivers/{net => common}/ark/ark_pktgen.h  | 27 +++++++++++++++++++++++
 drivers/{net => common}/ark/ark_rqp.c     |  2 +-
 drivers/{net => common}/ark/ark_rqp.h     |  0
 drivers/{net => common}/ark/ark_udm.c     |  2 +-
 drivers/{net => common}/ark/ark_udm.h     | 13 +++++++++--
 15 files changed, 77 insertions(+), 10 deletions(-)
 rename drivers/{net => common}/ark/ark_ddm.c (98%)
 rename drivers/{net => common}/ark/ark_ddm.h (100%)
 rename drivers/{net => common}/ark/ark_mpu.c (99%)
 rename drivers/{net => common}/ark/ark_mpu.h (100%)
 rename drivers/{net => common}/ark/ark_pktchkr.c (99%)
 rename drivers/{net => common}/ark/ark_pktchkr.h (88%)
 rename drivers/{net => common}/ark/ark_pktdir.c (95%)
 rename drivers/{net => common}/ark/ark_pktdir.h (89%)
 rename drivers/{net => common}/ark/ark_pktgen.c (99%)
 rename drivers/{net => common}/ark/ark_pktgen.h (86%)
 rename drivers/{net => common}/ark/ark_rqp.c (98%)
 rename drivers/{net => common}/ark/ark_rqp.h (100%)
 rename drivers/{net => common}/ark/ark_udm.c (99%)
 rename drivers/{net => common}/ark/ark_udm.h (95%)
diff mbox series

Patch

diff --git a/MAINTAINERS b/MAINTAINERS
index 2bd4a55f1b..b2e192d001 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -642,6 +642,7 @@  M: Shepard Siegel <shepard.siegel@atomicrules.com>
 M: Ed Czeck <ed.czeck@atomicrules.com>
 M: John Miller <john.miller@atomicrules.com>
 F: drivers/net/ark/
+F: drivers/common/ark/
 F: doc/guides/nics/ark.rst
 F: doc/guides/nics/features/ark.ini
 
diff --git a/drivers/net/ark/ark_ddm.c b/drivers/common/ark/ark_ddm.c
similarity index 98%
rename from drivers/net/ark/ark_ddm.c
rename to drivers/common/ark/ark_ddm.c
index eb88349b7b..7875a7cabb 100644
--- a/drivers/net/ark/ark_ddm.c
+++ b/drivers/common/ark/ark_ddm.c
@@ -4,7 +4,7 @@ 
 
 #include <unistd.h>
 
-#include "ark_logs.h"
+#include "ark_common.h"
 #include "ark_ddm.h"
 
 static_assert(sizeof(union ark_tx_meta) == 8, "Unexpected struct size ark_tx_meta");
diff --git a/drivers/net/ark/ark_ddm.h b/drivers/common/ark/ark_ddm.h
similarity index 100%
rename from drivers/net/ark/ark_ddm.h
rename to drivers/common/ark/ark_ddm.h
diff --git a/drivers/net/ark/ark_mpu.c b/drivers/common/ark/ark_mpu.c
similarity index 99%
rename from drivers/net/ark/ark_mpu.c
rename to drivers/common/ark/ark_mpu.c
index 9d5ee7841b..1112974e59 100644
--- a/drivers/net/ark/ark_mpu.c
+++ b/drivers/common/ark/ark_mpu.c
@@ -4,7 +4,7 @@ 
 
 #include <unistd.h>
 
-#include "ark_logs.h"
+#include "ark_common.h"
 #include "ark_mpu.h"
 
 uint16_t
diff --git a/drivers/net/ark/ark_mpu.h b/drivers/common/ark/ark_mpu.h
similarity index 100%
rename from drivers/net/ark/ark_mpu.h
rename to drivers/common/ark/ark_mpu.h
diff --git a/drivers/net/ark/ark_pktchkr.c b/drivers/common/ark/ark_pktchkr.c
similarity index 99%
rename from drivers/net/ark/ark_pktchkr.c
rename to drivers/common/ark/ark_pktchkr.c
index e1f336c73c..18454e66f0 100644
--- a/drivers/net/ark/ark_pktchkr.c
+++ b/drivers/common/ark/ark_pktchkr.c
@@ -9,7 +9,7 @@ 
 #include <rte_malloc.h>
 
 #include "ark_pktchkr.h"
-#include "ark_logs.h"
+#include "ark_common.h"
 
 static int set_arg(char *arg, char *val);
 static int ark_pktchkr_is_gen_forever(ark_pkt_chkr_t handle);
diff --git a/drivers/net/ark/ark_pktchkr.h b/drivers/common/ark/ark_pktchkr.h
similarity index 88%
rename from drivers/net/ark/ark_pktchkr.h
rename to drivers/common/ark/ark_pktchkr.h
index b362281776..a166f98586 100644
--- a/drivers/net/ark/ark_pktchkr.h
+++ b/drivers/common/ark/ark_pktchkr.h
@@ -5,6 +5,8 @@ 
 #ifndef _ARK_PKTCHKR_H_
 #define _ARK_PKTCHKR_H_
 
+#include <rte_common.h>
+#include <rte_compat.h>
 #include <stdint.h>
 #include <inttypes.h>
 
@@ -64,25 +66,45 @@  struct ark_pkt_chkr_inst {
 };
 
 /*  packet checker functions */
+__rte_internal
 ark_pkt_chkr_t ark_pktchkr_init(void *addr, int ord, int l2_mode);
+__rte_internal
 void ark_pktchkr_uninit(ark_pkt_chkr_t handle);
+__rte_internal
 void ark_pktchkr_run(ark_pkt_chkr_t handle);
+__rte_internal
 int ark_pktchkr_stopped(ark_pkt_chkr_t handle);
+__rte_internal
 void ark_pktchkr_stop(ark_pkt_chkr_t handle);
+__rte_internal
 int ark_pktchkr_is_running(ark_pkt_chkr_t handle);
+__rte_internal
 int ark_pktchkr_get_pkts_sent(ark_pkt_chkr_t handle);
+__rte_internal
 void ark_pktchkr_set_payload_byte(ark_pkt_chkr_t handle, uint32_t b);
+__rte_internal
 void ark_pktchkr_set_pkt_size_min(ark_pkt_chkr_t handle, uint32_t x);
+__rte_internal
 void ark_pktchkr_set_pkt_size_max(ark_pkt_chkr_t handle, uint32_t x);
+__rte_internal
 void ark_pktchkr_set_pkt_size_incr(ark_pkt_chkr_t handle, uint32_t x);
+__rte_internal
 void ark_pktchkr_set_num_pkts(ark_pkt_chkr_t handle, uint32_t x);
+__rte_internal
 void ark_pktchkr_set_src_mac_addr(ark_pkt_chkr_t handle, uint64_t mac_addr);
+__rte_internal
 void ark_pktchkr_set_dst_mac_addr(ark_pkt_chkr_t handle, uint64_t mac_addr);
+__rte_internal
 void ark_pktchkr_set_eth_type(ark_pkt_chkr_t handle, uint32_t x);
+__rte_internal
 void ark_pktchkr_set_hdr_dW(ark_pkt_chkr_t handle, uint32_t *hdr);
+__rte_internal
 void ark_pktchkr_parse(char *args);
+__rte_internal
 void ark_pktchkr_setup(ark_pkt_chkr_t handle);
+__rte_internal
 void ark_pktchkr_dump_stats(ark_pkt_chkr_t handle);
+__rte_internal
 int ark_pktchkr_wait_done(ark_pkt_chkr_t handle);
 
 #endif
diff --git a/drivers/net/ark/ark_pktdir.c b/drivers/common/ark/ark_pktdir.c
similarity index 95%
rename from drivers/net/ark/ark_pktdir.c
rename to drivers/common/ark/ark_pktdir.c
index dbfd2924bd..6895263aca 100644
--- a/drivers/net/ark/ark_pktdir.c
+++ b/drivers/common/ark/ark_pktdir.c
@@ -5,9 +5,10 @@ 
 #include <stdint.h>
 #include <inttypes.h>
 
+#include <rte_malloc.h>
+
 #include "ark_pktdir.h"
-#include "ark_global.h"
-#include "ark_logs.h"
+#include "ark_common.h"
 
 
 ark_pkt_dir_t
diff --git a/drivers/net/ark/ark_pktdir.h b/drivers/common/ark/ark_pktdir.h
similarity index 89%
rename from drivers/net/ark/ark_pktdir.h
rename to drivers/common/ark/ark_pktdir.h
index b5577cebb3..d186b9ba55 100644
--- a/drivers/net/ark/ark_pktdir.h
+++ b/drivers/common/ark/ark_pktdir.h
@@ -5,6 +5,8 @@ 
 #ifndef _ARK_PKTDIR_H_
 #define _ARK_PKTDIR_H_
 
+#include <rte_common.h>
+#include <rte_compat.h>
 #include <stdint.h>
 
 #define ARK_PKT_DIR_INIT_VAL 0x0110
@@ -32,10 +34,15 @@  struct ark_pkt_dir_inst {
 	volatile struct ark_pkt_dir_regs *regs;
 };
 
+__rte_internal
 ark_pkt_dir_t ark_pktdir_init(void *base);
+__rte_internal
 void ark_pktdir_uninit(ark_pkt_dir_t handle);
+__rte_internal
 void ark_pktdir_setup(ark_pkt_dir_t handle, uint32_t v);
+__rte_internal
 uint32_t ark_pktdir_stall_cnt(ark_pkt_dir_t handle);
+__rte_internal
 uint32_t ark_pktdir_status(ark_pkt_dir_t handle);
 
 #endif
diff --git a/drivers/net/ark/ark_pktgen.c b/drivers/common/ark/ark_pktgen.c
similarity index 99%
rename from drivers/net/ark/ark_pktgen.c
rename to drivers/common/ark/ark_pktgen.c
index cd2d3adc51..b0c4e9091c 100644
--- a/drivers/net/ark/ark_pktgen.c
+++ b/drivers/common/ark/ark_pktgen.c
@@ -10,7 +10,7 @@ 
 #include <rte_malloc.h>
 
 #include "ark_pktgen.h"
-#include "ark_logs.h"
+#include "ark_common.h"
 
 #define ARK_MAX_STR_LEN 64
 union OPTV {
diff --git a/drivers/net/ark/ark_pktgen.h b/drivers/common/ark/ark_pktgen.h
similarity index 86%
rename from drivers/net/ark/ark_pktgen.h
rename to drivers/common/ark/ark_pktgen.h
index 7147fe1bd4..6af4e26684 100644
--- a/drivers/net/ark/ark_pktgen.h
+++ b/drivers/common/ark/ark_pktgen.h
@@ -5,6 +5,8 @@ 
 #ifndef _ARK_PKTGEN_H_
 #define _ARK_PKTGEN_H_
 
+#include <rte_common.h>
+#include <rte_compat.h>
 #include <stdint.h>
 #include <inttypes.h>
 
@@ -51,30 +53,55 @@  struct ark_pkt_gen_inst {
 };
 
 /*  packet generator functions */
+__rte_internal
 ark_pkt_gen_t ark_pktgen_init(void *arg, int ord, int l2_mode);
+__rte_internal
 void ark_pktgen_uninit(ark_pkt_gen_t handle);
+__rte_internal
 void ark_pktgen_run(ark_pkt_gen_t handle);
+__rte_internal
 void ark_pktgen_pause(ark_pkt_gen_t handle);
+__rte_internal
 uint32_t ark_pktgen_paused(ark_pkt_gen_t handle);
+__rte_internal
 uint32_t ark_pktgen_is_gen_forever(ark_pkt_gen_t handle);
+__rte_internal
 uint32_t ark_pktgen_is_running(ark_pkt_gen_t handle);
+__rte_internal
 uint32_t ark_pktgen_tx_done(ark_pkt_gen_t handle);
+__rte_internal
 void ark_pktgen_reset(ark_pkt_gen_t handle);
+__rte_internal
 void ark_pktgen_wait_done(ark_pkt_gen_t handle);
+__rte_internal
 uint32_t ark_pktgen_get_pkts_sent(ark_pkt_gen_t handle);
+__rte_internal
 void ark_pktgen_set_payload_byte(ark_pkt_gen_t handle, uint32_t b);
+__rte_internal
 void ark_pktgen_set_pkt_spacing(ark_pkt_gen_t handle, uint32_t x);
+__rte_internal
 void ark_pktgen_set_pkt_size_min(ark_pkt_gen_t handle, uint32_t x);
+__rte_internal
 void ark_pktgen_set_pkt_size_max(ark_pkt_gen_t handle, uint32_t x);
+__rte_internal
 void ark_pktgen_set_pkt_size_incr(ark_pkt_gen_t handle, uint32_t x);
+__rte_internal
 void ark_pktgen_set_num_pkts(ark_pkt_gen_t handle, uint32_t x);
+__rte_internal
 void ark_pktgen_set_src_mac_addr(ark_pkt_gen_t handle, uint64_t mac_addr);
+__rte_internal
 void ark_pktgen_set_dst_mac_addr(ark_pkt_gen_t handle, uint64_t mac_addr);
+__rte_internal
 void ark_pktgen_set_eth_type(ark_pkt_gen_t handle, uint32_t x);
+__rte_internal
 void ark_pktgen_set_hdr_dW(ark_pkt_gen_t handle, uint32_t *hdr);
+__rte_internal
 void ark_pktgen_set_start_offset(ark_pkt_gen_t handle, uint32_t x);
+__rte_internal
 void ark_pktgen_parse(char *argv);
+__rte_internal
 void ark_pktgen_setup(ark_pkt_gen_t handle);
+__rte_internal
 void *ark_pktgen_delay_start(void *arg);
 
 #endif
diff --git a/drivers/net/ark/ark_rqp.c b/drivers/common/ark/ark_rqp.c
similarity index 98%
rename from drivers/net/ark/ark_rqp.c
rename to drivers/common/ark/ark_rqp.c
index efb9730fe6..898e8b10ce 100644
--- a/drivers/net/ark/ark_rqp.c
+++ b/drivers/common/ark/ark_rqp.c
@@ -5,7 +5,7 @@ 
 #include <unistd.h>
 
 #include "ark_rqp.h"
-#include "ark_logs.h"
+#include "ark_common.h"
 
 /* ************************************************************************* */
 void
diff --git a/drivers/net/ark/ark_rqp.h b/drivers/common/ark/ark_rqp.h
similarity index 100%
rename from drivers/net/ark/ark_rqp.h
rename to drivers/common/ark/ark_rqp.h
diff --git a/drivers/net/ark/ark_udm.c b/drivers/common/ark/ark_udm.c
similarity index 99%
rename from drivers/net/ark/ark_udm.c
rename to drivers/common/ark/ark_udm.c
index 81b141ad0b..db4c963995 100644
--- a/drivers/net/ark/ark_udm.c
+++ b/drivers/common/ark/ark_udm.c
@@ -4,7 +4,7 @@ 
 
 #include <unistd.h>
 
-#include "ark_logs.h"
+#include "ark_common.h"
 #include "ark_udm.h"
 
 static_assert(sizeof(struct ark_rx_meta) == 32, "Unexpected struct size ark_rx_meta");
diff --git a/drivers/net/ark/ark_udm.h b/drivers/common/ark/ark_udm.h
similarity index 95%
rename from drivers/net/ark/ark_udm.h
rename to drivers/common/ark/ark_udm.h
index f0685c95c7..5fc79a67bd 100644
--- a/drivers/net/ark/ark_udm.h
+++ b/drivers/common/ark/ark_udm.h
@@ -102,23 +102,32 @@  struct ark_udm_t {
 			 sizeof(struct ark_udm_rt_cfg_t)];
 };
 
-
+__rte_internal
 int ark_udm_verify(struct ark_udm_t *udm);
+__rte_internal
 void ark_udm_configure(struct ark_udm_t *udm,
 		       uint32_t headroom,
 		       uint32_t dataroom);
+__rte_internal
 void ark_udm_write_addr(struct ark_udm_t *udm, rte_iova_t addr);
+__rte_internal
 void ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg);
+__rte_internal
 void ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg,
 			      uint16_t qid);
+__rte_internal
 void ark_udm_dump_setup(struct ark_udm_t *udm, uint16_t q_id);
 
 /* Per queue data */
+__rte_internal
 uint64_t ark_udm_dropped(struct ark_udm_t *udm);
+__rte_internal
 uint64_t ark_udm_bytes(struct ark_udm_t *udm);
+__rte_internal
 uint64_t ark_udm_packets(struct ark_udm_t *udm);
-
+__rte_internal
 void ark_udm_queue_stats_reset(struct ark_udm_t *udm);
+__rte_internal
 void ark_udm_queue_enable(struct ark_udm_t *udm, int enable);
 
 #endif