From patchwork Thu Jan 28 12:39:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 60717 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp448406lbb; Thu, 28 Jan 2016 04:41:24 -0800 (PST) X-Received: by 10.140.22.139 with SMTP id 11mr3229210qgn.34.1453984884245; Thu, 28 Jan 2016 04:41:24 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id y69si9198636qka.73.2016.01.28.04.41.23; Thu, 28 Jan 2016 04:41:24 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id CA3A5617F1; Thu, 28 Jan 2016 12:41:23 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=EdyaRR/W; dkim-adsp=none (unprotected policy); dkim-atps=neutral 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.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, URIBL_BLOCKED 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 654016195A; Thu, 28 Jan 2016 12:39:57 +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 2E97D617E5; Thu, 28 Jan 2016 12:39:44 +0000 (UTC) Received: from mail-ob0-f177.google.com (mail-ob0-f177.google.com [209.85.214.177]) by lists.linaro.org (Postfix) with ESMTPS id 0BECE6176E for ; Thu, 28 Jan 2016 12:39:43 +0000 (UTC) Received: by mail-ob0-f177.google.com with SMTP id ba1so34179117obb.3 for ; Thu, 28 Jan 2016 04:39:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mKoe/AlFi2jVz3F/JBwIV5LZaLkyz5h2Vemg9zfqXtY=; b=EdyaRR/WQw8X27Rt6mS32vC/MrsdUSD2cPYMJ2kS70Ji7gzlvvjTGB/EodvNPAllVi Tv5I0/HTyZpo1W4m6O2z53koO376kvlVAcuRka/lrttYmJGURCCZwIuY/dQJC3CEa3WB n5kJiGdUTllTHLgCnW4bc8oxw4VR/8eCtRs20= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=mKoe/AlFi2jVz3F/JBwIV5LZaLkyz5h2Vemg9zfqXtY=; b=GC4YDyswGXB+VdjsC4QxVEjGukInE7IZt0Zjh00SNTkrcl8x7HSJCQUN8PDGG+Y6fz vJz+zS5rrAgqM+cc9YuguZ22BWblb3CGVI98Kftqza0CdjiUBtMzITiB97DYBjM0NvZM KdfE2R0sr3+Oe6ICb1JWUaUGto81yHDrxe8zw/+MSbtcq6eZG/K/Y+EUSJ4dKFERTFra yrKKPMgrg3Zogx7zKQxlC1u+lJGXyP3CieZ6tCed9ZgMTX6pyX+3X+zOrdvbqOsl+xTG 5dJNM3nONL5rf/nfzp24jj17nP9RoPid/oq2+K0yHx+MctzjHXtZ3kwQ2tjlEI8iY2g4 G2bw== X-Gm-Message-State: AG10YOSUG3FAw7MHzm/KvuedLwUy6JJs8m8oGdC9b99u1c+63EYnCNGUR5JTl5TdQwUwe3ExDPE= X-Received: by 10.182.213.71 with SMTP id nq7mr1947480obc.65.1453984782613; Thu, 28 Jan 2016 04:39:42 -0800 (PST) Received: from Ubuntu15.localdomain (cpe-66-68-129-43.austin.res.rr.com. [66.68.129.43]) by smtp.gmail.com with ESMTPSA id 133sm5359632oid.5.2016.01.28.04.39.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Jan 2016 04:39:42 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Thu, 28 Jan 2016 06:39:32 -0600 Message-Id: <1453984776-29674-3-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1453984776-29674-1-git-send-email-bill.fischofer@linaro.org> References: <1453984776-29674-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv3 2/6] linux-generic: packet: implement broadcast and multicast metadata flags 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: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Signed-off-by: Bill Fischofer --- .../linux-generic/include/odp_packet_internal.h | 4 +++ platform/linux-generic/odp_packet_flags.c | 40 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index 1340f8a..55cc0a8 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -46,6 +46,8 @@ typedef union { uint32_t l4:1; /**< known L4 protocol present */ uint32_t eth:1; /**< Ethernet */ + uint32_t eth_bcast:1; /**< Ethernet broadcast */ + uint32_t eth_mcast:1; /**< Ethernet multicast */ uint32_t jumbo:1; /**< Jumbo frame */ uint32_t vlan:1; /**< VLAN hdr found */ uint32_t vlan_qinq:1; /**< Stacked VLAN found, QinQ */ @@ -55,6 +57,8 @@ typedef union { uint32_t ipv4:1; /**< IPv4 */ uint32_t ipv6:1; /**< IPv6 */ + uint32_t ip_bcast:1; /**< IP broadcast */ + uint32_t ip_mcast:1; /**< IP multicast */ uint32_t ipfrag:1; /**< IP fragment */ uint32_t ipopt:1; /**< IP optional headers */ uint32_t ipsec:1; /**< IPSec decryption may be needed */ diff --git a/platform/linux-generic/odp_packet_flags.c b/platform/linux-generic/odp_packet_flags.c index ae9a9ed..1a0a11c 100644 --- a/platform/linux-generic/odp_packet_flags.c +++ b/platform/linux-generic/odp_packet_flags.c @@ -85,6 +85,16 @@ int odp_packet_has_eth(odp_packet_t pkt) return pkt_hdr->input_flags.eth; } +int odp_packet_has_eth_bcast(odp_packet_t pkt) +{ + retflag(pkt, input_flags.eth_bcast); +} + +int odp_packet_has_eth_mcast(odp_packet_t pkt) +{ + retflag(pkt, input_flags.eth_mcast); +} + int odp_packet_has_jumbo(odp_packet_t pkt) { odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); @@ -117,6 +127,16 @@ int odp_packet_has_ipv6(odp_packet_t pkt) retflag(pkt, input_flags.ipv6); } +int odp_packet_has_ip_bcast(odp_packet_t pkt) +{ + retflag(pkt, input_flags.ip_bcast); +} + +int odp_packet_has_ip_mcast(odp_packet_t pkt) +{ + retflag(pkt, input_flags.ip_mcast); +} + int odp_packet_has_ipfrag(odp_packet_t pkt) { retflag(pkt, input_flags.ipfrag); @@ -226,6 +246,16 @@ void odp_packet_has_eth_set(odp_packet_t pkt, int val) setflag(pkt, input_flags.eth, val); } +void odp_packet_has_eth_bcast_set(odp_packet_t pkt, int val) +{ + setflag(pkt, input_flags.eth_bcast, val); +} + +void odp_packet_has_eth_mcast_set(odp_packet_t pkt, int val) +{ + setflag(pkt, input_flags.eth_mcast, val); +} + void odp_packet_has_jumbo_set(odp_packet_t pkt, int val) { setflag(pkt, input_flags.jumbo, val); @@ -256,6 +286,16 @@ void odp_packet_has_ipv6_set(odp_packet_t pkt, int val) setflag(pkt, input_flags.ipv6, val); } +void odp_packet_has_ip_bcast_set(odp_packet_t pkt, int val) +{ + setflag(pkt, input_flags.ip_bcast, val); +} + +void odp_packet_has_ip_mcast_set(odp_packet_t pkt, int val) +{ + setflag(pkt, input_flags.ip_mcast, val); +} + void odp_packet_has_ipfrag_set(odp_packet_t pkt, int val) { setflag(pkt, input_flags.ipfrag, val);