From patchwork Thu Aug 9 12:00:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 143826 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2005419ljj; Thu, 9 Aug 2018 05:02:35 -0700 (PDT) X-Google-Smtp-Source: AA+uWPznx7ztVNPJjRWj2Q6f617bd8B01JSxw45SCV9p4i4cAXc9P5ozkBAYI9K/arZPntyXszg2 X-Received: by 2002:aed:39a3:: with SMTP id m32-v6mr1672877qte.109.1533816155639; Thu, 09 Aug 2018 05:02:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533816155; cv=none; d=google.com; s=arc-20160816; b=vJfS43Ul+RJehEzpV5iJy+Yo5wUzQWU4kBZtzdLYr+RFIc7wMKYSONEAr+OhPJGTn0 OmFMldHULQRA8ttk7zWWVXZRNe67tR9cAtU9v7ZkkNeH0+T1c5GKQmhFz5Rb/Z4II26Y O8x8P+bamSJ06hHKPT+cBPBoQWDgkZEvNqcPTaRZBWmEBLW7R0TwBKF6kqmWWPCjve6z ucT930SkJgYmmTaBLvuazwwfBGwoGIUs5JGyly2bnIKe8Ag0Nrk/3bnhGFrJbMbHTaNc Cb0/P3iW9wEqyvtj1m5QWECp19QG3Ir7lVMRx9B20e+NajFvWhlde3JXrJYP/mpVaptS pJIw== 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:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=OiJH6tzzizgJ1Yi276fE33lPVpf4Q3xU5B3nanoA86E=; b=qbGCYFVwBtBIiszVdpv/zZOyfNM7Fur9A20cHFh0E2ZOa+psJOJR9+QpKZsyorwX1l WTpEFCkr8z2V5CTDdFTVT1Gcux38E8ybgFtkaPvMXNbc/yqhDKQkzgSg3fvlebxxBB1J p6Wd7Y5Ppf5RNk6sbSnhZnlCjS7SSDamieDpd3qg3OGr7rqx5soTbzA9S+daM7Sz0Fjb /kEAW70E4p08vzAo7vuUi7GG6PGbZg2rrs6lK/epViiOYLf36lAqWdjD7SCJZhc1h7YY k+yaiETpf+Jg62ccpUPX66nGEZFjkxiUsrSuQWrM/WiZq7OtEj1f4+uBfss2apmVIILC amvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id c62-v6si971790qkh.295.2018.08.09.05.02.35; Thu, 09 Aug 2018 05:02:35 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 31A1168629; Thu, 9 Aug 2018 12:02:35 +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=-3.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 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 2FCF160736; Thu, 9 Aug 2018 12:01:30 +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 F08566861D; Thu, 9 Aug 2018 12:01:16 +0000 (UTC) Received: from forward106j.mail.yandex.net (forward106j.mail.yandex.net [5.45.198.249]) by lists.linaro.org (Postfix) with ESMTPS id D2C0260736 for ; Thu, 9 Aug 2018 12:00:10 +0000 (UTC) Received: from mxback5g.mail.yandex.net (mxback5g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:166]) by forward106j.mail.yandex.net (Yandex) with ESMTP id 759DE18058ED for ; Thu, 9 Aug 2018 15:00:09 +0300 (MSK) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [2a02:6b8:0:1402::15:6]) by mxback5g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id xQodyr8oWY-09uSO1Ii; Thu, 09 Aug 2018 15:00:09 +0300 Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id M6ygb3U54b-08vKGLlb; Thu, 09 Aug 2018 15:00:08 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 9 Aug 2018 12:00:05 +0000 Message-Id: <1533816007-30726-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533816007-30726-1-git-send-email-odpbot@yandex.ru> References: <1533816007-30726-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 669 Subject: [lng-odp] [PATCH API-NEXT v1 1/3] api: packet: add subtype call 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" From: Petri Savolainen This call is useful when packet subtype needs to be checked sometime after an event has been converted into a packet. The first application stage (receiving and converting events) does not have to record packet subtype for following application stages that process only packets, not events. Signed-off-by: Petri Savolainen --- /** Email created from pull request 669 (psavol:next-packet-subtype) ** https://github.com/Linaro/odp/pull/669 ** Patch: https://github.com/Linaro/odp/pull/669.patch ** Base sha: 9b2b5a9695ad66977c964c83691cd2fef4c45b85 ** Merge commit sha: 3a6201b601ab55e07cbfd561fa9904ba48035478 **/ include/odp/api/spec/packet.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h index 66665e121..78e519ac3 100644 --- a/include/odp/api/spec/packet.h +++ b/include/odp/api/spec/packet.h @@ -224,6 +224,19 @@ typedef enum odp_packet_chksum_status_t { } odp_packet_chksum_status_t; +/** + * Event subtype of a packet + * + * Returns the subtype of a packet event. Subtype tells if the packet contains + * only basic metadata (ODP_EVENT_PACKET_BASIC) or in addition to that some + * specific metadata (e.g. ODP_EVENT_PACKET_CRYPTO or ODP_EVENT_PACKET_IPSEC). + * + * @param packet Packet handle + * + * @return Packet subtype + */ +odp_event_subtype_t odp_packet_subtype(odp_packet_t packet); + /* * * Alloc and free From patchwork Thu Aug 9 12:00:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 143825 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2003598ljj; Thu, 9 Aug 2018 05:01:24 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzJDsDWfbo6tgJnl4F97M4kQ+ytlgF6asGVCXFSqSQQfWXVjjizWJhhKnuOHFzD4FeXBiA1 X-Received: by 2002:ac8:71c9:: with SMTP id i9-v6mr1604305qtp.22.1533816084831; Thu, 09 Aug 2018 05:01:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533816084; cv=none; d=google.com; s=arc-20160816; b=aml/Y7KhbtROOMI95X53vALnInGuw9wey5OcQmrSzfazOKIJRI7ZHwXxxWFsnXDT8r lug0skPENZFubKkbJhxCmVmVwf2bx81Y8B2ky5Awnv3fZs53BK3ikN/t5ZzhATSEb+ET jmR7lIav6ngGWiLf/ku5NAAdGhRwuE77scYGl/XLMWUlCageIDl5G0bpVSpn7GB9wSo7 BPQrkEFUwE+Vdk7ECKyY3LuI2jYy/i7wdXF6W5VAVZgNjfdqxX/O80IxrIFxjG+6GHOO Gdw5OBUTRn4vixG23APrKb878RVEI0nAptgR44Hop61JKuOzeRy7t6xkBpdUGNH4T8Tn AYwg== 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:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=/UmGcz0JOIrgQV5WR9+H/UCNT6BNlG8ncjGDddVHVX0=; b=Zr8c+ZynVEPQZHUsglHbm5rBhd/RlK6+fEv3MdE1iufeU9NE2zkwvxpj94X8+PiKgK FQ4RB/vA+klGFmxcJaTWfVmzaOpfOWhcov4RoKiYVQibSLC0m/tTpbPAWhjuRlqsNLZw C7HjQhz8L+C5draG5YI8NquvFhMupSQhhuES2ZmpLjLi6DftGZpIo5cvUykpfQ6ojYXC /W622IG6NgSAbIN2TE1lrcAPLlSxfkIF90GWUIS3facdJLJ1lcb2CnYjE7XmE+/K9uKN F3e1lnOIWBulwsFQ95MHJ24dVTE/voKV3PXMLrTDpTvClD+eSBr/OlH5yOoA0cmN0g/f u0iw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id p66-v6si2494191qkc.39.2018.08.09.05.01.24; Thu, 09 Aug 2018 05:01:24 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 340436861C; Thu, 9 Aug 2018 12:01:24 +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=-3.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW 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 712F360736; Thu, 9 Aug 2018 12:01:20 +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 05B596861F; Thu, 9 Aug 2018 12:01:14 +0000 (UTC) Received: from forward100j.mail.yandex.net (forward100j.mail.yandex.net [5.45.198.240]) by lists.linaro.org (Postfix) with ESMTPS id 6097F68625 for ; Thu, 9 Aug 2018 12:00:12 +0000 (UTC) Received: from mxback15j.mail.yandex.net (mxback15j.mail.yandex.net [IPv6:2a02:6b8:0:1619::91]) by forward100j.mail.yandex.net (Yandex) with ESMTP id 678895D85284 for ; Thu, 9 Aug 2018 15:00:10 +0300 (MSK) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [2a02:6b8:0:1402::15:6]) by mxback15j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 5Pky7r6FsN-0ALOgD3Y; Thu, 09 Aug 2018 15:00:10 +0300 Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id M6ygb3U54b-09vioXT3; Thu, 09 Aug 2018 15:00:09 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 9 Aug 2018 12:00:06 +0000 Message-Id: <1533816007-30726-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533816007-30726-1-git-send-email-odpbot@yandex.ru> References: <1533816007-30726-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 669 Subject: [lng-odp] [PATCH API-NEXT v1 2/3] linux-gen: packet: implementation subtype api 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" From: Petri Savolainen Add inlined implementation of the new subtype API call and use that internally. Signed-off-by: Petri Savolainen --- /** Email created from pull request 669 (psavol:next-packet-subtype) ** https://github.com/Linaro/odp/pull/669 ** Patch: https://github.com/Linaro/odp/pull/669.patch ** Base sha: 9b2b5a9695ad66977c964c83691cd2fef4c45b85 ** Merge commit sha: 3a6201b601ab55e07cbfd561fa9904ba48035478 **/ .../include/odp/api/plat/packet_inline_types.h | 1 + .../linux-generic/include/odp/api/plat/packet_inlines.h | 7 +++++++ platform/linux-generic/include/odp_packet_internal.h | 5 ----- platform/linux-generic/odp_event.c | 5 +++-- platform/linux-generic/odp_packet.c | 3 ++- platform/linux-generic/pktio/loop.c | 3 ++- 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/platform/linux-generic/include/odp/api/plat/packet_inline_types.h b/platform/linux-generic/include/odp/api/plat/packet_inline_types.h index 9a285fe4a..ca3abbfab 100644 --- a/platform/linux-generic/include/odp/api/plat/packet_inline_types.h +++ b/platform/linux-generic/include/odp/api/plat/packet_inline_types.h @@ -45,6 +45,7 @@ typedef struct _odp_packet_inline_offset_t { uint16_t timestamp; uint16_t input_flags; uint16_t flags; + uint16_t subtype; } _odp_packet_inline_offset_t; diff --git a/platform/linux-generic/include/odp/api/plat/packet_inlines.h b/platform/linux-generic/include/odp/api/plat/packet_inlines.h index e2c32728c..ec5beb819 100644 --- a/platform/linux-generic/include/odp/api/plat/packet_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/packet_inlines.h @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -64,6 +65,7 @@ #define odp_packet_to_event __odp_packet_to_event #define odp_packet_from_event_multi __odp_packet_from_event_multi #define odp_packet_to_event_multi __odp_packet_to_event_multi + #define odp_packet_subtype __odp_packet_subtype #else #undef _ODP_INLINE #define _ODP_INLINE @@ -355,6 +357,11 @@ _ODP_INLINE void odp_packet_to_event_multi(const odp_packet_t pkt[], ev[i] = odp_packet_to_event(pkt[i]); } +_ODP_INLINE odp_event_subtype_t odp_packet_subtype(odp_packet_t pkt) +{ + return (odp_event_subtype_t)_odp_pkt_get(pkt, int8_t, subtype); +} + /** @endcond */ #endif diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index cd2db2ecd..9b995c61c 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -155,11 +155,6 @@ static inline seg_entry_t *seg_entry_last(odp_packet_hdr_t *hdr) return &last->buf_hdr.seg[last_seg]; } -static inline odp_event_subtype_t packet_subtype(odp_packet_t pkt) -{ - return packet_hdr(pkt)->subtype; -} - static inline void packet_subtype_set(odp_packet_t pkt, int ev) { packet_hdr(pkt)->subtype = ev; diff --git a/platform/linux-generic/odp_event.c b/platform/linux-generic/odp_event.c index fa20af5f5..bb378528b 100644 --- a/platform/linux-generic/odp_event.c +++ b/platform/linux-generic/odp_event.c @@ -19,6 +19,7 @@ /* Inlined API functions */ #include +#include odp_event_subtype_t odp_event_subtype(odp_event_t event) { @@ -26,7 +27,7 @@ odp_event_subtype_t odp_event_subtype(odp_event_t event) ODP_EVENT_PACKET) return ODP_EVENT_NO_SUBTYPE; - return packet_subtype(odp_packet_from_event(event)); + return odp_packet_subtype(odp_packet_from_event(event)); } odp_event_type_t odp_event_types(odp_event_t event, @@ -36,7 +37,7 @@ odp_event_type_t odp_event_types(odp_event_t event, odp_event_type_t event_type = _odp_buffer_event_type(buf); *subtype = event_type == ODP_EVENT_PACKET ? - packet_subtype(odp_packet_from_event(event)) : + odp_packet_subtype(odp_packet_from_event(event)) : ODP_EVENT_NO_SUBTYPE; return event_type; diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 11f8bd43d..7bb93e1e1 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -50,7 +50,8 @@ const _odp_packet_inline_offset_t ODP_ALIGNED_CACHE _odp_packet_inline = { .flow_hash = offsetof(odp_packet_hdr_t, flow_hash), .timestamp = offsetof(odp_packet_hdr_t, timestamp), .input_flags = offsetof(odp_packet_hdr_t, p.input_flags), - .flags = offsetof(odp_packet_hdr_t, p.flags) + .flags = offsetof(odp_packet_hdr_t, p.flags), + .subtype = offsetof(odp_packet_hdr_t, subtype) }; diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c index faaef3ab5..4c0cba3f9 100644 --- a/platform/linux-generic/pktio/loop.c +++ b/platform/linux-generic/pktio/loop.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -309,7 +310,7 @@ static int loopback_send(pktio_entry_t *pktio_entry, int index ODP_UNUSED, for (i = 0; i < nb_tx; ++i) { odp_ipsec_packet_result_t result; - if (packet_subtype(pkt_tbl[i]) == + if (odp_packet_subtype(pkt_tbl[i]) == ODP_EVENT_PACKET_IPSEC && pktio_entry->s.config.outbound_ipsec) { From patchwork Thu Aug 9 12:00:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 143827 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2006115ljj; Thu, 9 Aug 2018 05:03:08 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxhoJqhnCyC3UHhtWxUopNPwuP3XO2YIKpbyPV8wANjBsg72O1faqCgGSPV0uO1cCKG+xIr X-Received: by 2002:ac8:4402:: with SMTP id j2-v6mr1637582qtn.233.1533816188433; Thu, 09 Aug 2018 05:03:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533816188; cv=none; d=google.com; s=arc-20160816; b=lwKfXsxMe+fgAtGsSKK7CWjLCfnm8Zkkgo6W9pF6CSgEIlnujVGu2SHQB8cgDQFVUz tkTAuGQkswGC2eVACPzrGB//30q8/UziD09IcpXbeWcYqh9eMPyqVQ9AFFTIXS/OJddh NZPELmPJz8gYF3mNy47NQ3WW8T34OJWWyEUAyHaruXO+i36QSDBl4d+nnKudyU4G3Uwk UwOp70Rvc8458qYoGoW7zsDmUBg7PUx8rWt0Wg02/xzjvoKEH6bsj4r4oLbmP9rQanOU r29bKV4HNcNVfkEfQoDRkn+hSExc+uy/ByrB717nw4Uo83eeXYUjAirzvkaLqldkc1ga Vajw== 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:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=NibIqNsrCogjHAbvQFnBjXzrHLfNRFX/VatpIk9Zb5c=; b=ed8unIomPROgbC+eIr4bRTyp+NE0hmsxOyqPuxKIrVm61jSbFwUEzG4ZEjHrDl8hSB 7QmvkOQXzTkGG5C9uuKXRw4jaUaq8TKusfSlHM7FhWSo/dkgYSwVJRD5ERbqHxTvXRjk LGZTF7gfMdVdIs2gyD60aIr1OaB/FO5Y2wtc5XY4otLYSnCGUCk2tOJ926/vnJKBVJ+H i6328wCFY4K7BVguEhiR+BWEkJIJT48zuk6RTyJhK3QvenoON5D3kugdZdl/6zp/CjqX xGEcFVZFn8Yn2K9yqz/LtJCnWXXEmBSvX2K15ckixiyp8eBmh4lGjmD/uLCCQ6Qg9rDl qBvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id p1-v6si1049353qvn.128.2018.08.09.05.03.08; Thu, 09 Aug 2018 05:03:08 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 1D9ED68617; Thu, 9 Aug 2018 12:03:08 +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=-3.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW 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 7043B6861A; Thu, 9 Aug 2018 12:01:34 +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 610B668605; Thu, 9 Aug 2018 12:01:19 +0000 (UTC) Received: from forward101o.mail.yandex.net (forward101o.mail.yandex.net [37.140.190.181]) by lists.linaro.org (Postfix) with ESMTPS id 055CB68626 for ; Thu, 9 Aug 2018 12:00:13 +0000 (UTC) Received: from mxback13g.mail.yandex.net (mxback13g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:92]) by forward101o.mail.yandex.net (Yandex) with ESMTP id 0523B1343F71 for ; Thu, 9 Aug 2018 15:00:11 +0300 (MSK) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [2a02:6b8:0:1402::15:6]) by mxback13g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id QvKQqlwP8k-0AtWVAPT; Thu, 09 Aug 2018 15:00:10 +0300 Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id M6ygb3U54b-0Av8FHPH; Thu, 09 Aug 2018 15:00:10 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 9 Aug 2018 12:00:07 +0000 Message-Id: <1533816007-30726-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533816007-30726-1-git-send-email-odpbot@yandex.ru> References: <1533816007-30726-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 669 Subject: [lng-odp] [PATCH API-NEXT v1 3/3] validation: packet: add packet subtype tests 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" From: Petri Savolainen Check that packet subtype is correct. Signed-off-by: Petri Savolainen --- /** Email created from pull request 669 (psavol:next-packet-subtype) ** https://github.com/Linaro/odp/pull/669 ** Patch: https://github.com/Linaro/odp/pull/669.patch ** Base sha: 9b2b5a9695ad66977c964c83691cd2fef4c45b85 ** Merge commit sha: 3a6201b601ab55e07cbfd561fa9904ba48035478 **/ .../validation/api/crypto/odp_crypto_test_inp.c | 2 ++ test/validation/api/ipsec/ipsec.c | 17 +++++++++++++++-- test/validation/api/packet/packet.c | 3 +++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index 07f1d1fac..5b395c2a6 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -225,6 +225,7 @@ static int alg_packet_op(odp_packet_t pkt, CU_ASSERT(ODP_EVENT_PACKET == odp_event_types(odp_packet_to_event(pkt), &subtype)); CU_ASSERT(ODP_EVENT_PACKET_CRYPTO == subtype); + CU_ASSERT(odp_packet_subtype(pkt) == ODP_EVENT_PACKET_CRYPTO); rc = odp_crypto_result(&result, pkt); if (rc < 0) { @@ -298,6 +299,7 @@ static int alg_packet_op_enq(odp_packet_t pkt, CU_ASSERT(ODP_EVENT_PACKET == odp_event_types(odp_packet_to_event(pkt), &subtype)); CU_ASSERT(ODP_EVENT_PACKET_CRYPTO == subtype); + CU_ASSERT(odp_packet_subtype(pkt) == ODP_EVENT_PACKET_CRYPTO); rc = odp_crypto_result(&result, pkt); if (rc < 0) { diff --git a/test/validation/api/ipsec/ipsec.c b/test/validation/api/ipsec/ipsec.c index 31a6f9b53..be47d109b 100644 --- a/test/validation/api/ipsec/ipsec.c +++ b/test/validation/api/ipsec/ipsec.c @@ -502,6 +502,7 @@ static int ipsec_send_in_one(const ipsec_test_part *part, pkto, &num_out, ¶m)); CU_ASSERT_EQUAL(num_out, part->out_pkt); + CU_ASSERT(odp_packet_subtype(*pkto) == ODP_EVENT_PACKET_IPSEC); } else if (ODP_IPSEC_OP_MODE_ASYNC == suite_context.inbound_op_mode) { CU_ASSERT_EQUAL(1, odp_ipsec_in_enq(&pkt, 1, ¶m)); @@ -517,6 +518,8 @@ static int ipsec_send_in_one(const ipsec_test_part *part, odp_event_types(event, &subtype)); CU_ASSERT_EQUAL(ODP_EVENT_PACKET_IPSEC, subtype); pkto[i] = odp_ipsec_packet_from_event(event); + CU_ASSERT(odp_packet_subtype(pkto[i]) == + ODP_EVENT_PACKET_IPSEC); } } else { odp_queue_t queue; @@ -555,7 +558,10 @@ static int ipsec_send_in_one(const ipsec_test_part *part, subtype); CU_ASSERT(!part->out[i].status.error.sa_lookup); - pkto[i++] = odp_ipsec_packet_from_event(ev); + pkto[i] = odp_ipsec_packet_from_event(ev); + CU_ASSERT(odp_packet_subtype(pkto[i]) == + ODP_EVENT_PACKET_IPSEC); + i++; continue; } } @@ -586,6 +592,8 @@ static int ipsec_send_out_one(const ipsec_test_part *part, pkto, &num_out, ¶m)); CU_ASSERT_EQUAL(num_out, part->out_pkt); + CU_ASSERT(odp_packet_subtype(*pkto) == + ODP_EVENT_PACKET_IPSEC); } else if (ODP_IPSEC_OP_MODE_ASYNC == suite_context.outbound_op_mode) { CU_ASSERT_EQUAL(1, odp_ipsec_out_enq(&pkt, 1, ¶m)); @@ -601,6 +609,8 @@ static int ipsec_send_out_one(const ipsec_test_part *part, odp_event_types(event, &subtype)); CU_ASSERT_EQUAL(ODP_EVENT_PACKET_IPSEC, subtype); pkto[i] = odp_ipsec_packet_from_event(event); + CU_ASSERT(odp_packet_subtype(pkto[i]) == + ODP_EVENT_PACKET_IPSEC); } } else { struct odp_ipsec_out_inline_param_t inline_param; @@ -657,7 +667,10 @@ static int ipsec_send_out_one(const ipsec_test_part *part, subtype); CU_ASSERT(part->out[i].status.error.all); - pkto[i++] = odp_ipsec_packet_from_event(ev); + pkto[i] = odp_ipsec_packet_from_event(ev); + CU_ASSERT(odp_packet_subtype(pkto[i]) == + ODP_EVENT_PACKET_IPSEC); + i++; continue; } } diff --git a/test/validation/api/packet/packet.c b/test/validation/api/packet/packet.c index a564c0028..fa7ce8b82 100644 --- a/test/validation/api/packet/packet.c +++ b/test/validation/api/packet/packet.c @@ -319,6 +319,7 @@ static void packet_test_alloc_free(void) CU_ASSERT(odp_event_types(odp_packet_to_event(packet), &subtype) == ODP_EVENT_PACKET); CU_ASSERT(subtype == ODP_EVENT_PACKET_BASIC); + CU_ASSERT(odp_packet_subtype(packet) == ODP_EVENT_PACKET_BASIC); CU_ASSERT(odp_packet_to_u64(packet) != odp_packet_to_u64(ODP_PACKET_INVALID)); @@ -402,6 +403,8 @@ static void packet_test_alloc_free_multi(void) &subtype) == ODP_EVENT_PACKET); CU_ASSERT(subtype == ODP_EVENT_PACKET_BASIC); + CU_ASSERT(odp_packet_subtype(packet[i]) == + ODP_EVENT_PACKET_BASIC); CU_ASSERT(odp_packet_to_u64(packet[i]) != odp_packet_to_u64(ODP_PACKET_INVALID));