From patchwork Thu Jul 6 19:00:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 107169 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2481940qge; Thu, 6 Jul 2017 12:01:40 -0700 (PDT) X-Received: by 10.55.158.19 with SMTP id h19mr58227885qke.201.1499367700818; Thu, 06 Jul 2017 12:01:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499367700; cv=none; d=google.com; s=arc-20160816; b=k/WYJXHHo1l+NVu41Gm4+VwEEIxo+aF4bNSS5skiT7gP8906l774PV4qDcAPguydkp Qto3KfgJps7qUPnDYwxgxXdmhsGctX9Zs8qCoS2zXcTk5TsPy0OMaJ9J1E8p7N+owQRH 0eKEbTkPSmUjzgI0XHanjS86BIfbjfZesfByh96nLTGHPydbgQcNFTC8QddrDmfzbQtd 4As76MX3+boHtQP05uf0KezRukdftSCkv/TQwDh/bRaR5Jl6rQXhdj4HiLuBMsJhqF5N hJ0yTI3F+HUjqkKziClJS8sy3sPnaFrie8A8gkrKV/5l0PYPixwOW7JNCQ+AHTK45/g7 I51Q== 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=1BGxD7SU8N37ZJW1Y+6CABhKAJaDoboTbRGgJenPtYs=; b=OfuJ/X5ramBsHFcUkgKc0x3vlopfQjY9uuwNv/q3gB9ob1myOzSD9zeHTgKkM1mQ0E Ai/lHWeK1ZL4IhrcDOJ2p86ZwsS3Dxcd7KcCaJ+gSCnGaxsxz/KElTTMQvVPfoxDpuL4 WAVHaGKoLuZkfTiXwibb/9TDT5Usd+TwdokHGLvQaUvXdqHHoAgWIrWLMDR7orh3bWz5 POEuGyyTfk1/ln5GZgWyOTtkYw95RIQ6LkEO5bF2E9CAiPsrgUgbyI5jb2tuF/4m1su1 xk1ilSfxQeQ9MUa4PDfYjMWeIVTWzMVRdArbD2y7i9usR4FJdcQXKW7YwgMMJCqtF2K9 0b1g== 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=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id x184si885236qke.29.2017.07.06.12.01.40; Thu, 06 Jul 2017 12:01:40 -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=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 6B2D16098B; Thu, 6 Jul 2017 19:01:40 +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=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,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 D341560C01; Thu, 6 Jul 2017 19:00:29 +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 79579607CC; Thu, 6 Jul 2017 19:00:21 +0000 (UTC) Received: from forward3p.cmail.yandex.net (forward3p.cmail.yandex.net [77.88.31.18]) by lists.linaro.org (Postfix) with ESMTPS id 46AD560676 for ; Thu, 6 Jul 2017 19:00:19 +0000 (UTC) Received: from smtp2j.mail.yandex.net (smtp2j.mail.yandex.net [95.108.130.60]) by forward3p.cmail.yandex.net (Yandex) with ESMTP id 13CDF20EA9 for ; Thu, 6 Jul 2017 22:00:17 +0300 (MSK) Received: from smtp2j.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2j.mail.yandex.net (Yandex) with ESMTP id C23313EC0F6C for ; Thu, 6 Jul 2017 22:00:16 +0300 (MSK) Received: by smtp2j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 9M4yClQF52-0FViVqaO; Thu, 06 Jul 2017 22:00:15 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) X-Yandex-Suid-Status: 1 0 From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 6 Jul 2017 22:00:07 +0300 Message-Id: <1499367608-22675-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1499367608-22675-1-git-send-email-odpbot@yandex.ru> References: <1499367608-22675-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 68 Subject: [lng-odp] [PATCH API-NEXT v2 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" From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 68 (lumag:packet-loop) ** https://github.com/Linaro/odp/pull/68 ** Patch: https://github.com/Linaro/odp/pull/68.patch ** Base sha: 15c97427d01c81dc9f4d0aafe9b0a99cdb2d1fc6 ** Merge commit sha: f522519bc003a772aeb56d2792e9c166894e5081 **/ platform/linux-generic/include/odp_buffer_inlines.h | 2 ++ platform/linux-generic/include/odp_buffer_internal.h | 3 +++ platform/linux-generic/odp_crypto.c | 15 +++++++++------ platform/linux-generic/odp_event.c | 15 +++++++++++++++ platform/linux-generic/odp_packet.c | 1 + platform/linux-generic/odp_pool.c | 11 +++++++++++ 6 files changed, 41 insertions(+), 6 deletions(-) diff --git a/platform/linux-generic/include/odp_buffer_inlines.h b/platform/linux-generic/include/odp_buffer_inlines.h index cf817d90..4c0e7339 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 076abe96..dadf285e 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_crypto.c b/platform/linux-generic/odp_crypto.c index 68fc5658..0e2adad1 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -907,12 +907,13 @@ odp_crypto_operation(odp_crypto_op_param_t *param, if (ODP_QUEUE_INVALID != session->p.compl_queue) { odp_event_t completion_event; odp_crypto_generic_op_result_t *op_result; + odp_buffer_t buf; /* Linux generic will always use packet for completion event */ completion_event = odp_packet_to_event(param->out_pkt); - _odp_buffer_event_type_set( - odp_buffer_from_event(completion_event), - ODP_EVENT_CRYPTO_COMPL); + buf = odp_buffer_from_event(completion_event); + _odp_buffer_event_type_set(buf, ODP_EVENT_CRYPTO_COMPL); + _odp_buffer_event_subtype_set(buf, ODP_EVENT_NO_SUBTYPE); /* Asynchronous, build result (no HW so no errors) and send it*/ op_result = get_op_result_from_event(completion_event); op_result->magic = OP_RESULT_MAGIC; @@ -1106,9 +1107,11 @@ odp_crypto_compl_result(odp_crypto_compl_t completion_event, void odp_crypto_compl_free(odp_crypto_compl_t completion_event) { - _odp_buffer_event_type_set( - odp_buffer_from_event((odp_event_t)completion_event), - ODP_EVENT_PACKET); + odp_buffer_t buf = + odp_buffer_from_event((odp_event_t)completion_event); + + _odp_buffer_event_type_set(buf, ODP_EVENT_PACKET); + _odp_buffer_event_subtype_set(buf, ODP_EVENT_PACKET_BASIC); } void odp_crypto_session_param_init(odp_crypto_session_param_t *param) diff --git a/platform/linux-generic/odp_event.c b/platform/linux-generic/odp_event.c index d71f4464..23b410d8 100644 --- a/platform/linux-generic/odp_event.c +++ b/platform/linux-generic/odp_event.c @@ -19,6 +19,21 @@ 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)); +} + +odp_event_type_t odp_event_types(odp_event_t event, + odp_event_subtype_t *subtype) +{ + odp_buffer_t buf = odp_buffer_from_event(event); + + *subtype = _odp_buffer_event_subtype(buf); + + return _odp_buffer_event_type(buf); +} + 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 eb66af2d..3789feca 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 9dba7341..23b80698 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 Thu Jul 6 19:00:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 107168 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2481137qge; Thu, 6 Jul 2017 12:01:03 -0700 (PDT) X-Received: by 10.55.221.76 with SMTP id n73mr14466785qki.186.1499367663490; Thu, 06 Jul 2017 12:01:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499367663; cv=none; d=google.com; s=arc-20160816; b=PrUjB7ucg7QVLjUbQ7o5sfTqfZS/mpArdtAo3u8fyglXJ8kRLH86GjS5KlipSldK7p l6xFX9BPWB6XY39zJ8rd9ajHdpHhgZ3yYRX/qgjkii7w5BhupQr3csz/SuNvUAGdBIce xXCO1tPFdz0AcJ2iHOSvfPGpiKVoI+saVkSQV23hRjwl25ZC7LJC09CYg5D9ptQiCoro O1hI1AhNYyNiBiE7TU6O6QNCQDWiojLyIHBrZczVb3Akus7R7xz+ZiMQT8SPooVkBkA5 ZN4LQOSgrxAYo/MI9IwWqgTQ846TwDgTAxSp0VtqJAvUdmBT1BVVO32BhTUx51v3Ymh+ f/2A== 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=+KpvgN6B2i1DdQpbxy+lDWpmTLE5DFKagM5Oft+gSWQ=; b=tDgNQSQOk9WeHmN821dcRS1gj5XGhvw583i+ZOg63Bsy2FeBrHowKWespI0Kx+hW86 tbVSm2yXwcUC/dkqgxL6PJqtI1+Ip7yfOxCl/l3cJogwIG/m92gNFic8lua5dGsOpJWG W6NZY+FaeOXPzSNyrJalEPdfikDIVa9TuLIHfxK83aV+CS3SJVjabksQfiYHMn414wm1 EkrVQqXHvKxZxeN4oBvXpkUOatYPrUkNKHQ0/nqFuDr6nwtM7AlZorKhwHqclMMAok/e +cJ2VJOG5OCPoyxb5svLkA7bBF7riLX2nYvhy9pcIh5+sYRgS3B/Ifd1fIv0zokZIrcf XucA== 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=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id e59si884914qtb.235.2017.07.06.12.01.03; Thu, 06 Jul 2017 12:01:03 -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=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 265E762B5D; Thu, 6 Jul 2017 19:01:03 +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=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,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 65C49609CF; Thu, 6 Jul 2017 19:00:24 +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 18EBA607E5; Thu, 6 Jul 2017 19:00:21 +0000 (UTC) Received: from forward5o.cmail.yandex.net (forward5o.cmail.yandex.net [37.9.109.249]) by lists.linaro.org (Postfix) with ESMTPS id A2FA560729 for ; Thu, 6 Jul 2017 19:00:19 +0000 (UTC) Received: from smtp2j.mail.yandex.net (smtp2j.mail.yandex.net [IPv6:2a02:6b8:0:801::ac]) by forward5o.cmail.yandex.net (Yandex) with ESMTP id B50DE20EC8 for ; Thu, 6 Jul 2017 22:00:17 +0300 (MSK) Received: from smtp2j.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2j.mail.yandex.net (Yandex) with ESMTP id 8D4943EC0F60 for ; Thu, 6 Jul 2017 22:00:17 +0300 (MSK) Received: by smtp2j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 9M4yClQF52-0GVCxqOF; Thu, 06 Jul 2017 22:00:16 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) X-Yandex-Suid-Status: 1 0 From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 6 Jul 2017 22:00:08 +0300 Message-Id: <1499367608-22675-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1499367608-22675-1-git-send-email-odpbot@yandex.ru> References: <1499367608-22675-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 68 Subject: [lng-odp] [PATCH API-NEXT v2 2/2] linux-gen: pktio: loop: reset packet subtype on loopback 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: Dmitry Eremin-Solenikov loop interface can get any kind of packets, but should output only basic packets. Reset packet subtype on loopback. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 68 (lumag:packet-loop) ** https://github.com/Linaro/odp/pull/68 ** Patch: https://github.com/Linaro/odp/pull/68.patch ** Base sha: 15c97427d01c81dc9f4d0aafe9b0a99cdb2d1fc6 ** Merge commit sha: f522519bc003a772aeb56d2792e9c166894e5081 **/ platform/linux-generic/pktio/loop.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c index c825393a..b1d311fa 100644 --- a/platform/linux-generic/pktio/loop.c +++ b/platform/linux-generic/pktio/loop.c @@ -165,6 +165,8 @@ static int loopback_send(pktio_entry_t *pktio_entry, int index ODP_UNUSED, for (i = 0; i < len; ++i) { hdr_tbl[i] = packet_to_buf_hdr(pkt_tbl[i]); + _odp_buffer_event_subtype_set(hdr_tbl[i]->handle.handle, + ODP_EVENT_PACKET_BASIC); bytes += odp_packet_len(pkt_tbl[i]); }