[vhost] (@ref rte_vhost.h),
[vdpa] (@ref rte_vdpa.h),
[KNI] (@ref rte_kni.h),
+ [ark] (@ref rte_pmd_ark.h),
[ixgbe] (@ref rte_pmd_ixgbe.h),
[i40e] (@ref rte_pmd_i40e.h),
[ice] (@ref rte_pmd_ice.h),
@TOPDIR@/drivers/bus/vdev \
@TOPDIR@/drivers/crypto/scheduler \
@TOPDIR@/drivers/mempool/dpaa2 \
+ @TOPDIR@/drivers/net/ark \
@TOPDIR@/drivers/net/bnxt \
@TOPDIR@/drivers/net/bonding \
@TOPDIR@/drivers/net/dpaa \
#include <rte_ethdev_pci.h>
#include <rte_kvargs.h>
+#include "rte_pmd_ark.h"
#include "ark_global.h"
#include "ark_logs.h"
#include "ark_ethdev_tx.h"
#define ARK_TX_MAX_QUEUE (4096 * 4)
#define ARK_TX_MIN_QUEUE (256)
+int rte_pmd_ark_rx_userdata_dynfield_offset = -1;
+int rte_pmd_ark_tx_userdata_dynfield_offset = -1;
+
static const char * const valid_arguments[] = {
ARK_PKTGEN_ARG,
ARK_PKTCHKR_ARG,
int ret;
int port_count = 1;
int p;
+ static const struct rte_mbuf_dynfield ark_tx_userdata_dynfield_desc = {
+ .name = RTE_PMD_ARK_TX_USERDATA_DYNFIELD_NAME,
+ .size = sizeof(rte_pmd_ark_tx_userdata_t),
+ .align = __alignof__(rte_pmd_ark_tx_userdata_t),
+ };
+ static const struct rte_mbuf_dynfield ark_rx_userdata_dynfield_desc = {
+ .name = RTE_PMD_ARK_RX_USERDATA_DYNFIELD_NAME,
+ .size = sizeof(rte_pmd_ark_rx_userdata_t),
+ .align = __alignof__(rte_pmd_ark_rx_userdata_t),
+ };
ark->eth_dev = dev;
ret = check_for_ext(ark);
if (ret)
return ret;
+
+ /* Extra mbuf fields for user data */
+ if (RTE_PMD_ARK_TX_USERDATA_ENABLE) {
+ rte_pmd_ark_tx_userdata_dynfield_offset =
+ rte_mbuf_dynfield_register(&ark_tx_userdata_dynfield_desc);
+ if (rte_pmd_ark_tx_userdata_dynfield_offset < 0) {
+ ARK_PMD_LOG(ERR,
+ "Failed to register mbuf field for tx userdata\n");
+ return -rte_errno;
+ }
+ ARK_PMD_LOG(INFO, "Registered TX-meta dynamic field at %d\n",
+ rte_pmd_ark_tx_userdata_dynfield_offset);
+ }
+ if (RTE_PMD_ARK_RX_USERDATA_ENABLE) {
+ rte_pmd_ark_rx_userdata_dynfield_offset =
+ rte_mbuf_dynfield_register(&ark_rx_userdata_dynfield_desc);
+ if (rte_pmd_ark_rx_userdata_dynfield_offset < 0) {
+ ARK_PMD_LOG(ERR,
+ "Failed to register mbuf field for rx userdata\n");
+ return -rte_errno;
+ }
+ ARK_PMD_LOG(INFO, "Registered RX-meta dynamic field at %d\n",
+ rte_pmd_ark_rx_userdata_dynfield_offset);
+ }
+
pci_dev = RTE_ETH_DEV_TO_PCI(dev);
rte_eth_copy_pci_info(dev, pci_dev);
dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
#include <unistd.h>
+#include "rte_pmd_ark.h"
#include "ark_ethdev_rx.h"
#include "ark_global.h"
#include "ark_logs.h"
mbuf->pkt_len = meta->pkt_len;
mbuf->data_len = meta->pkt_len;
mbuf->timestamp = meta->timestamp;
- mbuf->udata64 = meta->user_data;
+ rte_pmd_ark_mbuf_rx_userdata_set(mbuf, meta->user_data);
if (ARK_DEBUG_CORE) { /* debug sanity checks */
if ((meta->pkt_len > (1024 * 16)) ||
#include <unistd.h>
+#include "rte_pmd_ark.h"
#include "ark_ethdev_tx.h"
#include "ark_global.h"
#include "ark_mpu.h"
uint8_t flags)
{
meta->physaddr = rte_mbuf_data_iova(mbuf);
- meta->user1 = (uint32_t)mbuf->udata64;
+ meta->user1 = rte_pmd_ark_mbuf_tx_userdata_get(mbuf);
meta->data_len = rte_pktmbuf_data_len(mbuf);
meta->flags = flags;
}
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2018 Intel Corporation
+headers = files('rte_pmd_ark.h')
+
sources = files('ark_ddm.c',
'ark_ethdev.c',
'ark_ethdev_rx.c',
--- /dev/null
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2020 Atomic Rules LLC
+ */
+
+#ifndef RTE_PMD_ARK_H
+#define RTE_PMD_ARK_H
+
+/**
+ * @file
+ * ARK driver-specific API
+ */
+
+#include <rte_mbuf.h>
+#include <rte_mbuf_dyn.h>
+
+#ifndef RTE_PMD_ARK_TX_USERDATA_ENABLE
+#define RTE_PMD_ARK_TX_USERDATA_ENABLE 0
+#endif
+
+#ifndef RTE_PMD_ARK_RX_USERDATA_ENABLE
+#define RTE_PMD_ARK_RX_USERDATA_ENABLE 0
+#endif
+
+typedef uint32_t rte_pmd_ark_tx_userdata_t;
+typedef uint64_t rte_pmd_ark_rx_userdata_t;
+
+extern int rte_pmd_ark_tx_userdata_dynfield_offset;
+extern int rte_pmd_ark_rx_userdata_dynfield_offset;
+
+/** mbuf dynamic field for custom Tx ARK data */
+#define RTE_PMD_ARK_TX_USERDATA_DYNFIELD_NAME "rte_net_ark_dynfield_tx_userdata"
+/** mbuf dynamic field for custom Rx ARK data */
+#define RTE_PMD_ARK_RX_USERDATA_DYNFIELD_NAME "rte_net_ark_dynfield_rx_userdata"
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Read Tx user data from mbuf.
+ *
+ * @param mbuf Structure to read from.
+ * @return user data
+ */
+__rte_experimental
+static inline rte_pmd_ark_tx_userdata_t
+rte_pmd_ark_mbuf_tx_userdata_get(const struct rte_mbuf *mbuf)
+{
+#if RTE_PMD_ARK_TX_USERDATA_ENABLE
+ return *RTE_MBUF_DYNFIELD(mbuf, rte_pmd_ark_tx_userdata_dynfield_offset,
+ rte_pmd_ark_tx_userdata_t *);
+#else
+ RTE_SET_USED(mbuf);
+ return 0;
+#endif
+}
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Write Tx user data to mbuf.
+ *
+ * @param mbuf Structure to write into.
+ * @param data User data.
+ */
+__rte_experimental
+static inline void
+rte_pmd_ark_mbuf_tx_userdata_set(struct rte_mbuf *mbuf,
+ rte_pmd_ark_tx_userdata_t data)
+{
+#if RTE_PMD_ARK_TX_USERDATA_ENABLE
+ *RTE_MBUF_DYNFIELD(mbuf, rte_pmd_ark_tx_userdata_dynfield_offset,
+ rte_pmd_ark_tx_userdata_t *) = data;
+#else
+ RTE_SET_USED(mbuf);
+ RTE_SET_USED(data);
+#endif
+}
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Read Rx user data from mbuf.
+ *
+ * @param mbuf Structure to read from.
+ * @return user data
+ */
+__rte_experimental
+static inline rte_pmd_ark_rx_userdata_t
+rte_pmd_ark_mbuf_rx_userdata_get(const struct rte_mbuf *mbuf)
+{
+#if RTE_PMD_ARK_RX_USERDATA_ENABLE
+ return *RTE_MBUF_DYNFIELD(mbuf, rte_pmd_ark_rx_userdata_dynfield_offset,
+ rte_pmd_ark_rx_userdata_t *);
+#else
+ RTE_SET_USED(mbuf);
+ return 0;
+#endif
+}
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Write Rx user data to mbuf.
+ *
+ * @param mbuf Structure to write into.
+ * @param data User data.
+ */
+__rte_experimental
+static inline void
+rte_pmd_ark_mbuf_rx_userdata_set(struct rte_mbuf *mbuf,
+ rte_pmd_ark_rx_userdata_t data)
+{
+#if RTE_PMD_ARK_RX_USERDATA_ENABLE
+ *RTE_MBUF_DYNFIELD(mbuf, rte_pmd_ark_rx_userdata_dynfield_offset,
+ rte_pmd_ark_rx_userdata_t *) = data;
+#else
+ RTE_SET_USED(mbuf);
+ RTE_SET_USED(data);
+#endif
+}
+
+#endif /* RTE_PMD_ARK_H */
DPDK_21 {
local: *;
};
+
+EXPERIMENTAL {
+ global:
+
+ rte_pmd_ark_tx_userdata_dynfield_offset;
+ rte_pmd_ark_rx_userdata_dynfield_offset;
+};