From patchwork Tue Feb 9 15:00:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 61538 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp2093829lbl; Tue, 9 Feb 2016 07:01:50 -0800 (PST) X-Received: by 10.140.99.53 with SMTP id p50mr41252607qge.97.1455030110676; Tue, 09 Feb 2016 07:01:50 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id e7si36092009qga.19.2016.02.09.07.01.49; Tue, 09 Feb 2016 07:01:50 -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 747326179C; Tue, 9 Feb 2016 15:01:49 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=STyPyjKm; 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 B359E617A4; Tue, 9 Feb 2016 15:00:46 +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 382C561797; Tue, 9 Feb 2016 15:00:41 +0000 (UTC) Received: from mail-oi0-f49.google.com (mail-oi0-f49.google.com [209.85.218.49]) by lists.linaro.org (Postfix) with ESMTPS id 2AE3161745 for ; Tue, 9 Feb 2016 15:00:39 +0000 (UTC) Received: by mail-oi0-f49.google.com with SMTP id j125so16444539oih.1 for ; Tue, 09 Feb 2016 07:00:39 -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=UpAE7lA0mjeIxaot0iBsYAQfSLz4nOJQuVqcXy1bAqQ=; b=STyPyjKmBInvgItPhADvyGFr4gZFevvIvDjeYhk7K7JV+XJ9R+2rSlNARlPSzRJ3HB 3sV1D+EzaiDDiOqkocdiTifxiYbPf4nvdCVEMHzWKAfpO6ITfGIlpIHfPbGdJbRKc7NF xIMzNDMl+2es8maM3fYHo5p4JZLf3Ml7M1wnA= 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=UpAE7lA0mjeIxaot0iBsYAQfSLz4nOJQuVqcXy1bAqQ=; b=Zh+p/MIrOxp8yX+EOSjCzxzS02shy6FjJcdBOr9QTrybySHuhjMEk6/l2Ghoo3eGY4 GUqESwp0dVooTe+6M1BgWdsv3mF+VoC3n3O7SYs49HiwXNjX4SliScoPZ+Ky3dzd7a8o Op4vJMEt+R6Aramvf1NN73jVWyshkR1TtRsxky/IfXHliNgTxT3801Jq47fnHeEgOPRH Yz9max9TqGx/TNCpF9i69PYvbJ1fgqFGI64namkeuEGybdZF877ZYSBMFF8bg2FV8sfb 27Bvwvar5GfddAScHvcuGJIKxYtm37nLXTLCnOpqTnFQ8rC6U0uuGBesc0CuELXlDBQZ hCYA== X-Gm-Message-State: AG10YOR/4kWU0qh6UKPhl2BXWJ2lWiYEp4yIM4MdXV7fqoYOmCed2RBhz9d2ta3k+HMKo6POa+Y= X-Received: by 10.202.107.135 with SMTP id g129mr3790062oic.79.1455030038723; Tue, 09 Feb 2016 07:00:38 -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 k1sm20168269obz.22.2016.02.09.07.00.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Feb 2016 07:00:38 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Tue, 9 Feb 2016 09:00:27 -0600 Message-Id: <1455030031-4495-3-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455030031-4495-1-git-send-email-bill.fischofer@linaro.org> References: <1455030031-4495-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv6 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 Reviewed-by: Petri Savolainen --- .../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);