diff mbox series

[03/10] common/ark: move common files to common subdirectory

Message ID 20220421151900.703467-3-john.miller@atomicrules.com (mailing list archive)
State Changes Requested
Delegated to: akhil goyal
Headers show
Series [01/10] doc/guides/bbdevs: add ark baseband device documentation | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

John Miller April 21, 2022, 3:18 p.m. UTC
Add common ark files to drivers/common directory in
preparation to support Arkville baseband device.

Signed-off-by: John Miller <john.miller@atomicrules.com>
---
 drivers/common/ark/ark_common.c |   7 ++
 drivers/common/ark/ark_common.h |  48 ++++++++++++++
 drivers/common/ark/meson.build  |  13 ++++
 drivers/common/ark/version.map  | 109 ++++++++++++++++++++++++++++++++
 4 files changed, 177 insertions(+)
 create mode 100644 drivers/common/ark/ark_common.c
 create mode 100644 drivers/common/ark/ark_common.h
 create mode 100644 drivers/common/ark/meson.build
 create mode 100644 drivers/common/ark/version.map
diff mbox series

Patch

diff --git a/drivers/common/ark/ark_common.c b/drivers/common/ark/ark_common.c
new file mode 100644
index 0000000000..18d1832ede
--- /dev/null
+++ b/drivers/common/ark/ark_common.c
@@ -0,0 +1,7 @@ 
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2020-2021 Atomic Rules LLC
+ */
+
+#include "ark_common.h"
+
+RTE_LOG_REGISTER_DEFAULT(ark_common_logtype, NOTICE);
diff --git a/drivers/common/ark/ark_common.h b/drivers/common/ark/ark_common.h
new file mode 100644
index 0000000000..6bb168098b
--- /dev/null
+++ b/drivers/common/ark/ark_common.h
@@ -0,0 +1,48 @@ 
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2015-2018 Atomic Rules LLC
+ */
+
+#ifndef _ARK_COMMON_H_
+#define _ARK_COMMON_H_
+
+#include <inttypes.h>
+#include <rte_log.h>
+
+/* system camel case definition changed to upper case */
+#define PRIU32 PRIu32
+#define PRIU64 PRIu64
+
+/* Atomic Rules vendor id */
+#define AR_VENDOR_ID 0x1d6c
+
+/*
+ * This structure is used to statically define the capabilities
+ * of supported devices.
+ * Capabilities:
+ *  rqpacing -
+ * Some HW variants require that PCIe read-requests be correctly throttled.
+ * This is called "rqpacing" and has to do with credit and flow control
+ * on certain Arkville implementations.
+ */
+struct ark_caps {
+	bool rqpacing;
+};
+struct ark_dev_caps {
+	uint32_t  device_id;
+	struct ark_caps  caps;
+};
+#define SET_DEV_CAPS(id, rqp) \
+	{id, {.rqpacing = rqp} }
+
+/* Format specifiers for string data pairs */
+#define ARK_SU32  "\n\t%-20s    %'20" PRIU32
+#define ARK_SU64  "\n\t%-20s    %'20" PRIU64
+#define ARK_SU64X "\n\t%-20s    %#20" PRIx64
+#define ARK_SPTR  "\n\t%-20s    %20p"
+
+extern int ark_common_logtype;
+
+#define ARK_PMD_LOG(level, fmt, args...)	\
+	rte_log(RTE_LOG_ ##level, ark_common_logtype, "ARK_COMMON: " fmt, ## args)
+
+#endif
diff --git a/drivers/common/ark/meson.build b/drivers/common/ark/meson.build
new file mode 100644
index 0000000000..fbdfceecea
--- /dev/null
+++ b/drivers/common/ark/meson.build
@@ -0,0 +1,13 @@ 
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2019 Mellanox Technologies, Ltd
+
+sources += files(
+	'ark_ddm.c',
+	'ark_common.c',
+	'ark_mpu.c',
+	'ark_pktchkr.c',
+	'ark_pktdir.c',
+	'ark_pktgen.c',
+	'ark_rqp.c',
+	'ark_udm.c'
+)
diff --git a/drivers/common/ark/version.map b/drivers/common/ark/version.map
new file mode 100644
index 0000000000..063d065df2
--- /dev/null
+++ b/drivers/common/ark/version.map
@@ -0,0 +1,109 @@ 
+DPDK_22 {
+	local: *;
+};
+
+INTERNAL {
+	global:
+
+	ark_api_num_queues;
+	ark_api_num_queues_per_port;
+
+	ark_ddm_dump;
+	ark_ddm_dump_stats;
+	ark_ddm_is_stopped;
+	ark_ddm_queue_byte_count;
+	ark_ddm_queue_pkt_count;
+	ark_ddm_queue_reset_stats;
+	ark_ddm_reset;
+	ark_ddm_setup;
+	ark_ddm_start;
+	ark_ddm_stats_reset;
+	ark_ddm_stop;
+	ark_ddm_verify;
+
+	ark_mpu_configure;
+	ark_mpu_dump;
+	ark_mpu_dump_setup;
+	ark_mpu_reset;
+	ark_mpu_reset_stats;
+	ark_mpu_start;
+	ark_mpu_stop;
+	ark_mpu_verify;
+
+	ark_pktchkr_dump_stats;
+	ark_pktchkr_get_pkts_sent;
+	ark_pktchkr_init;
+	ark_pktchkr_is_running;
+	ark_pktchkr_parse;
+	ark_pktchkr_run;
+	ark_pktchkr_set_dst_mac_addr;
+	ark_pktchkr_set_eth_type;
+	ark_pktchkr_set_hdr_dW;
+	ark_pktchkr_set_num_pkts;
+	ark_pktchkr_set_payload_byte;
+	ark_pktchkr_set_pkt_size_incr;
+	ark_pktchkr_set_pkt_size_max;
+	ark_pktchkr_set_pkt_size_min;
+	ark_pktchkr_set_src_mac_addr;
+	ark_pktchkr_setup;
+	ark_pktchkr_stop;
+	ark_pktchkr_stopped;
+	ark_pktchkr_uninit;
+	ark_pktchkr_wait_done;
+	ark_pktdir_init;
+	ark_pktdir_setup;
+	ark_pktdir_stall_cnt;
+	ark_pktdir_status;
+	ark_pktdir_uninit;
+
+	ark_pktgen_get_pkts_sent;
+	ark_pktgen_init;
+	ark_pktgen_is_gen_forever;
+	ark_pktgen_is_running;
+	ark_pktgen_parse;
+	ark_pktgen_pause;
+	ark_pktgen_paused;
+	ark_pktgen_reset;
+	ark_pktgen_run;
+	ark_pktgen_set_dst_mac_addr;
+	ark_pktgen_set_eth_type;
+	ark_pktgen_set_hdr_dW;
+	ark_pktgen_set_num_pkts;
+	ark_pktgen_set_payload_byte;
+	ark_pktgen_set_pkt_size_incr;
+	ark_pktgen_set_pkt_size_max;
+	ark_pktgen_set_pkt_size_min;
+	ark_pktgen_set_pkt_spacing;
+	ark_pktgen_set_src_mac_addr;
+	ark_pktgen_set_start_offset;
+	ark_pktgen_setup;
+	ark_pktgen_tx_done;
+	ark_pktgen_uninit;
+	ark_pktgen_wait_done;
+
+	ark_rqp_dump;
+	ark_rqp_lasped;
+	ark_rqp_stats_reset;
+
+	ark_udm_bytes;
+	ark_udm_configure;
+	ark_udm_dropped;
+	ark_udm_dump;
+	ark_udm_dump_perf;
+	ark_udm_dump_queue_stats;
+	ark_udm_dump_setup;
+	ark_udm_dump_stats;
+	ark_udm_is_flushed;
+	ark_udm_packets;
+	ark_udm_queue_enable;
+	ark_udm_queue_stats_reset;
+	ark_udm_reset;
+	ark_udm_start;
+	ark_udm_stats_reset;
+	ark_udm_stop;
+	ark_udm_verify;
+	ark_udm_write_addr;
+	ark_pktgen_delay_start;
+
+	local: *;
+};