From patchwork Wed Jun 14 17:35:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Eremin-Solenikov X-Patchwork-Id: 105569 Delivered-To: patch@linaro.org Received: by 10.182.29.35 with SMTP id g3csp437331obh; Wed, 14 Jun 2017 10:36:00 -0700 (PDT) X-Received: by 10.200.61.153 with SMTP id v25mr1564671qtf.160.1497461760129; Wed, 14 Jun 2017 10:36:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497461760; cv=none; d=google.com; s=arc-20160816; b=KpHnkgCPIQ32quk8cUen9+Cqrg+cTNQAow0w7TtZrA8W4qte//NyyYurzXExmXQZJI OC3QA8ZqGxAUDHsZVguU5vZSHcp0G1Grqgp0AbHJ/0/6THbxogrydTTtWCcDDpnHmdFy GW//tNbQsXrIhcRJQLxI+eSQsHjo1MpOhp7R8PpMoAvTl0j4BYo3yB8NLE2hGM4d6iI+ BXXzzNE3o+sjT/H5DK9ARbjEB5mJn+O9muVs9iHFaFUS3nMK5fA9tNITBKNWtNg0Jcmf ITFHHqDI1vTsn0Q5/5najUo3YEYA9ipufrbZ05ZsVsxbGIWVZxDMRVoABMRwIoW5wZFn 5mmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:delivered-to:arc-authentication-results; bh=GiD+OJoelViD1u6Nu3pt9JLmBiESk+pYQaIfGfduV7I=; b=RpgMgCPAbwdlk5V0mPMgfPSbnvSBvzZY1M1OQ/H8ZwAYov/C1903Xl52r6fb2cc3wB /UZUEjiwMlRxCxzg2Ir9QnzSVT0iFBwbHky+Dz+LhuKHerHSZMx1/RO3EAXSkKKYXI7Z plReinhzz1x5aWaGyZO2yYKbqbOvrp1VtoSRJfl94ENWu6aAtHVGUvXpw/ns1mNU0mch bY/Tld89gmMUVvDNQiAdTa7iWoeCtsMdKwfRSBe+IQn6X56HgHjxhNNbvtiFuL0txuOt 7yamsxu7JmPzB7BtA5LYIV4D+cSVTvNBY2L9espY4ndoIQQynsl4Qj6p5Vk94llzOXmI nf+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id q32si518606qta.240.2017.06.14.10.35.59; Wed, 14 Jun 2017 10:36:00 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id CD98060969; Wed, 14 Jun 2017 17:35:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id BF7AD60C0E; Wed, 14 Jun 2017 17:35:39 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id D4742608D5; Wed, 14 Jun 2017 17:35:33 +0000 (UTC) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com [209.85.215.52]) by lists.linaro.org (Postfix) with ESMTPS id 80079608D5 for ; Wed, 14 Jun 2017 17:35:32 +0000 (UTC) Received: by mail-lf0-f52.google.com with SMTP id m77so6332147lfe.0 for ; Wed, 14 Jun 2017 10:35:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=GiD+OJoelViD1u6Nu3pt9JLmBiESk+pYQaIfGfduV7I=; b=LRRxE777LBu6ZosxjweCdv6zADiaVYqEKlUSdGyn/2BK+UP2RfVnvMGmqPx4YMqwta aP68TOVn3qj5lwFnjVGXX42MsKCvi3FGhZ2VJTESK5k9crlLn8dMAAELZDq5DM5fJMDI tNzjIRLviyFQhVn1P0KO42qnoBrYPp2BlfKZNR62kFmgBTrlDz2hnIncDDSmIlmfEdtR 0UDFT2ms56ufgxjOI7WMJqrcFSN5nngrV79ODCP1WusOriQiUXSEbe9TgK/ZBmN5/JhX HK0VkXJeTU6EEn7fnYAL4FIPOkPqx/thSzF5wATl+egUdgFnslRFmdoVRFEGu90C/vpe sD+w== X-Gm-Message-State: AKS2vOw+VqI6nNvXSVPt32wOnLYGMUNo7YdzQMKwIdIa1J/+Hx3u905z 5o2Y9eOFz8T2Re1GQ4Iu79BA X-Received: by 10.25.159.213 with SMTP id i204mr362888lfe.151.1497461731001; Wed, 14 Jun 2017 10:35:31 -0700 (PDT) Received: from forlindon.lumag.auriga.ru ([93.185.26.100]) by smtp.gmail.com with ESMTPSA id h70sm154187lfh.38.2017.06.14.10.35.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Jun 2017 10:35:30 -0700 (PDT) From: Dmitry Eremin-Solenikov To: lng-odp@lists.linaro.org Date: Wed, 14 Jun 2017 20:35:26 +0300 Message-Id: <20170614173527.17118-2-dmitry.ereminsolenikov@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170614173527.17118-1-dmitry.ereminsolenikov@linaro.org> References: <20170614173527.17118-1-dmitry.ereminsolenikov@linaro.org> Subject: [lng-odp] [PATCH API-NEXT 1/2] linux-generic: events subtype implementation X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Signed-off-by: Dmitry Eremin-Solenikov --- platform/linux-generic/include/odp_buffer_inlines.h | 2 ++ platform/linux-generic/include/odp_buffer_internal.h | 3 +++ platform/linux-generic/odp_event.c | 5 +++++ platform/linux-generic/odp_packet.c | 1 + platform/linux-generic/odp_pool.c | 11 +++++++++++ 5 files changed, 22 insertions(+) -- 2.11.0 diff --git a/platform/linux-generic/include/odp_buffer_inlines.h b/platform/linux-generic/include/odp_buffer_inlines.h index cf817d907ab5..4c0e73390948 100644 --- a/platform/linux-generic/include/odp_buffer_inlines.h +++ b/platform/linux-generic/include/odp_buffer_inlines.h @@ -21,6 +21,8 @@ extern "C" { odp_event_type_t _odp_buffer_event_type(odp_buffer_t buf); void _odp_buffer_event_type_set(odp_buffer_t buf, int ev); +odp_event_subtype_t _odp_buffer_event_subtype(odp_buffer_t buf); +void _odp_buffer_event_subtype_set(odp_buffer_t buf, int ev); int odp_buffer_snprint(char *str, uint32_t n, odp_buffer_t buf); static inline odp_buffer_t odp_hdr_to_buf(odp_buffer_hdr_t *hdr) diff --git a/platform/linux-generic/include/odp_buffer_internal.h b/platform/linux-generic/include/odp_buffer_internal.h index 076abe96e072..dadf285e796d 100644 --- a/platform/linux-generic/include/odp_buffer_internal.h +++ b/platform/linux-generic/include/odp_buffer_internal.h @@ -96,6 +96,9 @@ struct odp_buffer_hdr_t { /* Event type. Maybe different than pool type (crypto compl event) */ int8_t event_type; + /* Event subtype. Should be ODP_EVENT_NO_SUBTYPE except packets. */ + int8_t event_subtype; + /* Burst table */ struct odp_buffer_hdr_t *burst[BUFFER_BURST_SIZE]; diff --git a/platform/linux-generic/odp_event.c b/platform/linux-generic/odp_event.c index d71f4464af48..3cd4a73cbefb 100644 --- a/platform/linux-generic/odp_event.c +++ b/platform/linux-generic/odp_event.c @@ -19,6 +19,11 @@ odp_event_type_t odp_event_type(odp_event_t event) return _odp_buffer_event_type(odp_buffer_from_event(event)); } +odp_event_subtype_t odp_event_subtype(odp_event_t event) +{ + return _odp_buffer_event_subtype(odp_buffer_from_event(event)); +} + void odp_event_free(odp_event_t event) { switch (odp_event_type(event)) { diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index eb66af2d3b9c..3789feca45f9 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -268,6 +268,7 @@ static inline void packet_init(odp_packet_hdr_t *pkt_hdr, uint32_t len) CONFIG_PACKET_TAILROOM; pkt_hdr->input = ODP_PKTIO_INVALID; + pkt_hdr->buf_hdr.event_subtype = ODP_EVENT_PACKET_BASIC; } static inline void init_segments(odp_packet_hdr_t *pkt_hdr[], int num) diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index 9dba734130b4..23b80698d3b0 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -259,6 +259,7 @@ static void init_buffers(pool_t *pool) buf_hdr->size = seg_size; buf_hdr->type = type; buf_hdr->event_type = type; + buf_hdr->event_subtype = ODP_EVENT_NO_SUBTYPE; buf_hdr->pool_hdl = pool->pool_hdl; buf_hdr->uarea_addr = uarea; /* Show user requested size through API */ @@ -566,6 +567,16 @@ void _odp_buffer_event_type_set(odp_buffer_t buf, int ev) buf_hdl_to_hdr(buf)->event_type = ev; } +odp_event_subtype_t _odp_buffer_event_subtype(odp_buffer_t buf) +{ + return buf_hdl_to_hdr(buf)->event_subtype; +} + +void _odp_buffer_event_subtype_set(odp_buffer_t buf, int ev) +{ + buf_hdl_to_hdr(buf)->event_subtype = ev; +} + odp_pool_t odp_pool_lookup(const char *name) { uint32_t i; From patchwork Wed Jun 14 17:35:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Eremin-Solenikov X-Patchwork-Id: 105570 Delivered-To: patch@linaro.org Received: by 10.182.29.35 with SMTP id g3csp437525obh; Wed, 14 Jun 2017 10:36:31 -0700 (PDT) X-Received: by 10.55.51.78 with SMTP id z75mr1377571qkz.99.1497461791426; Wed, 14 Jun 2017 10:36:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497461791; cv=none; d=google.com; s=arc-20160816; b=W+m3jUjAThORcXdTxGmWXkiY5NuXm4lWHKMC4Bfhyv/90fRJRC0MyhZ1EjaAIlvUl2 eXHmXERga6yHan9M44ohnymEOlQF7yHbb2fEcXOdrxocFO0pYGP1P7YsokM+Soj55HZM a5VKIMkcOsY5QpzRTMf2owMlSuWrvTLwm/af7gqmI+vpALHqIrIgAgjiOkbo70nE6T4s 3IPdQirbja6A+qs95hueIn7ouoAGJepTVVkoSkm4aqWBqLOrkzDDtWaEsksolKXYaVsb EKBjO06wtHwOrpoq5gFkr+Vmz5VM9xhRLrpx1tJ4gLRvL+yKENJp1bX/7clPR2n4kVtz LzJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:delivered-to:arc-authentication-results; bh=o9NC1NWgF8EVbRbpQSsFOe1hcaAkyrc00y16WrdRg5I=; b=LwchPa66LIynZu6nHYTPkx3Hs0N8rCfcDPbb5z0REJ0Pq/UNJI1XNI4NVyKq/tpDuf Qhl3XC0hsvqp5maBSGW/09prwngp3sVsRn8eB66VAkgU9OR4FeKYxiE2q3MwftAw6Jse MyrJoC/2K9kQoS68Z5Nr8rBkEgD9ZmJJ3gXBBXqDTr0GTo+VWmcEucxuWGxmNG3P/qIM HRzVDqJNFwOmmD9uLE+knkmE6YLgFdtiTrzUScnyHKoMVyP/gRErSAS/V4+3I6yvdDGl kduyLTA55RUOL5Sn7GnrlZlET44/6I17la3zSEzp2hhBCAAOdd3k2Di4DUoFYuElgljt ytGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id l72si519049qki.98.2017.06.14.10.36.31; Wed, 14 Jun 2017 10:36:31 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 1694260609; Wed, 14 Jun 2017 17:36:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 2CA4B60C11; Wed, 14 Jun 2017 17:35:43 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id E9C0C60C0E; Wed, 14 Jun 2017 17:35:37 +0000 (UTC) Received: from mail-lf0-f47.google.com (mail-lf0-f47.google.com [209.85.215.47]) by lists.linaro.org (Postfix) with ESMTPS id A9BB360950 for ; Wed, 14 Jun 2017 17:35:33 +0000 (UTC) Received: by mail-lf0-f47.google.com with SMTP id v20so6320616lfa.1 for ; Wed, 14 Jun 2017 10:35:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=o9NC1NWgF8EVbRbpQSsFOe1hcaAkyrc00y16WrdRg5I=; b=O3LJosQzhv2ig3U7Pc5QLnKoPNYC2WwEPdrfznm3Va9zJej2SVnch/8H3+VNZwjVxy rq9OmwgwSg6V8laDidrZ9uHcGPJ5ZqyXO/HeoMl0c8KgLW6msEEfG8e2s0hKpYgaa+wf BXYSUhCN+NEcbnhEs1Ta3xRq/q6RWJOGH3qHDhG5P6scJHdAQq6HgmWHuGKdXBaRW6yj an0Y27IONQQGHYSdcmAtWJyGp08EYFBMV14vJr31MFKYhRkqLVc/R/2Ua3ow1VuTMd8R Gpkck+n987M65lFO7hYnOyc9zaAXiK61rd1WNKV/EUCc8l+tK3Fn3pNEOyAE0/I4oONs QLmA== X-Gm-Message-State: AKS2vOzZB/ij6ftKGF+udVjvWtULic3OxmBiRT3mH9btpj5laZEKpJb8 JdkaxSCZSpVS4coiVhjF4hCc X-Received: by 10.25.196.197 with SMTP id u188mr424315lff.159.1497461732026; Wed, 14 Jun 2017 10:35:32 -0700 (PDT) Received: from forlindon.lumag.auriga.ru ([93.185.26.100]) by smtp.gmail.com with ESMTPSA id h70sm154187lfh.38.2017.06.14.10.35.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Jun 2017 10:35:31 -0700 (PDT) From: Dmitry Eremin-Solenikov To: lng-odp@lists.linaro.org Date: Wed, 14 Jun 2017 20:35:27 +0300 Message-Id: <20170614173527.17118-3-dmitry.ereminsolenikov@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170614173527.17118-1-dmitry.ereminsolenikov@linaro.org> References: <20170614173527.17118-1-dmitry.ereminsolenikov@linaro.org> Subject: [lng-odp] [PATCH API-NEXT 2/2] validation: test correctness of events subtype implementation X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Signed-off-by: Dmitry Eremin-Solenikov --- test/common_plat/validation/api/buffer/buffer.c | 37 +++++++++++++++---------- test/common_plat/validation/api/packet/packet.c | 5 ++++ test/common_plat/validation/api/timer/timer.c | 14 ++++++++-- 3 files changed, 39 insertions(+), 17 deletions(-) -- 2.11.0 diff --git a/test/common_plat/validation/api/buffer/buffer.c b/test/common_plat/validation/api/buffer/buffer.c index 7c723d4f4df4..8fca8a1f0840 100644 --- a/test/common_plat/validation/api/buffer/buffer.c +++ b/test/common_plat/validation/api/buffer/buffer.c @@ -48,7 +48,8 @@ void buffer_test_pool_alloc(void) odp_buffer_t buffer[num]; odp_event_t ev; int index; - char wrong_type = 0, wrong_size = 0, wrong_align = 0; + odp_bool_t wrong_type = false, wrong_subtype = false; + odp_bool_t wrong_size = false, wrong_align = false; odp_pool_param_t params; odp_pool_param_init(¶ms); @@ -71,14 +72,16 @@ void buffer_test_pool_alloc(void) ev = odp_buffer_to_event(buffer[index]); if (odp_event_type(ev) != ODP_EVENT_BUFFER) - wrong_type = 1; + wrong_type = true; + if (odp_event_subtype(ev) != ODP_EVENT_NO_SUBTYPE) + wrong_subtype = true; if (odp_buffer_size(buffer[index]) < BUF_SIZE) - wrong_size = 1; + wrong_size = true; addr = (uintptr_t)odp_buffer_addr(buffer[index]); if ((addr % BUF_ALIGN) != 0) - wrong_align = 1; + wrong_align = true; if (wrong_type || wrong_size || wrong_align) odp_buffer_print(buffer[index]); @@ -90,9 +93,10 @@ void buffer_test_pool_alloc(void) index--; /* Check that the pool had correct buffers */ - CU_ASSERT(wrong_type == 0); - CU_ASSERT(wrong_size == 0); - CU_ASSERT(wrong_align == 0); + CU_ASSERT(!wrong_type); + CU_ASSERT(!wrong_subtype); + CU_ASSERT(!wrong_size); + CU_ASSERT(!wrong_align); for (; index >= 0; index--) odp_buffer_free(buffer[index]); @@ -123,7 +127,8 @@ void buffer_test_pool_alloc_multi(void) odp_buffer_t buffer[num + 1]; odp_event_t ev; int index; - char wrong_type = 0, wrong_size = 0, wrong_align = 0; + odp_bool_t wrong_type = false, wrong_subtype = false; + odp_bool_t wrong_size = false, wrong_align = false; odp_pool_param_t params; odp_pool_param_init(¶ms); @@ -146,14 +151,16 @@ void buffer_test_pool_alloc_multi(void) ev = odp_buffer_to_event(buffer[index]); if (odp_event_type(ev) != ODP_EVENT_BUFFER) - wrong_type = 1; + wrong_type = true; + if (odp_event_subtype(ev) != ODP_EVENT_NO_SUBTYPE) + wrong_subtype = true; if (odp_buffer_size(buffer[index]) < BUF_SIZE) - wrong_size = 1; + wrong_size = true; addr = (uintptr_t)odp_buffer_addr(buffer[index]); if ((addr % BUF_ALIGN) != 0) - wrong_align = 1; + wrong_align = true; if (wrong_type || wrong_size || wrong_align) odp_buffer_print(buffer[index]); @@ -163,9 +170,10 @@ void buffer_test_pool_alloc_multi(void) CU_ASSERT(index == num); /* Check that the pool had correct buffers */ - CU_ASSERT(wrong_type == 0); - CU_ASSERT(wrong_size == 0); - CU_ASSERT(wrong_align == 0); + CU_ASSERT(!wrong_type); + CU_ASSERT(!wrong_subtype); + CU_ASSERT(!wrong_size); + CU_ASSERT(!wrong_align); odp_buffer_free_multi(buffer, num); @@ -248,6 +256,7 @@ void buffer_test_management_basic(void) CU_ASSERT(odp_buffer_is_valid(raw_buffer) == 1); CU_ASSERT(odp_buffer_pool(raw_buffer) != ODP_POOL_INVALID); CU_ASSERT(odp_event_type(ev) == ODP_EVENT_BUFFER); + CU_ASSERT(odp_event_subtype(ev) == ODP_EVENT_NO_SUBTYPE); CU_ASSERT(odp_buffer_size(raw_buffer) >= BUF_SIZE); CU_ASSERT(odp_buffer_addr(raw_buffer) != NULL); odp_buffer_print(raw_buffer); diff --git a/test/common_plat/validation/api/packet/packet.c b/test/common_plat/validation/api/packet/packet.c index 284aaeb5ae56..3d55eff7479f 100644 --- a/test/common_plat/validation/api/packet/packet.c +++ b/test/common_plat/validation/api/packet/packet.c @@ -260,6 +260,8 @@ void packet_test_alloc_free(void) CU_ASSERT(odp_packet_len(packet) == packet_len); CU_ASSERT(odp_event_type(odp_packet_to_event(packet)) == ODP_EVENT_PACKET); + CU_ASSERT(odp_event_subtype(odp_packet_to_event(packet)) == + ODP_EVENT_PACKET_BASIC); CU_ASSERT(odp_packet_to_u64(packet) != odp_packet_to_u64(ODP_PACKET_INVALID)); @@ -332,6 +334,8 @@ void packet_test_alloc_free_multi(void) CU_ASSERT(odp_packet_len(packet[i]) == packet_len); CU_ASSERT(odp_event_type(odp_packet_to_event(packet[i])) == ODP_EVENT_PACKET); + CU_ASSERT(odp_event_subtype(odp_packet_to_event(packet[i])) == + ODP_EVENT_PACKET_BASIC); CU_ASSERT(odp_packet_to_u64(packet[i]) != odp_packet_to_u64(ODP_PACKET_INVALID)); } @@ -453,6 +457,7 @@ void packet_test_event_conversion(void) ev = odp_packet_to_event(pkt); CU_ASSERT_FATAL(ev != ODP_EVENT_INVALID); CU_ASSERT(odp_event_type(ev) == ODP_EVENT_PACKET); + CU_ASSERT(odp_event_subtype(ev) == ODP_EVENT_PACKET_BASIC); tmp_pkt = odp_packet_from_event(ev); CU_ASSERT_FATAL(tmp_pkt != ODP_PACKET_INVALID); diff --git a/test/common_plat/validation/api/timer/timer.c b/test/common_plat/validation/api/timer/timer.c index b7d84c64930e..a09f4d73f09f 100644 --- a/test/common_plat/validation/api/timer/timer.c +++ b/test/common_plat/validation/api/timer/timer.c @@ -59,7 +59,7 @@ void timer_test_timeout_pool_alloc(void) odp_timeout_t tmo[num]; odp_event_t ev; int index; - char wrong_type = 0; + odp_bool_t wrong_type = false, wrong_subtype = false; odp_pool_param_t params; odp_pool_param_init(¶ms); @@ -80,7 +80,9 @@ void timer_test_timeout_pool_alloc(void) ev = odp_timeout_to_event(tmo[index]); if (odp_event_type(ev) != ODP_EVENT_TIMEOUT) - wrong_type = 1; + wrong_type = true; + if (odp_event_subtype(ev) != ODP_EVENT_NO_SUBTYPE) + wrong_subtype = true; } /* Check that the pool had at least num items */ @@ -89,7 +91,8 @@ void timer_test_timeout_pool_alloc(void) index--; /* Check that the pool had correct buffers */ - CU_ASSERT(wrong_type == 0); + CU_ASSERT(!wrong_type); + CU_ASSERT(!wrong_subtype); for (; index >= 0; index--) odp_timeout_free(tmo[index]); @@ -225,6 +228,11 @@ static void handle_tmo(odp_event_t ev, bool stale, uint64_t prev_tick) CU_FAIL("Unexpected event type received"); return; } + if (odp_event_subtype(ev) != ODP_EVENT_NO_SUBTYPE) { + /* Not a timeout event */ + CU_FAIL("Unexpected event subtype received"); + return; + } /* Read the metadata from the timeout */ odp_timeout_t tmo = odp_timeout_from_event(ev); odp_timer_t tim = odp_timeout_timer(tmo);