From patchwork Thu Jan 28 12:47:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 60728 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp466130lbb; Thu, 28 Jan 2016 05:14:43 -0800 (PST) X-Received: by 10.107.11.162 with SMTP id 34mr3657033iol.165.1453986883634; Thu, 28 Jan 2016 05:14:43 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id h2si4671783iga.33.2016.01.28.05.14.42; Thu, 28 Jan 2016 05:14:43 -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 ABFDB6181D; Thu, 28 Jan 2016 13:14:42 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=dA5YzSzH; 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 B7F2661930; Thu, 28 Jan 2016 13:00:29 +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 096FE61740; Thu, 28 Jan 2016 12:57:53 +0000 (UTC) Received: from mail-ob0-f169.google.com (mail-ob0-f169.google.com [209.85.214.169]) by lists.linaro.org (Postfix) with ESMTPS id CDE23618F0 for ; Thu, 28 Jan 2016 12:47:52 +0000 (UTC) Received: by mail-ob0-f169.google.com with SMTP id wb13so1276645obb.1 for ; Thu, 28 Jan 2016 04:47:52 -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=dA5YzSzHIo4xAboHlxuM676rFcFcGA0Fg4Gv3a5KYq3M2mywwq9mdtuJScQFayhlQx 56aJBMtSBvTsABymbyKwHOexBgkSWqEaXyDsoNCDLRJU4Roazk8gGctZKEmxNysb/2// lqxnGBDNSXjp43uFbpHvmgjO5eCtv/fT6sfPc= 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=cOruh1Zfq0AWUyRjrZ7SmBMKC9HKa8EC9YZpDk7rGXYNBr2cxxUZGfqXOSvkXrZqZn dawf/qKGwsRxIl4Bum1dtujLDqBk8vdqWtIy0QhUg1fWyPAZWPAOrtj2r/WVBJNgdihP Zyw18RygnYCkdH7KubR823ehm+mFP2DGK+1GTbVAKEfay24fBRW8TCkmK8cfGcemtJti hdfGXpRVcK2Ykeqpi+Q21CxsL07rzvA3dfpM/PXS7+cMUvKPI+4k7VZizBsHxzzmXAxC JsQs+yfAuZBjce8HB/+5M4o+JttP10a4MtQ+nm3aoqdE9Abk5cpaiQzIBw0YnYPdN4ed IKBA== X-Gm-Message-State: AG10YOTPAMDgukxqUQzcfKj+U9rxRViehjjmoGFUGTXpDysXzdkWjPb8Vh9PJSafr1vrjDYpWn8= X-Received: by 10.60.65.74 with SMTP id v10mr1960688oes.58.1453985272372; Thu, 28 Jan 2016 04:47:52 -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 u18sm5343302oie.9.2016.01.28.04.47.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Jan 2016 04:47:51 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Thu, 28 Jan 2016 06:47:40 -0600 Message-Id: <1453985264-3807-3-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1453985264-3807-1-git-send-email-bill.fischofer@linaro.org> References: <1453985264-3807-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv4 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);