From patchwork Tue Feb 27 19:59:59 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: 129856 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp217565lja; Tue, 27 Feb 2018 12:09:23 -0800 (PST) X-Google-Smtp-Source: AG47ELtlYiws0QPBhKbigBmJYLNcq16OnCZpiq9HpAnssBFE6otsEg1XYh4q1hOJmTzsGIhpXW/k X-Received: by 10.200.67.7 with SMTP id z7mr8804135qtm.18.1519762163598; Tue, 27 Feb 2018 12:09:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519762163; cv=none; d=google.com; s=arc-20160816; b=WWaTpl7Ujl36GCTP/s52gqzAl9OwBeHwosuFEZEu7Wa08fY3M3kpIpigtWRnu3nwP6 7RbmosN+5wnrmH6kuFyA/4piZNh9IZmyrdXbXDToxfhkDt5xMjZDkvojzj9W4PECVmiJ ebDBGJ6I8SHgRnPupeAqxRH8gDBZAHyIDKiKNL2s13qJ60RZZLuo96rXCVTiedW4EHib +3bKntduApOSGNJ5VfhRwtZdTaEsZCJkdWJHCb/qOjLmLwW38Dz4pQ+VyL9uTjeMoTH1 wwc4O0iw/1obu8dXj0wcAX8+7Uvxc5H+9YdqVBhKszS9h6BFBmO0uO7gy8mslgIAp9DX MRqQ== 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=BJVMsGw0iVfn0HaxGBh8B3Z0H4f7TvMUb+dKVK7+FvI=; b=cm0glcWpP0hNBRl6Nt2Uww12Ojz5u2lybJrHu4wWZ8pRhPodQ6wfobw9sFGLuNvqoQ 8W/3O7JoZMzjImfaiWAHkhxqgNO4e1OHL8Wj/0fJKj9vSoZwqSZ/9TCD4eKsCMpUEvBD YtK7Ez86QvlFBpcjaCbYU1IUgxPbCo7+tzH7HcUMVntdX2S/T5IrvlOLdJNh3QA2TozC 3Mz8FvwO2KB3rfHNr9zPTtSWZ03GX1w+Sbkz8gkyibb9JLpZ2wmQvMtjKPghBH07/w5+ Tez8ix2rLf/SqSe33s3T3huIL6D8QaeogPQa88S5gBJrWax09mlRNq27fQP2UVLxWBti 8z4g== 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 o3si1509291qtd.213.2018.02.27.12.09.23; Tue, 27 Feb 2018 12:09:23 -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 47D0161762; Tue, 27 Feb 2018 20:09:23 +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 64F4861794; Tue, 27 Feb 2018 20:01:47 +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 AE1606178E; Tue, 27 Feb 2018 20:01:39 +0000 (UTC) Received: from forward103o.mail.yandex.net (forward103o.mail.yandex.net [37.140.190.177]) by lists.linaro.org (Postfix) with ESMTPS id 3052D6174D for ; Tue, 27 Feb 2018 20:00:24 +0000 (UTC) Received: from mxback13g.mail.yandex.net (mxback13g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:92]) by forward103o.mail.yandex.net (Yandex) with ESMTP id DD34E58815F8 for ; Tue, 27 Feb 2018 23:00:11 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback13g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id kfiLYfm4Qi-0BWa0omb; Tue, 27 Feb 2018 23:00:11 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Upcczghx1N-0AQiC5G2; Tue, 27 Feb 2018 23: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: Tue, 27 Feb 2018 22:59:59 +0300 Message-Id: <1519761609-20848-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519761609-20848-1-git-send-email-odpbot@yandex.ru> References: <1519761609-20848-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 502 Subject: [lng-odp] [PATCH API-NEXT v3 1/11] linux-gen: packet: add odp_packet_l2_type() 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 502 (lumag:ipsec-imp-upd) ** https://github.com/Linaro/odp/pull/502 ** Patch: https://github.com/Linaro/odp/pull/502.patch ** Base sha: ce5c4f9e7ce9fe504451c29429b9ae9fb68083ae ** Merge commit sha: fcd6960c97fe9a0a399be4f3418ba3dd83134544 **/ platform/linux-generic/odp_packet.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 666a4617c..2459a3aa8 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -2485,6 +2485,16 @@ int odp_packet_has_ref(odp_packet_t pkt) return 0; } +odp_proto_l2_type_t odp_packet_l2_type(odp_packet_t pkt) +{ + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); + + if (pkt_hdr->p.input_flags.eth) + return ODP_PROTO_L2_TYPE_ETH; + + return ODP_PROTO_L2_TYPE_NONE; +} + odp_proto_l3_type_t odp_packet_l3_type(odp_packet_t pkt) { odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt);