From patchwork Wed Feb 21 17:59:58 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: 129119 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp896797ljc; Wed, 21 Feb 2018 10:03:06 -0800 (PST) X-Google-Smtp-Source: AG47ELtynFuBgWqy6SeldBnHZBUvSFXZjTVUCGh3lkmGu+Z6J+nDbJk+85fXYT3LW1XWaFvNs8b7 X-Received: by 10.55.42.229 with SMTP id q98mr6140992qkq.150.1519236185862; Wed, 21 Feb 2018 10:03:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519236185; cv=none; d=google.com; s=arc-20160816; b=uat7U+fhIr0RnrQUA93uAwZMzgUwbaAUV/YoH0TVkopJBqrlrJRA+J4XRT3ncx6owO xhplKU09ADE3vNu8kz1aItoIpPxNus9NYNOmvie31yX/p/ZSMNB7Tu1Kkirw+ezbcP/c h/uQ9zbCi5TZ1t5iL+G3I+IFBsZsgMuiZKewlewo8YditTptGfkctMdCuEKfdrD/q5N5 UtljQn7QSbEDZaqOrfD1OnDC3AOdrpVBixFVeBbwAroCNYPlE6Xyg8U2c86PVyBekIwT WmB49YVSqEMEEaXFv002xQ11rp9eccIqep4TLa+Lnyi5/xY0eLCAAa1k6y9AiAWT+fIl 3qog== 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=LyISxuistg8Z7b1Jl9QYBkrviEVM+QK7a6ILSf9hHCM=; b=xCnbh0JZmR6ks4Mb8UHhT46RCNDxRwI6yyNkzRHAm8m4ddE5dsgbZdJWuMoNDQvO27 on6Djt8wvH2FQR2ltaw2HG897aYCiIMUjjb8+HJPuT3IbROraqMWhEDceIvtewVCyKNC irYyCfCdjuPqmctTXboHMPjjGEU8k+bG4uWRJ5zNSgS3Qh9R2JMsvOB0uigeUR95h2TB MOXPG7hbUkkklpOj9umE3cyYlKvxRMmpMMlHAltoXdwFeP81hxyljzpGMnUrEtJq14vJ kYK9UsQAuiXSAlb/rNy39cta3MA0iI1MTr0ivT8d2wG5Q9EwX0BGg4x+p6iF3XhEEifi I6oA== 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 h126si889507qkf.282.2018.02.21.10.03.02; Wed, 21 Feb 2018 10:03:05 -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 A0860617E3; Wed, 21 Feb 2018 18:03:02 +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_H3, RCVD_IN_MSPIKE_WL 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 0CEF761769; Wed, 21 Feb 2018 18:01:40 +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 3F83861764; Wed, 21 Feb 2018 18:01:34 +0000 (UTC) Received: from forward102j.mail.yandex.net (forward102j.mail.yandex.net [5.45.198.243]) by lists.linaro.org (Postfix) with ESMTPS id 5C79C61709 for ; Wed, 21 Feb 2018 18:01:07 +0000 (UTC) Received: from mxback6j.mail.yandex.net (mxback6j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10f]) by forward102j.mail.yandex.net (Yandex) with ESMTP id EAD145602839 for ; Wed, 21 Feb 2018 21:01:05 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback6j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id SdGGZZGiee-15LCiAev; Wed, 21 Feb 2018 21:01:05 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id pTqHAnOINC-0g941Tku; Wed, 21 Feb 2018 21:00:42 +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, 21 Feb 2018 20:59:58 +0300 Message-Id: <1519236011-14987-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519236011-14987-1-git-send-email-odpbot@yandex.ru> References: <1519236011-14987-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 494 Subject: [lng-odp] [PATCH API-NEXT v2 2/15] 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 494 (lumag:ipsec-tfc-imp) ** https://github.com/Linaro/odp/pull/494 ** Patch: https://github.com/Linaro/odp/pull/494.patch ** Base sha: ea2afab619ae74108a03798bc358fdfcd29fdd88 ** Merge commit sha: 0b6ae2680a00027c3958ebcafbbcf92642a68f5e **/ 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);