From patchwork Wed Jan 27 01:18:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 60552 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2303708lbb; Tue, 26 Jan 2016 17:19:29 -0800 (PST) X-Received: by 10.141.0.4 with SMTP id b4mr33460457qhd.23.1453857569309; Tue, 26 Jan 2016 17:19:29 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id u19si1738394qka.36.2016.01.26.17.19.29; Tue, 26 Jan 2016 17:19:29 -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 D6801617E1; Wed, 27 Jan 2016 01:19:28 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=QGX9XHf4; 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 70294617EA; Wed, 27 Jan 2016 01:18:45 +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 C638A617DB; Wed, 27 Jan 2016 01:18:25 +0000 (UTC) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by lists.linaro.org (Postfix) with ESMTPS id C5752617D3 for ; Wed, 27 Jan 2016 01:18:23 +0000 (UTC) Received: by mail-ob0-f182.google.com with SMTP id zv1so55177212obb.2 for ; Tue, 26 Jan 2016 17:18:23 -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=QGX9XHf4skGnWygeRIxvHeMrj0Q8LW8M7loq3jDNGEl7shUW8tuNVQqSBAUdPTiLS3 Hx38cgYOFT6ixZwnMqEOdrxCM1eFhCSX9Lk4bOsL7SPf1oUEmfFX+OOy0AgvaJwWMLqk 1qB8JYDkMgLnVgSPCMDbTYcaUIRhJ9/zxU4b8= 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=CpFz3PSFZrZyLJLqN3WMB+3R7EdRCELO0e3RYrFIM/L5G/CAw6mHIa/a5YplZcZ037 M4uTXXLZhsOBSuZ42oouRYMbQkYceYGwSYZy2x8nG3kMO/23mhVkyecyGfL5pa0uELAy N6x2a1SiUVHHzrI1BLxMmWLCFJydp9g1PbGK9iAdUiQ06qIxU1+krIHcRsTxKSuKbCfM kJ7MzgInp2IHMnsTfCNby7hbX1f4ok5w8StUYcRe69/33LP1eZT0ruA8wshD768fSxz2 jeObYWzt2I41FZ0tIr1R8hRfeWkKjggY2kYa/DQ2hLht6OTPYQUSkbsPQ7so3P4JZr7i K3eQ== X-Gm-Message-State: AG10YOS2GlqpCPc60/wqkCPauoqGMtRRMVyk28pu+KvZSp6X2JXsPbqoyqMcyA0b3w1xRNWQ1qw= X-Received: by 10.60.39.136 with SMTP id p8mr20789894oek.81.1453857503312; Tue, 26 Jan 2016 17:18:23 -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 e4sm1886973oic.1.2016.01.26.17.18.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Jan 2016 17:18:22 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Tue, 26 Jan 2016 19:18:12 -0600 Message-Id: <1453857496-12895-2-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1453857496-12895-1-git-send-email-bill.fischofer@linaro.org> References: <1453857496-12895-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH 1/5] 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);