From patchwork Thu Jun 2 07:45:48 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: 69131 Delivered-To: patch@linaro.org Received: by 10.140.23.41 with SMTP id 38csp193563qgo; Thu, 2 Jun 2016 00:46:31 -0700 (PDT) X-Received: by 10.107.173.66 with SMTP id w63mr1978149ioe.110.1464853591310; Thu, 02 Jun 2016 00:46:31 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id p82si43344909itd.89.2016.06.02.00.46.30; Thu, 02 Jun 2016 00:46:31 -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 C9D2361714; Thu, 2 Jun 2016 07:46:30 +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 4B69361734; Thu, 2 Jun 2016 07:46:01 +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 DF6E66173A; Thu, 2 Jun 2016 07:45:54 +0000 (UTC) Received: from demumfd002.nsn-inter.net (demumfd002.nsn-inter.net [93.183.12.31]) by lists.linaro.org (Postfix) with ESMTPS id 83FF961703 for ; Thu, 2 Jun 2016 07:45:53 +0000 (UTC) Received: from demuprx016.emea.nsn-intra.net ([10.150.129.55]) by demumfd002.nsn-inter.net (8.15.2/8.15.2) with ESMTPS id u527jq9w016678 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 2 Jun 2016 07:45:52 GMT Received: from 10.144.19.15 ([10.144.104.109]) by demuprx016.emea.nsn-intra.net (8.12.11.20060308/8.12.11) with ESMTP id u527jpOJ016092 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Thu, 2 Jun 2016 09:45:52 +0200 From: Matias Elo To: lng-odp@lists.linaro.org Date: Thu, 2 Jun 2016 10:45:48 +0300 Message-Id: <1464853550-9104-2-git-send-email-matias.elo@nokia.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1464853550-9104-1-git-send-email-matias.elo@nokia.com> References: <1464853550-9104-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: 4835 X-purgate-ID: 151667::1464853552-0000703B-9AC0C982/0/0 X-Topics: patch Subject: [lng-odp] [PATCH v2 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 Reviewed-and-tested-by: Bill Fischofer --- .../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,