From patchwork Mon Feb 26 14: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: 129657 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp293190lja; Mon, 26 Feb 2018 07:00:34 -0800 (PST) X-Google-Smtp-Source: AG47ELt1Hq9ghPLVlB+HF2lAAO4uVtL1g9pZcAvI12/V9+toTPQ5kHf1/2kd3e20fnBKl0dGkTAR X-Received: by 10.237.47.1 with SMTP id l1mr12768865qtd.52.1519657233671; Mon, 26 Feb 2018 07:00:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519657233; cv=none; d=google.com; s=arc-20160816; b=VA1omzoJoCrzJ8zItFlufMrrP2aJ0hN16jH8NWtmeQCym7v9RdRiv5VxHprRscU7yj j0c4gxIe6mWgQQEMZpi5C6cjPhUWgyFEHEEgdsu+H5XJfmfm/imgC2/96cMsJXoyEKgA xuKUnzi069fesTDOhCFzY8koegXWIyqtp+68alpLBs8ar5wAadsTNBBa2coty/py4p/Z gVrVqHirGex6+gSekEQO2mVC02RfeqBF19UJ/sEfzrsLHy7fmcpXmVhILv1m/uyr5eZf r6sQ8AtDeOFZk8G9LbMEIHNowWLDS7drWZJG+G0oO14GOgsT+DMnWGpRd+8Yg8mSoCNF eAdg== 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=eihHIehlHbdUzUHJTEyWVY7GIcy7rYBTzWnaSIxoQ2I=; b=Z/lzTVm6QCKgzFdcRs4g36ww/ylzcZRW7+7sbFhDuixrumGv6EXb0EDJiKZnBeXMwe hN/lw5Lhb7jVCMj/5lwyVbHRzl/dozVgCElR0NAUclCwrKCm67BzesswX8Y+B7AHBS+R Cp25anuR3gbwGQyuogFfoItSOHdyTDK1pQJel7RjjXaccPPKZYqfgqPdOtFH5gfEwYIM woQBfRYe9ZX8InUJlzYmtbGMfYCqPCCj73Xv6DFrbNinQpJqjEl9IXnDUnO7QSGJEKYv 2qyXsCVHhvMhMPVsWOoGQnyCGPNYUvDZk511Y9tABY0VRXKXSUnwPFTpA37PB0EZwxwy zQjQ== 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 f64si7618274qkh.166.2018.02.26.07.00.32; Mon, 26 Feb 2018 07:00:33 -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 E642960750; Mon, 26 Feb 2018 15:00:31 +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 A7240617A2; Mon, 26 Feb 2018 15:00:18 +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 403E16179E; Mon, 26 Feb 2018 15:00:15 +0000 (UTC) Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [5.45.198.246]) by lists.linaro.org (Postfix) with ESMTPS id ACBB760CCF for ; Mon, 26 Feb 2018 15:00:13 +0000 (UTC) Received: from mxback8j.mail.yandex.net (mxback8j.mail.yandex.net [IPv6:2a02:6b8:0:1619::111]) by forward103j.mail.yandex.net (Yandex) with ESMTP id 15DF034C2C36 for ; Mon, 26 Feb 2018 18:00:12 +0300 (MSK) Received: from smtp1o.mail.yandex.net (smtp1o.mail.yandex.net [2a02:6b8:0:1a2d::25]) by mxback8j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id n9V9TZLyYB-0C30TXBx; Mon, 26 Feb 2018 18:00:12 +0300 Received: by smtp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id kHvqsGsU0k-0BTu8ibf; Mon, 26 Feb 2018 18: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: Mon, 26 Feb 2018 17:59:59 +0300 Message-Id: <1519657209-30140-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519657209-30140-1-git-send-email-odpbot@yandex.ru> References: <1519657209-30140-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 502 Subject: [lng-odp] [PATCH API-NEXT v1 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: c91eae61d19350dd19aacf18c1148c9491398c14 ** Merge commit sha: 8c909084626ccef140542645cd34549ce7f4bcde **/ 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 46b11cba1..6fc5f2206 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -2506,6 +2506,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);