aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosep Puigdemont <josep.puigdemont@linaro.org>2017-12-20 11:11:00 +0100
committerJosep Puigdemont <josep.puigdemont@linaro.org>2017-12-20 11:11:00 +0100
commit217b610fa1c7c14e0e8f4a33a94dba6f50c79328 (patch)
tree959ab06a85492ddb11256d89ee1b2622b308f090
parent02017cd3036f7f81bd63d664fb71ef2378b3a53b (diff)
parent63fd88635cc10caaa02fdccd3f52c9494487bdd2 (diff)
downloadodp-devel/native-drivers.tar.gz
Merge remote-tracking branch 'origin/caterpillar' into devel/native-driversdevel/native-drivers
-rw-r--r--doc/application-api-guide/Doxyfile1
-rw-r--r--include/Makefile.am7
-rw-r--r--include/subsystem/spec/buffer_subsystem.h (renamed from platform/linux-generic/include/odp_buffer_subsystem.h)0
-rw-r--r--include/subsystem/spec/pool_subsystem.h (renamed from platform/linux-generic/include/odp_pool_subsystem.h)0
-rw-r--r--include/subsystem/spec/queue_subsystem.h (renamed from platform/linux-generic/include/odp_queue_subsystem.h)0
-rw-r--r--include/subsystem/spec/schedule_subsystem.h (renamed from platform/linux-generic/include/odp_schedule_subsystem.h)0
-rw-r--r--platform/linux-dpdk/Makefile.am4
-rw-r--r--platform/linux-dpdk/buffer/dpdk.c2
-rw-r--r--platform/linux-dpdk/include/odp/api/plat/buffer_types.h2
-rw-r--r--platform/linux-dpdk/include/odp/api/plat/event_types.h2
-rw-r--r--platform/linux-dpdk/include/odp/api/plat/timer_types.h2
-rw-r--r--platform/linux-dpdk/include/odp_config_internal.h5
-rw-r--r--platform/linux-dpdk/include/odp_pool_internal.h2
-rw-r--r--platform/linux-dpdk/odp_crypto.c107
-rw-r--r--platform/linux-dpdk/pktio/dpdk.c5
-rw-r--r--platform/linux-dpdk/pool/dpdk.c21
-rw-r--r--platform/linux-dpdk/test/Makefile.am2
-rwxr-xr-xplatform/linux-dpdk/test/validation/api/pktio/pktio_run.sh2
-rw-r--r--platform/linux-generic/Makefile.am4
-rw-r--r--platform/linux-generic/buffer/generic.c2
-rw-r--r--platform/linux-generic/buffer/subsystem.c2
-rw-r--r--platform/linux-generic/include/odp_config_internal.h7
-rw-r--r--platform/linux-generic/include/odp_pool_internal.h33
-rw-r--r--platform/linux-generic/odp_packet.c6
-rw-r--r--platform/linux-generic/pool/generic.c37
-rw-r--r--platform/linux-generic/pool/subsystem.c2
-rw-r--r--platform/linux-generic/queue/generic.c2
-rw-r--r--platform/linux-generic/queue/scalable.c2
-rw-r--r--platform/linux-generic/queue/subsystem.c2
-rw-r--r--platform/linux-generic/schedule/generic.c2
-rw-r--r--platform/linux-generic/schedule/iquery.c2
-rw-r--r--platform/linux-generic/schedule/scalable.c2
-rw-r--r--platform/linux-generic/schedule/sp.c2
-rw-r--r--platform/linux-generic/schedule/subsystem.c2
-rwxr-xr-xplatform/linux-generic/test/wrapper-script.sh3
-rw-r--r--test/Makefile.inc2
-rw-r--r--test/performance/Makefile.am2
37 files changed, 136 insertions, 144 deletions
diff --git a/doc/application-api-guide/Doxyfile b/doc/application-api-guide/Doxyfile
index 2709f6f..0541584 100644
--- a/doc/application-api-guide/Doxyfile
+++ b/doc/application-api-guide/Doxyfile
@@ -5,6 +5,7 @@ PROJECT_NUMBER = $(VERSION)
PROJECT_LOGO = $(SRCDIR)/doc/images/ODP-Logo-HQ.svg
INPUT = $(SRCDIR)/doc/application-api-guide \
$(SRCDIR)/include
+EXCLUDE = $(SRCDIR)/include/subsystem
EXCLUDE_PATTERNS = drv* odp_drv.h
EXAMPLE_PATH = $(SRCDIR)/example $(SRCDIR)
WARNINGS = NO
diff --git a/include/Makefile.am b/include/Makefile.am
index 3769167..b7c31c1 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -68,6 +68,13 @@ odpdrvspecinclude_HEADERS = \
odp/drv/spec/std_types.h \
odp/drv/spec/sync.h
+subsystemspecincludedir= $(includedir)/subsystem/spec
+subsystemspecinclude_HEADERS = \
+ subsystem/spec/buffer_subsystem.h \
+ subsystem/spec/pool_subsystem.h \
+ subsystem/spec/queue_subsystem.h \
+ subsystem/spec/schedule_subsystem.h
+
odpapiabidefaultincludedir= $(includedir)/odp/arch/default/api/abi
odpapiabidefaultinclude_HEADERS = \
odp/arch/default/api/abi/buffer.h \
diff --git a/platform/linux-generic/include/odp_buffer_subsystem.h b/include/subsystem/spec/buffer_subsystem.h
index 3c791d2..3c791d2 100644
--- a/platform/linux-generic/include/odp_buffer_subsystem.h
+++ b/include/subsystem/spec/buffer_subsystem.h
diff --git a/platform/linux-generic/include/odp_pool_subsystem.h b/include/subsystem/spec/pool_subsystem.h
index 0f34ad1..0f34ad1 100644
--- a/platform/linux-generic/include/odp_pool_subsystem.h
+++ b/include/subsystem/spec/pool_subsystem.h
diff --git a/platform/linux-generic/include/odp_queue_subsystem.h b/include/subsystem/spec/queue_subsystem.h
index 57fa68f..57fa68f 100644
--- a/platform/linux-generic/include/odp_queue_subsystem.h
+++ b/include/subsystem/spec/queue_subsystem.h
diff --git a/platform/linux-generic/include/odp_schedule_subsystem.h b/include/subsystem/spec/schedule_subsystem.h
index 7d92477..7d92477 100644
--- a/platform/linux-generic/include/odp_schedule_subsystem.h
+++ b/include/subsystem/spec/schedule_subsystem.h
diff --git a/platform/linux-dpdk/Makefile.am b/platform/linux-dpdk/Makefile.am
index ee6c36e..6dde37b 100644
--- a/platform/linux-dpdk/Makefile.am
+++ b/platform/linux-dpdk/Makefile.am
@@ -175,7 +175,6 @@ odpdrvplatinclude_HEADERS = \
noinst_HEADERS = \
- ${top_srcdir}/platform/linux-generic/include/odp_buffer_subsystem.h \
${top_srcdir}/platform/linux-generic/include/_fdserver_internal.h \
${top_srcdir}/platform/linux-generic/include/_ishm_internal.h \
${top_srcdir}/platform/linux-generic/include/_ishmphy_internal.h \
@@ -210,14 +209,11 @@ noinst_HEADERS = \
${top_srcdir}/platform/linux-generic/include/odp_packet_io_pool_access.h \
${top_srcdir}/platform/linux-generic/include/odp_pkt_queue_internal.h \
${srcdir}/include/odp_pool_internal.h \
- ${top_srcdir}/platform/linux-generic/include/odp_pool_subsystem.h \
${srcdir}/include/odp_posix_extensions.h \
${top_srcdir}/platform/linux-generic/include/odp_queue_internal.h \
${top_srcdir}/platform/linux-generic/include/odp_queue_if.h \
- ${top_srcdir}/platform/linux-generic/include/odp_queue_subsystem.h \
${top_srcdir}/platform/linux-generic/include/odp_ring_internal.h \
${top_srcdir}/platform/linux-generic/include/odp_schedule_if.h \
- ${top_srcdir}/platform/linux-generic/include/odp_schedule_subsystem.h \
${top_srcdir}/platform/linux-generic/include/odp_sorted_list_internal.h \
${top_srcdir}/platform/linux-generic/include/odp_shm_internal.h \
${top_srcdir}/platform/linux-generic/include/odp_time_internal.h \
diff --git a/platform/linux-dpdk/buffer/dpdk.c b/platform/linux-dpdk/buffer/dpdk.c
index 704468e..22e1123 100644
--- a/platform/linux-dpdk/buffer/dpdk.c
+++ b/platform/linux-dpdk/buffer/dpdk.c
@@ -9,7 +9,7 @@
#include <odp/api/buffer.h>
#include <odp_buffer_internal.h>
#include <odp_buffer_inlines.h>
-#include <odp_buffer_subsystem.h>
+#include <subsystem/spec/buffer_subsystem.h>
#include <odp_debug_internal.h>
#include <odp_pool_internal.h>
diff --git a/platform/linux-dpdk/include/odp/api/plat/buffer_types.h b/platform/linux-dpdk/include/odp/api/plat/buffer_types.h
index 809768f..0f5f7ba 100644
--- a/platform/linux-dpdk/include/odp/api/plat/buffer_types.h
+++ b/platform/linux-dpdk/include/odp/api/plat/buffer_types.h
@@ -31,7 +31,7 @@ extern "C" {
typedef ODP_HANDLE_T(odp_buffer_t);
-#define ODP_BUFFER_INVALID _odp_cast_scalar(odp_buffer_t, 0xffffffff)
+#define ODP_BUFFER_INVALID _odp_cast_scalar(odp_buffer_t, NULL)
typedef ODP_HANDLE_T(odp_buffer_seg_t);
diff --git a/platform/linux-dpdk/include/odp/api/plat/event_types.h b/platform/linux-dpdk/include/odp/api/plat/event_types.h
index e0f68e3..ecda702 100644
--- a/platform/linux-dpdk/include/odp/api/plat/event_types.h
+++ b/platform/linux-dpdk/include/odp/api/plat/event_types.h
@@ -32,7 +32,7 @@ extern "C" {
typedef ODP_HANDLE_T(odp_event_t);
-#define ODP_EVENT_INVALID _odp_cast_scalar(odp_event_t, 0xffffffff)
+#define ODP_EVENT_INVALID _odp_cast_scalar(odp_event_t, NULL)
/**
* Event types
diff --git a/platform/linux-dpdk/include/odp/api/plat/timer_types.h b/platform/linux-dpdk/include/odp/api/plat/timer_types.h
index 2ae8bfe..3d97993 100644
--- a/platform/linux-dpdk/include/odp/api/plat/timer_types.h
+++ b/platform/linux-dpdk/include/odp/api/plat/timer_types.h
@@ -37,7 +37,7 @@ typedef ODP_HANDLE_T(odp_timer_t);
typedef ODP_HANDLE_T(odp_timeout_t);
-#define ODP_TIMEOUT_INVALID _odp_cast_scalar(odp_timeout_t, 0xffffffff)
+#define ODP_TIMEOUT_INVALID _odp_cast_scalar(odp_timeout_t, NULL)
/**
* @}
diff --git a/platform/linux-dpdk/include/odp_config_internal.h b/platform/linux-dpdk/include/odp_config_internal.h
index 6aadc93..f36fcb9 100644
--- a/platform/linux-dpdk/include/odp_config_internal.h
+++ b/platform/linux-dpdk/include/odp_config_internal.h
@@ -120,11 +120,6 @@ extern "C" {
#define CONFIG_BURST_SIZE 16
/*
- * Maximum number of events in a pool
- */
-#define CONFIG_POOL_MAX_NUM (1 * 1024 * 1024)
-
-/*
* Maximum number of events in a thread local pool cache
*/
#define CONFIG_POOL_CACHE_SIZE 256
diff --git a/platform/linux-dpdk/include/odp_pool_internal.h b/platform/linux-dpdk/include/odp_pool_internal.h
index 2b3fc18..7d8fba1 100644
--- a/platform/linux-dpdk/include/odp_pool_internal.h
+++ b/platform/linux-dpdk/include/odp_pool_internal.h
@@ -20,7 +20,7 @@ extern "C" {
#include <odp/api/std_types.h>
#include <odp/api/pool.h>
-#include <odp_pool_subsystem.h>
+#include <subsystem/spec/pool_subsystem.h>
#include <odp_buffer_internal.h>
#include <odp/api/packet_io.h>
#include <odp/api/align.h>
diff --git a/platform/linux-dpdk/odp_crypto.c b/platform/linux-dpdk/odp_crypto.c
index 8e0f8a9..ea014c8 100644
--- a/platform/linux-dpdk/odp_crypto.c
+++ b/platform/linux-dpdk/odp_crypto.c
@@ -271,7 +271,7 @@ int odp_crypto_init_global(void)
qp_conf.nb_descriptors = NB_MBUF;
- for (queue_pair = 0; queue_pair < nb_queue_pairs - 1;
+ for (queue_pair = 0; queue_pair < nb_queue_pairs;
queue_pair++) {
rc = rte_cryptodev_queue_pair_setup(cdev_id,
queue_pair,
@@ -808,40 +808,53 @@ int odp_crypto_session_create(odp_crypto_session_param_t *param,
/* Default to successful result */
*status = ODP_CRYPTO_SES_CREATE_ERR_NONE;
- /* Cipher Data */
- cipher_xform.cipher.key.data = rte_malloc("crypto key",
- param->cipher_key.length, 0);
- if (cipher_xform.cipher.key.data == NULL) {
- ODP_ERR("Failed to allocate memory for cipher key\n");
- /* remove the crypto_session_entry_t */
- memset(entry, 0, sizeof(*entry));
- free_session(entry);
- return -1;
- }
-
cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
cipher_xform.next = NULL;
- cipher_xform.cipher.key.length = param->cipher_key.length;
- memcpy(cipher_xform.cipher.key.data,
- param->cipher_key.data,
- param->cipher_key.length);
-
- /* Authentication Data */
- auth_xform.auth.key.data = rte_malloc("auth key",
- param->auth_key.length, 0);
- if (auth_xform.auth.key.data == NULL) {
- ODP_ERR("Failed to allocate memory for auth key\n");
- /* remove the crypto_session_entry_t */
- memset(entry, 0, sizeof(*entry));
- free_session(entry);
- return -1;
+
+ if (param->cipher_key.length) {
+ /* Cipher Data */
+ cipher_xform.cipher.key.data = rte_malloc("crypto key",
+ param->cipher_key.length, 0);
+ if (cipher_xform.cipher.key.data == NULL) {
+ ODP_ERR("Failed to allocate memory for cipher key\n");
+ /* remove the crypto_session_entry_t */
+ memset(entry, 0, sizeof(*entry));
+ free_session(entry);
+ return -1;
+ }
+
+ cipher_xform.cipher.key.length = param->cipher_key.length;
+ memcpy(cipher_xform.cipher.key.data,
+ param->cipher_key.data,
+ param->cipher_key.length);
+ } else {
+ cipher_xform.cipher.key.data = 0;
+ cipher_xform.cipher.key.length = 0;
}
+
auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
auth_xform.next = NULL;
- auth_xform.auth.key.length = param->auth_key.length;
- memcpy(auth_xform.auth.key.data,
- param->auth_key.data,
- param->auth_key.length);
+
+ if (param->auth_key.length) {
+ /* Authentication Data */
+ auth_xform.auth.key.data = rte_malloc("auth key",
+ param->auth_key.length, 0);
+ if (auth_xform.auth.key.data == NULL) {
+ ODP_ERR("Failed to allocate memory for auth key\n");
+ /* remove the crypto_session_entry_t */
+ memset(entry, 0, sizeof(*entry));
+ free_session(entry);
+ return -1;
+ }
+ auth_xform.auth.key.length = param->auth_key.length;
+ memcpy(auth_xform.auth.key.data,
+ param->auth_key.data,
+ param->auth_key.length);
+ } else {
+ auth_xform.auth.key.data = 0;
+ auth_xform.auth.key.length = 0;
+ }
+
/* Derive order */
if (ODP_CRYPTO_OP_ENCODE == param->op)
@@ -898,11 +911,12 @@ int odp_crypto_session_create(odp_crypto_session_param_t *param,
/* Setup session */
session = rte_cryptodev_sym_session_create(cdev_id, first_xform);
- if (session == NULL)
+ if (session == NULL) {
/* remove the crypto_session_entry_t */
memset(entry, 0, sizeof(*entry));
free_session(entry);
return -1;
+ }
entry->rte_session = (intptr_t)session;
entry->cipher_xform = cipher_xform;
@@ -1216,6 +1230,9 @@ int odp_crypto_int(odp_packet_t pkt_in,
goto err;
}
+ op->sym->auth.aad.data = NULL;
+ op->sym->cipher.iv.data = NULL;
+
odp_spinlock_unlock(&global->lock);
/* Set crypto operation data parameters */
@@ -1242,9 +1259,8 @@ int odp_crypto_int(odp_packet_t pkt_in,
if (aad_len > 0) {
op->sym->auth.aad.data = rte_malloc("aad", aad_len, 0);
if (op->sym->auth.aad.data == NULL) {
- rte_crypto_op_free(op);
ODP_ERR("Failed to allocate memory for AAD");
- goto err;
+ goto err_op_free;
}
memcpy(op->sym->auth.aad.data, aad_head, aad_len);
@@ -1254,27 +1270,27 @@ int odp_crypto_int(odp_packet_t pkt_in,
}
if (entry->iv.length == 0) {
- rte_crypto_op_free(op);
ODP_ERR("Wrong IV length");
- goto err;
+ goto err_op_free;
}
op->sym->cipher.iv.data = rte_malloc("iv", entry->iv.length, 0);
if (op->sym->cipher.iv.data == NULL) {
- rte_crypto_op_free(op);
ODP_ERR("Failed to allocate memory for IV");
- goto err;
+ goto err_op_free;
}
if (param->override_iv_ptr) {
memcpy(op->sym->cipher.iv.data,
param->override_iv_ptr,
entry->iv.length);
+ op->sym->cipher.iv.phys_addr =
+ rte_malloc_virt2phy(op->sym->cipher.iv.data);
+ op->sym->cipher.iv.length = entry->iv.length;
} else if (entry->iv.data) {
memcpy(op->sym->cipher.iv.data,
entry->iv.data,
entry->iv.length);
-
op->sym->cipher.iv.phys_addr =
rte_malloc_virt2phy(op->sym->cipher.iv.data);
op->sym->cipher.iv.length = entry->iv.length;
@@ -1300,18 +1316,16 @@ int odp_crypto_int(odp_packet_t pkt_in,
rc = rte_cryptodev_enqueue_burst(rte_session->dev_id,
queue_pair, &op, 1);
if (rc == 0) {
- rte_crypto_op_free(op);
ODP_ERR("Failed to enqueue packet");
- goto err;
+ goto err_op_free;
}
rc = rte_cryptodev_dequeue_burst(rte_session->dev_id,
queue_pair, &op, 1);
if (rc == 0) {
- rte_crypto_op_free(op);
ODP_ERR("Failed to dequeue packet");
- goto err;
+ goto err_op_free;
}
out_pkt = (odp_packet_t)op->sym->m_src;
@@ -1327,10 +1341,12 @@ int odp_crypto_int(odp_packet_t pkt_in,
(rc_auth == ODP_CRYPTO_ALG_ERR_NONE);
_odp_buffer_event_subtype_set(packet_to_buffer(out_pkt),
- ODP_EVENT_PACKET_BASIC);
+ ODP_EVENT_PACKET_CRYPTO);
op_result = get_op_result_from_packet(out_pkt);
*op_result = local_result;
+ rte_free(op->sym->cipher.iv.data);
+ rte_free(op->sym->auth.aad.data);
rte_crypto_op_free(op);
/* Synchronous, simply return results */
@@ -1338,6 +1354,11 @@ int odp_crypto_int(odp_packet_t pkt_in,
return 0;
+err_op_free:
+ rte_free(op->sym->cipher.iv.data);
+ rte_free(op->sym->auth.aad.data);
+ rte_crypto_op_free(op);
+
err:
if (allocated) {
odp_packet_free(out_pkt);
diff --git a/platform/linux-dpdk/pktio/dpdk.c b/platform/linux-dpdk/pktio/dpdk.c
index 832ac7a..2d95e90 100644
--- a/platform/linux-dpdk/pktio/dpdk.c
+++ b/platform/linux-dpdk/pktio/dpdk.c
@@ -403,13 +403,14 @@ static int recv_pkt_dpdk(pktio_entry_t *pktio_entry, int index,
for (i = 0; i < nb_rx; ++i) {
odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt_table[i]);
- packet_parse_reset(pkt_hdr);
pkt_hdr->input = pktio_entry->s.handle;
if (!pktio_cls_enabled(pktio_entry) &&
- pktio_entry->s.config.parser.layer)
+ pktio_entry->s.config.parser.layer) {
+ packet_parse_reset(pkt_hdr);
packet_parse_layer(pkt_hdr,
pktio_entry->s.config.parser.layer);
+ }
packet_set_ts(pkt_hdr, ts);
}
diff --git a/platform/linux-dpdk/pool/dpdk.c b/platform/linux-dpdk/pool/dpdk.c
index 90d2d7c..94143df 100644
--- a/platform/linux-dpdk/pool/dpdk.c
+++ b/platform/linux-dpdk/pool/dpdk.c
@@ -137,12 +137,12 @@ static int dpdk_pool_capability(odp_pool_capability_t *capa)
capa->buf.max_pools = ODP_CONFIG_POOLS;
capa->buf.max_align = ODP_CONFIG_BUFFER_ALIGN_MAX;
capa->buf.max_size = MAX_SIZE;
- capa->buf.max_num = CONFIG_POOL_MAX_NUM;
+ capa->buf.max_num = 0;
/* Packet pools */
capa->pkt.max_pools = ODP_CONFIG_POOLS;
capa->pkt.max_len = 0;
- capa->pkt.max_num = CONFIG_POOL_MAX_NUM;
+ capa->pkt.max_num = 0;
capa->pkt.min_headroom = CONFIG_PACKET_HEADROOM;
capa->pkt.min_tailroom = CONFIG_PACKET_TAILROOM;
capa->pkt.max_segs_per_pkt = CONFIG_PACKET_MAX_SEGS;
@@ -152,7 +152,7 @@ static int dpdk_pool_capability(odp_pool_capability_t *capa)
/* Timeout pools */
capa->tmo.max_pools = ODP_CONFIG_POOLS;
- capa->tmo.max_num = CONFIG_POOL_MAX_NUM;
+ capa->tmo.max_num = 0;
return 0;
}
@@ -258,11 +258,6 @@ static int check_params(odp_pool_param_t *params)
switch (params->type) {
case ODP_POOL_BUFFER:
- if (params->buf.num > capa.buf.max_num) {
- printf("buf.num too large %u\n", params->buf.num);
- return -1;
- }
-
if (params->buf.size > capa.buf.max_size) {
printf("buf.size too large %u\n", params->buf.size);
return -1;
@@ -276,12 +271,6 @@ static int check_params(odp_pool_param_t *params)
break;
case ODP_POOL_PACKET:
- if (params->pkt.num > capa.pkt.max_num) {
- printf("pkt.num too large %u\n", params->pkt.num);
-
- return -1;
- }
-
if (params->pkt.seg_len > capa.pkt.max_seg_len) {
printf("pkt.seg_len too large %u\n",
params->pkt.seg_len);
@@ -297,10 +286,6 @@ static int check_params(odp_pool_param_t *params)
break;
case ODP_POOL_TIMEOUT:
- if (params->tmo.num > capa.tmo.max_num) {
- printf("tmo.num too large %u\n", params->tmo.num);
- return -1;
- }
break;
default:
diff --git a/platform/linux-dpdk/test/Makefile.am b/platform/linux-dpdk/test/Makefile.am
index a872400..8cb27b1 100644
--- a/platform/linux-dpdk/test/Makefile.am
+++ b/platform/linux-dpdk/test/Makefile.am
@@ -14,8 +14,6 @@ SUBDIRS += validation/api/pktio
endif
endif
-TEST_EXTENSIONS = .sh
-
TESTNAME = linux-dpdk
TESTENV = tests-$(TESTNAME).env
diff --git a/platform/linux-dpdk/test/validation/api/pktio/pktio_run.sh b/platform/linux-dpdk/test/validation/api/pktio/pktio_run.sh
index 538c87d..a08256a 100755
--- a/platform/linux-dpdk/test/validation/api/pktio/pktio_run.sh
+++ b/platform/linux-dpdk/test/validation/api/pktio/pktio_run.sh
@@ -23,7 +23,7 @@
# running stand alone out of tree requires setting PATH
PATH=${TEST_DIR}/api/pktio:$PATH
PATH=$(dirname $0):$PATH
-PATH=$(dirname $0)/../../../../common_plat/validation/api/pktio:$PATH
+PATH=$(dirname $0)/../../../../../../test/validation/api/pktio:$PATH
PATH=.:$PATH
pktio_main_path=$(which pktio_main${EXEEXT})
diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am
index 64d401f..67bcdda 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -162,7 +162,6 @@ noinst_HEADERS = \
include/odp_bitmap_internal.h \
include/odp_bitset.h \
include/odp_buffer_internal.h \
- include/odp_buffer_subsystem.h \
include/odp_classification_datamodel.h \
include/odp_classification_inlines.h \
include/odp_classification_internal.h \
@@ -193,9 +192,7 @@ noinst_HEADERS = \
include/odp_pktio_ops_tap.h \
include/odp_pktio_ops_subsystem.h \
include/odp_pkt_queue_internal.h \
- include/odp_queue_subsystem.h \
include/odp_pool_internal.h \
- include/odp_pool_subsystem.h \
include/odp_posix_extensions.h \
include/odp_queue_internal.h \
include/odp_queue_scalable_internal.h \
@@ -205,7 +202,6 @@ noinst_HEADERS = \
include/odp_schedule_scalable.h \
include/odp_schedule_scalable_config.h \
include/odp_schedule_scalable_ordered.h \
- include/odp_schedule_subsystem.h \
include/odp_sorted_list_internal.h \
include/odp_shm_internal.h \
include/odp_time_internal.h \
diff --git a/platform/linux-generic/buffer/generic.c b/platform/linux-generic/buffer/generic.c
index 3281119..cf99407 100644
--- a/platform/linux-generic/buffer/generic.c
+++ b/platform/linux-generic/buffer/generic.c
@@ -11,7 +11,7 @@
#include <odp_buffer_internal.h>
#include <odp_buffer_inlines.h>
#include <odp_debug_internal.h>
-#include <odp_buffer_subsystem.h>
+#include <subsystem/spec/buffer_subsystem.h>
#include <string.h>
#include <stdio.h>
diff --git a/platform/linux-generic/buffer/subsystem.c b/platform/linux-generic/buffer/subsystem.c
index d47525c..69ec918 100644
--- a/platform/linux-generic/buffer/subsystem.c
+++ b/platform/linux-generic/buffer/subsystem.c
@@ -6,7 +6,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <odp/api/buffer.h>
-#include <odp_buffer_subsystem.h>
+#include <subsystem/spec/buffer_subsystem.h>
#include <odp_debug_internal.h>
#include <odp_module.h>
diff --git a/platform/linux-generic/include/odp_config_internal.h b/platform/linux-generic/include/odp_config_internal.h
index 9b334df..3519cfc 100644
--- a/platform/linux-generic/include/odp_config_internal.h
+++ b/platform/linux-generic/include/odp_config_internal.h
@@ -148,13 +148,8 @@
#define CONFIG_BURST_SIZE 16
/*
- * Maximum number of events in a pool
- */
-#define CONFIG_POOL_MAX_NUM (1 * 1024 * 1024)
-
-/*
* Maximum number of events in a thread local pool cache
*/
-#define CONFIG_POOL_CACHE_SIZE 256
+#define CONFIG_POOL_CACHE_SIZE 255
#endif
diff --git a/platform/linux-generic/include/odp_pool_internal.h b/platform/linux-generic/include/odp_pool_internal.h
index 5004e28..a124697 100644
--- a/platform/linux-generic/include/odp_pool_internal.h
+++ b/platform/linux-generic/include/odp_pool_internal.h
@@ -21,7 +21,7 @@ extern "C" {
#include <odp/api/shared_memory.h>
#include <odp/api/ticketlock.h>
-#include <odp_pool_subsystem.h>
+#include <subsystem/spec/pool_subsystem.h>
#include <odp_buffer_internal.h>
#include <odp_config_internal.h>
#include <odp_ring_internal.h>
@@ -41,7 +41,7 @@ typedef struct {
ring_t hdr;
/* Ring data: buffer handles */
- uint32_t buf[CONFIG_POOL_MAX_NUM];
+ uint32_t buf[];
} pool_ring_t ODP_ALIGNED_CACHE;
@@ -54,34 +54,33 @@ typedef struct pool_t {
char name[ODP_POOL_NAME_LEN];
odp_pool_param_t params;
odp_pool_t pool_hdl;
- uint32_t pool_idx;
- uint32_t ring_mask;
odp_shm_t shm;
odp_shm_t uarea_shm;
- int reserved;
uint32_t num;
uint32_t align;
+ uint32_t shm_size;
+ uint32_t uarea_shm_size;
+ odp_shm_t ring_shm;
+ /* Used by DPDK zero-copy pktio */
+ pool_destroy_cb_fn ext_destroy;
+ void *ext_desc;
+
+ /* Below is for data plane */
+ uint8_t *base_addr ODP_ALIGNED_CACHE;
+ uint8_t *uarea_base_addr;
+ pool_ring_t *ring;
uint32_t headroom;
uint32_t tailroom;
uint32_t seg_len;
uint32_t max_len;
uint32_t uarea_size;
uint32_t block_size;
- uint32_t shm_size;
- uint32_t uarea_shm_size;
- uint8_t *base_addr;
- uint8_t *uarea_base_addr;
-
- /* Used by DPDK zero-copy pktio */
+ uint32_t pool_idx;
+ uint32_t ring_mask;
+ uint8_t reserved;
uint8_t mem_from_huge_pages;
- pool_destroy_cb_fn ext_destroy;
- void *ext_desc;
pool_cache_t local_cache[ODP_THREAD_COUNT_MAX];
-
- odp_shm_t ring_shm;
- pool_ring_t *ring;
-
} pool_t;
typedef struct pool_table_t {
diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c
index c65d701..853d3ba 100644
--- a/platform/linux-generic/odp_packet.c
+++ b/platform/linux-generic/odp_packet.c
@@ -1345,13 +1345,12 @@ int odp_packet_add_data(odp_packet_t *pkt_ptr, uint32_t offset, uint32_t len)
odp_packet_t pkt = *pkt_ptr;
odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt);
uint32_t pktlen = pkt_hdr->frame_len;
- pool_t *pool = pkt_hdr->buf_hdr.pool_ptr;
odp_packet_t newpkt;
if (offset > pktlen)
return -1;
- newpkt = odp_packet_alloc(pool->pool_hdl, pktlen + len);
+ newpkt = odp_packet_alloc(pkt_hdr->buf_hdr.pool_hdl, pktlen + len);
if (newpkt == ODP_PACKET_INVALID)
return -1;
@@ -1375,13 +1374,12 @@ int odp_packet_rem_data(odp_packet_t *pkt_ptr, uint32_t offset, uint32_t len)
odp_packet_t pkt = *pkt_ptr;
odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt);
uint32_t pktlen = pkt_hdr->frame_len;
- pool_t *pool = pkt_hdr->buf_hdr.pool_ptr;
odp_packet_t newpkt;
if (offset > pktlen || offset + len > pktlen)
return -1;
- newpkt = odp_packet_alloc(pool->pool_hdl, pktlen - len);
+ newpkt = odp_packet_alloc(pkt_hdr->buf_hdr.pool_hdl, pktlen - len);
if (newpkt == ODP_PACKET_INVALID)
return -1;
diff --git a/platform/linux-generic/pool/generic.c b/platform/linux-generic/pool/generic.c
index c55f675..7a06847 100644
--- a/platform/linux-generic/pool/generic.c
+++ b/platform/linux-generic/pool/generic.c
@@ -156,11 +156,12 @@ static int generic_pool_term_local(void)
return 0;
}
-static pool_t *reserve_pool(void)
+static pool_t *reserve_pool(uint32_t ring_size)
{
int i;
pool_t *pool;
char ring_name[ODP_POOL_NAME_LEN];
+ uint32_t ring_shm_size;
for (i = 0; i < ODP_CONFIG_POOLS; i++) {
pool = pool_entry(i);
@@ -169,10 +170,13 @@ static pool_t *reserve_pool(void)
if (pool->reserved == 0) {
pool->reserved = 1;
UNLOCK(&pool->lock);
- sprintf(ring_name, "pool_ring_%d", i);
+ snprintf(ring_name, ODP_POOL_NAME_LEN,
+ "pool_ring_%d", i);
+ ring_shm_size = sizeof(pool_ring_t) +
+ sizeof(pool->ring->buf[0]) * ring_size;
pool->ring_shm =
odp_shm_reserve(ring_name,
- sizeof(pool_ring_t),
+ ring_shm_size,
ODP_CACHE_LINE_SIZE, 0);
if (odp_unlikely(pool->ring_shm == ODP_SHM_INVALID)) {
ODP_ERR("Unable to alloc pool ring %d\n", i);
@@ -395,7 +399,12 @@ static odp_pool_t pool_create(const char *name, odp_pool_param_t *params,
if (uarea_size)
uarea_size = ROUNDUP_CACHE_LINE(uarea_size);
- pool = reserve_pool();
+ if (num <= RING_SIZE_MIN)
+ ring_size = RING_SIZE_MIN;
+ else
+ ring_size = ROUNDUP_POWER2_U32(num);
+
+ pool = reserve_pool(ring_size);
if (pool == NULL) {
ODP_ERR("No more free pools");
@@ -431,11 +440,6 @@ static odp_pool_t pool_create(const char *name, odp_pool_param_t *params,
FIRST_HP_SIZE - 1) / FIRST_HP_SIZE);
}
- if (num <= RING_SIZE_MIN)
- ring_size = RING_SIZE_MIN;
- else
- ring_size = ROUNDUP_POWER2_U32(num);
-
pool->ring_mask = ring_size - 1;
pool->num = num;
pool->align = align;
@@ -506,11 +510,6 @@ static int check_params(odp_pool_param_t *params)
switch (params->type) {
case ODP_POOL_BUFFER:
- if (params->buf.num > capa.buf.max_num) {
- printf("buf.num too large %u\n", params->buf.num);
- return -1;
- }
-
if (params->buf.size > capa.buf.max_size) {
printf("buf.size too large %u\n", params->buf.size);
return -1;
@@ -550,10 +549,6 @@ static int check_params(odp_pool_param_t *params)
break;
case ODP_POOL_TIMEOUT:
- if (params->tmo.num > capa.tmo.max_num) {
- printf("tmo.num too large %u\n", params->tmo.num);
- return -1;
- }
break;
default:
@@ -663,12 +658,12 @@ static int generic_pool_capability(odp_pool_capability_t *capa)
capa->buf.max_pools = ODP_CONFIG_POOLS;
capa->buf.max_align = ODP_CONFIG_BUFFER_ALIGN_MAX;
capa->buf.max_size = MAX_SIZE;
- capa->buf.max_num = CONFIG_POOL_MAX_NUM;
+ capa->buf.max_num = 0;
/* Packet pools */
capa->pkt.max_pools = ODP_CONFIG_POOLS;
capa->pkt.max_len = CONFIG_PACKET_MAX_LEN;
- capa->pkt.max_num = CONFIG_POOL_MAX_NUM;
+ capa->pkt.max_num = 0;
capa->pkt.min_headroom = CONFIG_PACKET_HEADROOM;
capa->pkt.max_headroom = CONFIG_PACKET_HEADROOM;
capa->pkt.min_tailroom = CONFIG_PACKET_TAILROOM;
@@ -679,7 +674,7 @@ static int generic_pool_capability(odp_pool_capability_t *capa)
/* Timeout pools */
capa->tmo.max_pools = ODP_CONFIG_POOLS;
- capa->tmo.max_num = CONFIG_POOL_MAX_NUM;
+ capa->tmo.max_num = 0;
return 0;
}
diff --git a/platform/linux-generic/pool/subsystem.c b/platform/linux-generic/pool/subsystem.c
index c5f6449..c845ce1 100644
--- a/platform/linux-generic/pool/subsystem.c
+++ b/platform/linux-generic/pool/subsystem.c
@@ -7,7 +7,7 @@
*/
#include <odp/api/pool.h>
#include <odp_internal.h>
-#include <odp_pool_subsystem.h>
+#include <subsystem/spec/pool_subsystem.h>
#include <odp_debug_internal.h>
#include <odp_module.h>
diff --git a/platform/linux-generic/queue/generic.c b/platform/linux-generic/queue/generic.c
index ab2b970..37c0238 100644
--- a/platform/linux-generic/queue/generic.c
+++ b/platform/linux-generic/queue/generic.c
@@ -9,7 +9,7 @@
#include <odp/api/queue.h>
#include <odp_queue_internal.h>
#include <odp_queue_if.h>
-#include <odp_queue_subsystem.h>
+#include <subsystem/spec/queue_subsystem.h>
#include <odp/api/std_types.h>
#include <odp/api/align.h>
#include <odp/api/buffer.h>
diff --git a/platform/linux-generic/queue/scalable.c b/platform/linux-generic/queue/scalable.c
index 00cd8da..f4f5efb 100644
--- a/platform/linux-generic/queue/scalable.c
+++ b/platform/linux-generic/queue/scalable.c
@@ -23,7 +23,7 @@
#include <odp_packet_io_internal.h>
#include <odp_pool_internal.h>
#include <odp_queue_scalable_internal.h>
-#include <odp_queue_subsystem.h>
+#include <subsystem/spec/queue_subsystem.h>
#include <odp_schedule_if.h>
#include <_ishm_internal.h>
#include <_ishmpool_internal.h>
diff --git a/platform/linux-generic/queue/subsystem.c b/platform/linux-generic/queue/subsystem.c
index 5a88b2d..b53c440 100644
--- a/platform/linux-generic/queue/subsystem.c
+++ b/platform/linux-generic/queue/subsystem.c
@@ -11,7 +11,7 @@
#include <odp/api/queue.h>
#include <odp_internal.h>
#include <odp_debug_internal.h>
-#include <odp_queue_subsystem.h>
+#include <subsystem/spec/queue_subsystem.h>
#include <odp_module.h>
ODP_SUBSYSTEM_DEFINE(queue, "queue public APIs", QUEUE_SUBSYSTEM_VERSION);
diff --git a/platform/linux-generic/schedule/generic.c b/platform/linux-generic/schedule/generic.c
index 73fef40..e227628 100644
--- a/platform/linux-generic/schedule/generic.c
+++ b/platform/linux-generic/schedule/generic.c
@@ -25,7 +25,7 @@
#include <odp/api/packet_io.h>
#include <odp_ring_internal.h>
#include <odp_timer_internal.h>
-#include <odp_schedule_subsystem.h>
+#include <subsystem/spec/schedule_subsystem.h>
#include <odp_packet_io_internal.h>
/* Should remove this dependency */
diff --git a/platform/linux-generic/schedule/iquery.c b/platform/linux-generic/schedule/iquery.c
index 5de2298..76d96ff 100644
--- a/platform/linux-generic/schedule/iquery.c
+++ b/platform/linux-generic/schedule/iquery.c
@@ -25,7 +25,7 @@
#include <odp/api/packet_io.h>
#include <odp_config_internal.h>
#include <odp_timer_internal.h>
-#include <odp_schedule_subsystem.h>
+#include <subsystem/spec/schedule_subsystem.h>
#include <odp_packet_io_internal.h>
/* Should remove this dependency */
diff --git a/platform/linux-generic/schedule/scalable.c b/platform/linux-generic/schedule/scalable.c
index d8f5382..de9c652 100644
--- a/platform/linux-generic/schedule/scalable.c
+++ b/platform/linux-generic/schedule/scalable.c
@@ -29,7 +29,7 @@
#include <odp_llqueue.h>
#include <odp_queue_scalable_internal.h>
#include <odp_schedule_if.h>
-#include <odp_schedule_subsystem.h>
+#include <subsystem/spec/schedule_subsystem.h>
#include <odp_bitset.h>
#include <odp_packet_io_internal.h>
diff --git a/platform/linux-generic/schedule/sp.c b/platform/linux-generic/schedule/sp.c
index ea7b834..06e2a14 100644
--- a/platform/linux-generic/schedule/sp.c
+++ b/platform/linux-generic/schedule/sp.c
@@ -18,7 +18,7 @@
#include <odp_config_internal.h>
#include <odp_ring_internal.h>
#include <odp_timer_internal.h>
-#include <odp_schedule_subsystem.h>
+#include <subsystem/spec/schedule_subsystem.h>
#include <odp_packet_io_internal.h>
#include <odp_queue_internal.h>
diff --git a/platform/linux-generic/schedule/subsystem.c b/platform/linux-generic/schedule/subsystem.c
index ba9a095..516cdf3 100644
--- a/platform/linux-generic/schedule/subsystem.c
+++ b/platform/linux-generic/schedule/subsystem.c
@@ -15,7 +15,7 @@
#include <odp_debug_internal.h>
#include <odp_internal.h>
#include <odp_module.h>
-#include <odp_schedule_subsystem.h>
+#include <subsystem/spec/schedule_subsystem.h>
ODP_SUBSYSTEM_DEFINE(schedule, "schedule public APIs",
SCHEDULE_SUBSYSTEM_VERSION);
diff --git a/platform/linux-generic/test/wrapper-script.sh b/platform/linux-generic/test/wrapper-script.sh
new file mode 100755
index 0000000..977a032
--- /dev/null
+++ b/platform/linux-generic/test/wrapper-script.sh
@@ -0,0 +1,3 @@
+#wrapper script for pre setting environment for validation suit.
+#currently this is empty but needs to be created to make it align with
+#linux-dpdk.
diff --git a/test/Makefile.inc b/test/Makefile.inc
index eaf791e..3e7dfe5 100644
--- a/test/Makefile.inc
+++ b/test/Makefile.inc
@@ -20,6 +20,8 @@ AM_CFLAGS = $(CUNIT_CFLAGS)
AM_LDFLAGS = -L$(LIB) -static
+LOG_COMPILER = $(top_srcdir)/platform/@with_platform@/test/wrapper-script.sh
+
@VALGRIND_CHECK_RULES@
TESTS_ENVIRONMENT = ODP_PLATFORM=${with_platform} \
diff --git a/test/performance/Makefile.am b/test/performance/Makefile.am
index 1dccd82..4417c48 100644
--- a/test/performance/Makefile.am
+++ b/test/performance/Makefile.am
@@ -31,6 +31,6 @@ odp_sched_latency_SOURCES = odp_sched_latency.c
odp_scheduling_SOURCES = odp_scheduling.c
odp_pktio_perf_SOURCES = odp_pktio_perf.c
-dist_check_SCRIPTS = $(TESTSCRIPTS)
+dist_check_SCRIPTS = $(TESTSCRIPTS) $(LOG_COMPILER)
dist_check_DATA = udp64.pcap