From patchwork Thu Mar 1 16: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: 130342 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp3044840edc; Thu, 1 Mar 2018 09:02:32 -0800 (PST) X-Google-Smtp-Source: AG47ELsQVzXhn9danLY52vwXzscG8HgC4FI8SLYFSfVx7O/ct4IgZg2eugNHg+Z9NDB/8XhAoe0C X-Received: by 10.13.225.18 with SMTP id k18mr1687202ywe.512.1519923752813; Thu, 01 Mar 2018 09:02:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519923752; cv=none; d=google.com; s=arc-20160816; b=bmgsffroLj1uuMo8XEzcIQIbcxAFAdTGKzE325AkWtfEEm0Nai8q69v/1RX7Yphbtp B5OzthbUumsodieXKQHx+tubg+PZFOcAtwPl2Xm5YyEQ9/E3YrVnHIH64M05hRX5nAIw quQ8ueFHFWhb7y9IeLoV7Cvjfb76UH4Sk5sIe4IGHDygYvFXT3CRpYd3lix8NPisCkQN pvBcRbf8uIkYnxCVa7tbFb7XseqS9YwKjNzCtazO7HWf9LRFO7IN7uoN6OA+ipoNst6K /PwzLf/wQICSWYeg4hmZLeuW+crsT/+WGs1XyCl7yh/6Yha8ih2/2fqkyzj++jLowEFd X4rg== 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=wod73VZpQTvf/fUPenQH20R2/DN61UefMwMR5D/haxM=; b=N0AU+Qt2O1i0jWSucX8T5pGva8ge6mutUfGVrI8q/pBQi9JUDTiqlkhhio6GUKU0Cu p9xCADgf+OMCoLSPP1uLMuc57PdzwZZuXVKxfNqJ5JCODH1mFK+sWFA8EqAGaA/0Ivem 54kbrYyNMlSzxqFZpNvDkGOdx37POiNmTQrcqqdIUUcmH7UavzOS3bK5Rq5tNTEePnPf DpxACjIvhF8+yN9zqj4FER0ffPSLU+N5mRQMe4NlyorNB/Z3024nb9L2uYIxTqwJdnQ6 Nxkl5guJ7t9CXrW51V3I2bZB3fYbep8iu3ZRw1WelKEfpMzZ6QBaARbcOQtaM8uCXK6X vJmQ== 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 c125-v6si726609yba.285.2018.03.01.09.02.32; Thu, 01 Mar 2018 09:02:32 -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 73F2760852; Thu, 1 Mar 2018 17:02:32 +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 8779B616DA; Thu, 1 Mar 2018 17:00:50 +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 47F6F61790; Thu, 1 Mar 2018 17:00:22 +0000 (UTC) Received: from forward105o.mail.yandex.net (forward105o.mail.yandex.net [37.140.190.183]) by lists.linaro.org (Postfix) with ESMTPS id B619E6176D for ; Thu, 1 Mar 2018 17:00:15 +0000 (UTC) Received: from mxback5o.mail.yandex.net (mxback5o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1f]) by forward105o.mail.yandex.net (Yandex) with ESMTP id AB5C34444E93 for ; Thu, 1 Mar 2018 20:00:14 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback5o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id xcEL3KjvPX-0EverSIl; Thu, 01 Mar 2018 20:00:14 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 7MkXJ9JJAA-0DCCqRcR; Thu, 01 Mar 2018 20:00:13 +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, 1 Mar 2018 19:59:59 +0300 Message-Id: <1519923609-31634-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519923609-31634-1-git-send-email-odpbot@yandex.ru> References: <1519923609-31634-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 505 Subject: [lng-odp] [PATCH v1 3/13] 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 Reviewed-by: Bill Fischofer Signed-off-by: Maxim Uvarov --- /** Email created from pull request 505 (muvarov:devel/master_merge_api-next) ** https://github.com/Linaro/odp/pull/505 ** Patch: https://github.com/Linaro/odp/pull/505.patch ** Base sha: 284f52d72ec19df3774c7409780f1f9eea33b8e6 ** Merge commit sha: e8f50fefcd57a92e0971dc1172c5402c56b8370a **/ 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 8a5833ded..35b9b59dc 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -2486,6 +2486,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);