From patchwork Wed Jun 1 12:33:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Elo, Matias \(Nokia - FI/Espoo\)" X-Patchwork-Id: 69024 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp68156qge; Wed, 1 Jun 2016 05:34:27 -0700 (PDT) X-Received: by 10.107.180.11 with SMTP id d11mr5018766iof.151.1464784466936; Wed, 01 Jun 2016 05:34:26 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id c136si51627639ioc.50.2016.06.01.05.34.26; Wed, 01 Jun 2016 05:34:26 -0700 (PDT) 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; dmarc=fail (p=NONE dis=NONE) header.from=nokia.com Received: by lists.linaro.org (Postfix, from userid 109) id 796E161717; Wed, 1 Jun 2016 12:34:26 +0000 (UTC) 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=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 65FF661721; Wed, 1 Jun 2016 12:33:54 +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 C901761712; Wed, 1 Jun 2016 12:33:48 +0000 (UTC) Received: from demumfd001.nsn-inter.net (demumfd001.nsn-inter.net [93.183.12.32]) by lists.linaro.org (Postfix) with ESMTPS id 7059261712 for ; Wed, 1 Jun 2016 12:33:46 +0000 (UTC) Received: from demuprx017.emea.nsn-intra.net ([10.150.129.56]) by demumfd001.nsn-inter.net (8.15.2/8.15.2) with ESMTPS id u51CXihh017102 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 1 Jun 2016 12:33:45 GMT Received: from 10.144.19.15 ([10.144.104.109]) by demuprx017.emea.nsn-intra.net (8.12.11.20060308/8.12.11) with ESMTP id u51CXhZ5028555 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Wed, 1 Jun 2016 14:33:44 +0200 From: Matias Elo To: lng-odp@lists.linaro.org Date: Wed, 1 Jun 2016 15:33:41 +0300 Message-Id: <1464784423-7713-2-git-send-email-matias.elo@nokia.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1464784423-7713-1-git-send-email-matias.elo@nokia.com> References: <1464784423-7713-1-git-send-email-matias.elo@nokia.com> X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-size: 4767 X-purgate-ID: 151667::1464784425-00004C87-ADECAEE0/0/0 X-Topics: patch Subject: [lng-odp] [PATCH 2/4] linux-gen: packet: increase input flags bit field size to 64 bits 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" Make room for more input flags. Signed-off-by: Matias Elo --- .../linux-generic/include/odp_packet_internal.h | 66 +++++++++++----------- platform/linux-generic/odp_packet.c | 2 +- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index c87bc9f..67ee34d 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -34,53 +34,53 @@ extern "C" { */ typedef union { /* All input flags */ - uint32_t all; + uint64_t all; struct { - uint32_t parsed_l2:1; /**< L2 parsed */ - uint32_t parsed_all:1;/**< Parsing complete */ + uint64_t parsed_l2:1; /**< L2 parsed */ + uint64_t parsed_all:1;/**< Parsing complete */ - uint32_t flow_hash:1; /**< Flow hash present */ - uint32_t timestamp:1; /**< Timestamp present */ + uint64_t flow_hash:1; /**< Flow hash present */ + uint64_t timestamp:1; /**< Timestamp present */ - uint32_t l2:1; /**< known L2 protocol present */ - uint32_t l3:1; /**< known L3 protocol present */ - uint32_t l4:1; /**< known L4 protocol present */ + uint64_t l2:1; /**< known L2 protocol present */ + uint64_t l3:1; /**< known L3 protocol present */ + uint64_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 */ + uint64_t eth:1; /**< Ethernet */ + uint64_t eth_bcast:1; /**< Ethernet broadcast */ + uint64_t eth_mcast:1; /**< Ethernet multicast */ + uint64_t jumbo:1; /**< Jumbo frame */ + uint64_t vlan:1; /**< VLAN hdr found */ + uint64_t vlan_qinq:1; /**< Stacked VLAN found, QinQ */ - uint32_t snap:1; /**< SNAP */ - uint32_t arp:1; /**< ARP */ + uint64_t snap:1; /**< SNAP */ + uint64_t arp:1; /**< ARP */ - 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 */ + uint64_t ipv4:1; /**< IPv4 */ + uint64_t ipv6:1; /**< IPv6 */ + uint64_t ip_bcast:1; /**< IP broadcast */ + uint64_t ip_mcast:1; /**< IP multicast */ + uint64_t ipfrag:1; /**< IP fragment */ + uint64_t ipopt:1; /**< IP optional headers */ - uint32_t ipsec:1; /**< IPSec packet. Required by the + uint64_t ipsec:1; /**< IPSec packet. Required by the odp_packet_has_ipsec_set() func. */ - uint32_t ipsec_ah:1; /**< IPSec authentication header */ - uint32_t ipsec_esp:1; /**< IPSec encapsulating security + uint64_t ipsec_ah:1; /**< IPSec authentication header */ + uint64_t ipsec_esp:1; /**< IPSec encapsulating security payload */ - uint32_t udp:1; /**< UDP */ - uint32_t tcp:1; /**< TCP */ - uint32_t tcpopt:1; /**< TCP options present */ - uint32_t sctp:1; /**< SCTP */ - uint32_t icmp:1; /**< ICMP */ + uint64_t udp:1; /**< UDP */ + uint64_t tcp:1; /**< TCP */ + uint64_t tcpopt:1; /**< TCP options present */ + uint64_t sctp:1; /**< SCTP */ + uint64_t icmp:1; /**< ICMP */ - uint32_t color:2; /**< Packet color for traffic mgmt */ - uint32_t nodrop:1; /**< Drop eligibility status */ + uint64_t color:2; /**< Packet color for traffic mgmt */ + uint64_t nodrop:1; /**< Drop eligibility status */ }; } input_flags_t; -ODP_STATIC_ASSERT(sizeof(input_flags_t) == sizeof(uint32_t), +ODP_STATIC_ASSERT(sizeof(input_flags_t) == sizeof(uint64_t), "INPUT_FLAGS_SIZE_ERROR"); /** diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index d590901..5b11af6 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -930,7 +930,7 @@ void odp_packet_print(odp_packet_t pkt) len += snprintf(&str[len], n - len, "Packet "); len += odp_buffer_snprint(&str[len], n - len, (odp_buffer_t)pkt); len += snprintf(&str[len], n - len, - " input_flags 0x%" PRIx32 "\n", hdr->input_flags.all); + " input_flags 0x%" PRIx64 "\n", hdr->input_flags.all); len += snprintf(&str[len], n - len, " error_flags 0x%" PRIx32 "\n", hdr->error_flags.all); len += snprintf(&str[len], n - len,