From patchwork Wed Feb 14 08:00:08 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: 128322 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp348134ljc; Wed, 14 Feb 2018 00:09:48 -0800 (PST) X-Google-Smtp-Source: AH8x2256/Dsz9azIHZ6uukz1Pty29HWXYrQmGsQNs0JuhKU4FHiPGS9dGs7NbZUwZmKfXJJduNkC X-Received: by 10.55.189.7 with SMTP id n7mr6405363qkf.50.1518595788024; Wed, 14 Feb 2018 00:09:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518595788; cv=none; d=google.com; s=arc-20160816; b=KjTFsjWaIzoHmy3+IJ+ieVDuD3ZrpTz55grjg2RxhtwYd9kJgi7ZpXolbuv4aa4fOH ut6Mz64sOCF0z4f4uquzeOW/vproZZjhwSj+qVGZrFA/LaOc/6l8134SWD09B6nvX2RR vL+SlxIiQBu31hC7XOALwPuxu9KGRkhSAqOQs5qcEYys/yk6j0BBpPt58ZSyDaMMHMYy 2v3yM7UZ2Y6sg6UiM/rIQMT3YpUJJ0niYmzujZg0opU9zS/EZD0o0cDxh0gCU7uI8Hkn /IqPT5NuNHbd/gT3Uckve/ljjEBvE0En/z1dZ27pbvGCDS056nqqsclaKMuOUyCmyv23 B4Iw== 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=dzOexs80AVtHc/PgUgMEynEwPSLnyzS+QQUCAIhtyAI=; b=yi0RQfvAvDWaqW0+dbUbp6sMpmWCefQ/HWUofDRsHv49abfULnwgPULvaa+4dvoXfD hs8Z8Wn3VK1RNEPBaci8wuX28ZvYl4bpOmaTmw+UmQtmBD2D4R7sSXrPuWizk1+ZXNSW xFQ/MFVtRFw0wPxjw5qaUsX8ETkjXXQHphS0TSRkasaaRSVdTcepf3/zG/7ET5Ojwq0n NB6QAgAsbW8HBArk8rgzRIyBMnHyWzy58spOa2YBYlPYuFlUJ9RFMXVsZomhxSgsJOUz VRnwW03ks4F+N+5gSkA3ZX2yTft7IJhHU26NVYPq7cUWty4FVpzwThgIVsMuSgqT9lcq UCkg== 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 o22si4785205qtm.367.2018.02.14.00.09.47; Wed, 14 Feb 2018 00:09:48 -0800 (PST) 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 A7EAF617B2; Wed, 14 Feb 2018 08:09:47 +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 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 9DE5B6178F; Wed, 14 Feb 2018 08:03:05 +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 A0DBD617D5; Wed, 14 Feb 2018 08:03:00 +0000 (UTC) Received: from forward103o.mail.yandex.net (forward103o.mail.yandex.net [37.140.190.177]) by lists.linaro.org (Postfix) with ESMTPS id E1085617A6 for ; Wed, 14 Feb 2018 08:01:19 +0000 (UTC) Received: from mxback4g.mail.yandex.net (mxback4g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:165]) by forward103o.mail.yandex.net (Yandex) with ESMTP id 4575C5886CE7 for ; Wed, 14 Feb 2018 11:00:12 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback4g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id mHyc1mRcOC-0ClGevl2; Wed, 14 Feb 2018 11:00:12 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id U4m2dG5MWg-0BW8vUHx; Wed, 14 Feb 2018 11:00:11 +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: Wed, 14 Feb 2018 11:00:08 +0300 Message-Id: <1518595209-773-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518595209-773-1-git-send-email-odpbot@yandex.ru> References: <1518595209-773-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 476 Subject: [lng-odp] [PATCH API-NEXT v2 1/2] api: packet add L2 packet type to complement L3 and L4 types 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 476 (lumag:l2-type) ** https://github.com/Linaro/odp/pull/476 ** Patch: https://github.com/Linaro/odp/pull/476.patch ** Base sha: af7be638ef9ac98bdb1f2e4917f152889eb1850f ** Merge commit sha: 07d4eead898ce4cf6c7a574495f3622b7aa9d27d **/ include/odp/api/abi-default/packet.h | 5 +++++ include/odp/api/spec/packet.h | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/include/odp/api/abi-default/packet.h b/include/odp/api/abi-default/packet.h index b83288d4c..f9efdc7c0 100644 --- a/include/odp/api/abi-default/packet.h +++ b/include/odp/api/abi-default/packet.h @@ -30,6 +30,11 @@ typedef _odp_abi_packet_seg_t *odp_packet_seg_t; #define ODP_PACKET_SEG_INVALID ((odp_packet_seg_t)0xffffffff) #define ODP_PACKET_OFFSET_INVALID 0xffff +typedef uint8_t odp_proto_l2_type_t; + +#define ODP_PROTO_L2_TYPE_NONE 0 +#define ODP_PROTO_L2_TYPE_ETH 1 + typedef uint8_t odp_proto_l3_type_t; #define ODP_PROTO_L3_TYPE_NONE 0 diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h index 4be515c7b..423b492da 100644 --- a/include/odp/api/spec/packet.h +++ b/include/odp/api/spec/packet.h @@ -71,6 +71,19 @@ extern "C" { * Packet is red */ +/** + * @typedef odp_proto_l2_type_t + * Layer 2 protocol type + */ + +/** + * @def ODP_PROTO_L2_TYPE_NONE + * Layer 2 protocol type not defined + * + * @def ODP_PROTO_L2_TYPE_ETH + * Layer 2 protocol is Ethernet + */ + /** * @typedef odp_proto_l3_type_t * Layer 3 protocol type @@ -1615,6 +1628,17 @@ uint32_t odp_packet_l4_offset(odp_packet_t pkt); */ int odp_packet_l4_offset_set(odp_packet_t pkt, uint32_t offset); +/** + * Layer 2 protocol type + * + * Returns layer 2 protocol type. Initial type value is ODP_PROTO_L3_TYPE_NONE. + * + * @param pkt Packet handle + * + * @return Layer 2 protocol type + */ +odp_proto_l2_type_t odp_packet_l2_type(odp_packet_t pkt); + /** * Layer 3 protocol type * From patchwork Wed Feb 14 08:00:09 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: 128314 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp341675ljc; Wed, 14 Feb 2018 00:01:36 -0800 (PST) X-Google-Smtp-Source: AH8x227TzZNCU0HU9bUGygCm/Zpmx3cjRF9YwdX/sVZKpTTAzbrEePYrC9Q14SkyLtlz3crxuX+A X-Received: by 10.237.58.67 with SMTP id n61mr6330891qte.31.1518595296482; Wed, 14 Feb 2018 00:01:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518595296; cv=none; d=google.com; s=arc-20160816; b=K8opMBsVALokUWBzNKJS3uLrphgbW+C7Ke84F4371+ItsCz5yQgZIAp3kRnH7GbrLC K0yWVAEQ/WPvDYcoFRhYRmZj8v7NY5UJuAfFzdS0bJOpjBWyUnNomLyMpcLsqUMmLiYz YY+GQhS2Jnjl63xB30RZl8QN+Meu0geJpD/rlRGbO1FeVHRQ+sWaWUWrh19mIVMHuYxE 4/4Xn/0D7kJEAw3k8SYlsatZpmc1x5/vDSauxfH80Cd397sw8wxpIt89P5cBiOjg98E7 4PDsMpy6OUPSlFn6tvWiQpOQqzMGJFG4yUAqeZ/GCrSjUkCRUzMAxPXTTOe1nIKyLUsJ RzkQ== 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=l87RnznZe9/Ag+fLrIC/5D1wkIL1VQYctJeU81UrbQY=; b=IXCUqihsHTY02GSx/haO69C76nkuMgFnLQ4KTfbcR5RSUzUAKm9rmrjoESLWtBVgAL 5n4Vq4ZO/p61gvPvQEJn9HPjcyRcfh/sMji+35GuEOPHScEUHQZfRlhmdz+utM05szRK wymJrVfKs/JW2Tnlm3yEoQiaYVA91G1adr/Q+KpWAleNFXru85iw+oFF/ql1Cjr6H12Y P4CnAEFEYgWQroBanJJKkOuKmn0JeH3AremUXhGR0cIM4iLSg/lyDcEau9U6devCPlgs zdmkGzvcfyrPzm6ZdsoXbaVJ0H+NTXp0JCyws9SiOsSOKCI8FW0fT5JbPDiIeY3pdZPg iLUQ== 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 l26si3997760qkj.196.2018.02.14.00.01.35; Wed, 14 Feb 2018 00:01:36 -0800 (PST) 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 2F58B6177D; Wed, 14 Feb 2018 08:01: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=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, 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 C5C5F61748; Wed, 14 Feb 2018 08: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 49BF5616F7; Wed, 14 Feb 2018 08:00:26 +0000 (UTC) Received: from forward102p.mail.yandex.net (forward102p.mail.yandex.net [77.88.28.102]) by lists.linaro.org (Postfix) with ESMTPS id DFBF561784 for ; Wed, 14 Feb 2018 08:00:14 +0000 (UTC) Received: from mxback2j.mail.yandex.net (mxback2j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10b]) by forward102p.mail.yandex.net (Yandex) with ESMTP id D58804304ACB for ; Wed, 14 Feb 2018 11:00:12 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback2j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id tDGE9LB6OI-0C8CY5IW; Wed, 14 Feb 2018 11:00:12 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id U4m2dG5MWg-0CWuCYFY; Wed, 14 Feb 2018 11:00:12 +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: Wed, 14 Feb 2018 11:00:09 +0300 Message-Id: <1518595209-773-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518595209-773-1-git-send-email-odpbot@yandex.ru> References: <1518595209-773-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 476 Subject: [lng-odp] [PATCH API-NEXT v2 2/2] linux-gen: add L2 type support for non-ABI-compat mode 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 476 (lumag:l2-type) ** https://github.com/Linaro/odp/pull/476 ** Patch: https://github.com/Linaro/odp/pull/476.patch ** Base sha: af7be638ef9ac98bdb1f2e4917f152889eb1850f ** Merge commit sha: 07d4eead898ce4cf6c7a574495f3622b7aa9d27d **/ platform/linux-generic/include-abi/odp/api/abi/packet.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platform/linux-generic/include-abi/odp/api/abi/packet.h b/platform/linux-generic/include-abi/odp/api/abi/packet.h index 137cd3ec4..53e579b2f 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/packet.h +++ b/platform/linux-generic/include-abi/odp/api/abi/packet.h @@ -47,6 +47,11 @@ static inline odp_packet_seg_t _odp_packet_seg_from_ndx(uint8_t ndx) #define ODP_PACKET_SEG_INVALID ((odp_packet_seg_t)-1) +typedef uint8_t odp_proto_l2_type_t; + +#define ODP_PROTO_L2_TYPE_NONE 0 +#define ODP_PROTO_L2_TYPE_ETH 0 + typedef uint8_t odp_proto_l3_type_t; #define ODP_PROTO_L3_TYPE_NONE 0