From: John Miller <john.miller@atomicrules.com>
To: dev@dpdk.org
Cc: ferruh.yigit@xilinx.com, ed.czeck@atomicrules.com,
John Miller <john.miller@atomicrules.com>
Subject: [PATCH 02/10] common/ark: create common subdirectory for baseband support
Date: Thu, 21 Apr 2022 10:18:52 -0500 [thread overview]
Message-ID: <20220421151900.703467-2-john.miller@atomicrules.com> (raw)
In-Reply-To: <20220421151900.703467-1-john.miller@atomicrules.com>
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 | 12 ++++++++++
drivers/{net => common}/ark/ark_mpu.c | 2 +-
drivers/{net => common}/ark/ark_mpu.h | 10 +++++++++
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 | 3 +++
drivers/{net => common}/ark/ark_udm.c | 2 +-
drivers/{net => common}/ark/ark_udm.h | 18 +++++++++++++++
15 files changed, 109 insertions(+), 8 deletions(-)
rename drivers/{net => common}/ark/ark_ddm.c (99%)
rename drivers/{net => common}/ark/ark_ddm.h (96%)
rename drivers/{net => common}/ark/ark_mpu.c (99%)
rename drivers/{net => common}/ark/ark_mpu.h (95%)
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 (97%)
rename drivers/{net => common}/ark/ark_udm.c (99%)
rename drivers/{net => common}/ark/ark_udm.h (94%)
diff --git a/MAINTAINERS b/MAINTAINERS
index 7c4f541dba..4716c92e78 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -632,6 +632,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 99%
rename from drivers/net/ark/ark_ddm.c
rename to drivers/common/ark/ark_ddm.c
index b16c739d50..16060156a4 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 96%
rename from drivers/net/ark/ark_ddm.h
rename to drivers/common/ark/ark_ddm.h
index 687ff2519a..bdc9b8cfb7 100644
--- a/drivers/net/ark/ark_ddm.h
+++ b/drivers/common/ark/ark_ddm.h
@@ -140,18 +140,30 @@ struct ark_ddm_t {
/* DDM function prototype */
+__rte_internal
int ark_ddm_verify(struct ark_ddm_t *ddm);
+__rte_internal
void ark_ddm_start(struct ark_ddm_t *ddm);
+__rte_internal
int ark_ddm_stop(struct ark_ddm_t *ddm, const int wait);
+__rte_internal
void ark_ddm_reset(struct ark_ddm_t *ddm);
+__rte_internal
void ark_ddm_stats_reset(struct ark_ddm_t *ddm);
+__rte_internal
void ark_ddm_setup(struct ark_ddm_t *ddm, rte_iova_t cons_addr,
uint32_t interval);
+__rte_internal
void ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg);
+__rte_internal
void ark_ddm_dump(struct ark_ddm_t *ddm, const char *msg);
+__rte_internal
int ark_ddm_is_stopped(struct ark_ddm_t *ddm);
+__rte_internal
uint64_t ark_ddm_queue_byte_count(struct ark_ddm_t *ddm);
+__rte_internal
uint64_t ark_ddm_queue_pkt_count(struct ark_ddm_t *ddm);
+__rte_internal
void ark_ddm_queue_reset_stats(struct ark_ddm_t *ddm);
#endif
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 b8e94b6ed3..8182745be3 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 95%
rename from drivers/net/ark/ark_mpu.h
rename to drivers/common/ark/ark_mpu.h
index 92c3e67c86..d9544edf4a 100644
--- a/drivers/net/ark/ark_mpu.h
+++ b/drivers/common/ark/ark_mpu.h
@@ -101,18 +101,28 @@ struct ark_mpu_t {
struct ark_mpu_debug_t debug;
};
+__rte_internal
uint16_t ark_api_num_queues(struct ark_mpu_t *mpu);
+__rte_internal
uint16_t ark_api_num_queues_per_port(struct ark_mpu_t *mpu,
uint16_t ark_ports);
+__rte_internal
int ark_mpu_verify(struct ark_mpu_t *mpu, uint32_t obj_size);
+__rte_internal
void ark_mpu_stop(struct ark_mpu_t *mpu);
+__rte_internal
void ark_mpu_start(struct ark_mpu_t *mpu);
+__rte_internal
int ark_mpu_reset(struct ark_mpu_t *mpu);
+__rte_internal
int ark_mpu_configure(struct ark_mpu_t *mpu, rte_iova_t ring,
uint32_t ring_size, int is_tx);
+__rte_internal
void ark_mpu_dump(struct ark_mpu_t *mpu, const char *msg, uint16_t idx);
+__rte_internal
void ark_mpu_dump_setup(struct ark_mpu_t *mpu, uint16_t qid);
+__rte_internal
void ark_mpu_reset_stats(struct ark_mpu_t *mpu);
/* this action is in a performance critical path */
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 12a5abb2f7..122f631938 100644
--- a/drivers/net/ark/ark_pktchkr.c
+++ b/drivers/common/ark/ark_pktchkr.c
@@ -8,7 +8,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 6195ef997f..0e5f5acb00 100644
--- a/drivers/net/ark/ark_pktgen.c
+++ b/drivers/common/ark/ark_pktgen.c
@@ -9,7 +9,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 ef9ccd0706..6bbe0318c9 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 97%
rename from drivers/net/ark/ark_rqp.h
rename to drivers/common/ark/ark_rqp.h
index 6c8046062b..18673f6ae9 100644
--- a/drivers/net/ark/ark_rqp.h
+++ b/drivers/common/ark/ark_rqp.h
@@ -51,7 +51,10 @@ struct ark_rqpace_t {
volatile int lasped;
};
+__rte_internal
void ark_rqp_dump(struct ark_rqpace_t *rqp);
+__rte_internal
void ark_rqp_stats_reset(struct ark_rqpace_t *rqp);
+__rte_internal
int ark_rqp_lasped(struct ark_rqpace_t *rqp);
#endif
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 9ebed89627..b2531a2fc0 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 94%
rename from drivers/net/ark/ark_udm.h
rename to drivers/common/ark/ark_udm.h
index 1cbcd94a98..600b5e1b0f 100644
--- a/drivers/net/ark/ark_udm.h
+++ b/drivers/common/ark/ark_udm.h
@@ -136,30 +136,48 @@ struct ark_udm_t {
};
+__rte_internal
int ark_udm_verify(struct ark_udm_t *udm);
+__rte_internal
int ark_udm_stop(struct ark_udm_t *udm, int wait);
+__rte_internal
void ark_udm_start(struct ark_udm_t *udm);
+__rte_internal
int ark_udm_reset(struct ark_udm_t *udm);
+__rte_internal
void ark_udm_configure(struct ark_udm_t *udm,
uint32_t headroom,
uint32_t dataroom,
uint32_t write_interval_ns);
+__rte_internal
void ark_udm_write_addr(struct ark_udm_t *udm, rte_iova_t addr);
+__rte_internal
void ark_udm_stats_reset(struct ark_udm_t *udm);
+__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(struct ark_udm_t *udm, const char *msg);
+__rte_internal
void ark_udm_dump_perf(struct ark_udm_t *udm, const char *msg);
+__rte_internal
void ark_udm_dump_setup(struct ark_udm_t *udm, uint16_t q_id);
+__rte_internal
int ark_udm_is_flushed(struct ark_udm_t *udm);
/* 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
--
2.25.1
next prev parent reply other threads:[~2022-04-21 15:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-21 15:18 [PATCH 01/10] doc/guides/bbdevs: add ark baseband device documentation John Miller
2022-04-21 15:18 ` John Miller [this message]
2022-04-21 15:18 ` [PATCH 03/10] common/ark: move common files to common subdirectory John Miller
2022-04-21 15:18 ` [PATCH 04/10] common/meson.build: John Miller
2022-04-21 15:18 ` [PATCH 05/10] baseband/ark: add ark baseband device John Miller
2022-04-27 18:38 ` Chautru, Nicolas
2022-04-28 10:01 ` John Miller
2022-04-21 15:18 ` [PATCH 06/10] net/ark: add ark PMD log interface John Miller
2022-04-21 15:18 ` [PATCH 07/10] maintainers: add baseband ark maintainers John Miller
2022-04-21 15:18 ` [PATCH 08/10] baseband/ark: add ark baseband user extensions John Miller
2022-04-21 15:18 ` [PATCH 09/10] baseband/meson.build: John Miller
2022-04-21 15:19 ` [PATCH 10/10] net/ark: repair meson dependency format John Miller
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=20220421151900.703467-2-john.miller@atomicrules.com \
--to=john.miller@atomicrules.com \
--cc=dev@dpdk.org \
--cc=ed.czeck@atomicrules.com \
--cc=ferruh.yigit@xilinx.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).