From patchwork Thu Jan 28 15:05:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 60739 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp533391lbb; Thu, 28 Jan 2016 07:08:00 -0800 (PST) X-Received: by 10.55.71.143 with SMTP id u137mr4150836qka.1.1453993680798; Thu, 28 Jan 2016 07:08:00 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id b7si12537538qgb.59.2016.01.28.07.08.00; Thu, 28 Jan 2016 07:08:00 -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 3C73261811; Thu, 28 Jan 2016 15:08:00 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=Ot/XDT9s; 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 A48C8618E3; Thu, 28 Jan 2016 15:05:42 +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 A9588618C6; Thu, 28 Jan 2016 15:05:21 +0000 (UTC) Received: from mail-ob0-f174.google.com (mail-ob0-f174.google.com [209.85.214.174]) by lists.linaro.org (Postfix) with ESMTPS id 1A69F6156A for ; Thu, 28 Jan 2016 15:05:13 +0000 (UTC) Received: by mail-ob0-f174.google.com with SMTP id ny8so15872383obc.2 for ; Thu, 28 Jan 2016 07:05:13 -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=Ot/XDT9srwyvzajkKqqibzGGdtjKVRbUWf8bhqy25F2/2SJi39ghVBdzAw5dm4jeun dtNnFlg2jQxhwvEw5qEQsopODBw97lmTRCcmq0DNh9NTjg2NkcnwPe9gQdbx8wolrPOe k776ivYRZMEr6G5KrpZyDxVLGwN8DJivwFOFc= 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=BEN09K/WWx0VaxqMU9Yq5WiOojBEaCVuK1J8TSwnBDZXzVUPu/DIAYwWEP+jcdqm0Q DGg8ldg3AeOLyZGx5lsTdejAXuDquKZSggaVdIBstQg9U0qYI/6UA+gy3dLdHReh8m0c jKJxJM9UIRo4g57/FuEUIg+nqZbHehlYUgXhpMKDq9HD+7lbbUVscUZGK3OyQutseH+z bQJNTByOw2cHF9A18l3bS1/B/0+hKXnV3i1BfrdiZnXTZxwupIxInoYjLYoCiR4wUsRC K7FRW0z0Zl5VXW+ZnpPF7apu55yarw0mBtiYfLrEthfZkTvoBDbBm5LZ73PCoLSw56JK aNjw== X-Gm-Message-State: AG10YOTS/Moajd2sWqFnUfre3jDBZKqSHMOGzcffZ7c+cvn16d26/Qfz3G0ATxeJnIVVBghXwtw= X-Received: by 10.60.148.131 with SMTP id ts3mr2540339oeb.63.1453993512657; Thu, 28 Jan 2016 07:05:12 -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 k186sm5632766oif.13.2016.01.28.07.05.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Jan 2016 07:05:12 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Thu, 28 Jan 2016 09:05:01 -0600 Message-Id: <1453993505-32024-3-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1453993505-32024-1-git-send-email-bill.fischofer@linaro.org> References: <1453993505-32024-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv5 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);