From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-f193.google.com (mail-qt1-f193.google.com [209.85.160.193]) by dpdk.org (Postfix) with ESMTP id 50BF75689 for ; Tue, 9 Apr 2019 21:06:44 +0200 (CEST) Received: by mail-qt1-f193.google.com with SMTP id p20so21142234qtc.9 for ; Tue, 09 Apr 2019 12:06:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:reply-to; bh=D1GLWxvrYQT9Y/1LIEQXZEP5rNp6P52u208lq3BvheA=; b=jOYxAeSpgiQS3Nn/vvrVNQ/rDu4soHxd/o1wqpzqWaYgysZjqwzDJX4ZYAC1rGJ2vF Vadjcusr7q3BCqpzq6OGnxOsOL6J7CwO8XTKU7iXUSEyBtRG/lRJwUbe1wREmIBjuN4p ZohxmBYLHSaeVl1gFF9m8E7DE81PYCyV2XF4zw1yIcvXdjTsvf3iuJYyd5XDlLmbLdG5 qZtBgwF0HTVipzEF9Cpk2Qe3Snm593T7Igtxl6fLYP3Jv2y950/qXjASyIs8b92rTsL4 LtkEmRt+Rb9s/92/VvHmP+9nL1wFDMnQHhzwRWXP43LFYQoHg7XwsFMZ72qsHEzMYxWE xibQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:reply-to; bh=D1GLWxvrYQT9Y/1LIEQXZEP5rNp6P52u208lq3BvheA=; b=MYK/7Npg8vqZmNUNhr4uKxyNzcAPrZ4AbqJUbnuwr/z/RUS824GScyUnl16NrA2uCj W+wK9UfcnWzXz7bsoHpWGat6jQYi+UjJhvESS8rPU2UoiNAggEn8N+BjBSwpN8s7Pf8f HS0u7loDAWQrLk+v8TSZGUWrwpSCQv5bIiCIhKMBSNRUfk/CDSTutWYyhwkF2U3AY9tr 6y4fpJBEEJ0eTuZaJHOs0lxUbb3oV7/J8UMLXTmiEs0XGSdJst7M+vM85JcHVGnpWOQe 9IRlId4qL6nu4NMyfWov7SIQeuL0ac0PpT8Wx0K2W+cZSwScs7oPpSsJP0bgo5eKeozU IVPA== X-Gm-Message-State: APjAAAVQV4gYGat5kpeXfz5eGZaRnnl4zr60eOFygsHdl2aWU4+VMZoY osdDCXTNEs3tmYiFiiNgTn8G4H0ipQc= X-Google-Smtp-Source: APXvYqyCOdiZJetBZuoxEWcfRhQwH+vYpmIzUuuJBhBz6pgUdskYCzv4Hr1HaHEM7fW9KFC9n77iuQ== X-Received: by 2002:ac8:168c:: with SMTP id r12mr30606033qtj.300.1554836803423; Tue, 09 Apr 2019 12:06:43 -0700 (PDT) Received: from csz25116.canlab.ibm.com ([199.246.40.57]) by smtp.gmail.com with ESMTPSA id q23sm17934789qkc.16.2019.04.09.12.06.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Apr 2019 12:06:42 -0700 (PDT) From: Vivian Kong X-Google-Original-From: Vivian Kong To: dev@dpdk.org Date: Tue, 9 Apr 2019 15:06:26 -0400 Message-Id: <20190409190630.31975-9-vivkong@ca.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190409190630.31975-1-vivkong@ca.ibm.com> References: <20190409190630.31975-1-vivkong@ca.ibm.com> Subject: [dpdk-dev] [RFC 08/12] hash: add support for s390x architecture X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: vivkong@ca.ibm.com List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Apr 2019 19:06:44 -0000 Add big endian support for s390x architecture. Signed-off-by: Vivian Kong --- lib/librte_hash/rte_fbk_hash.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/librte_hash/rte_fbk_hash.h b/lib/librte_hash/rte_fbk_hash.h index c4d6976d2..5e49950a7 100644 --- a/lib/librte_hash/rte_fbk_hash.h +++ b/lib/librte_hash/rte_fbk_hash.h @@ -125,9 +125,16 @@ rte_fbk_hash_add_key_with_bucket(struct rte_fbk_hash_table *ht, * corrupted due to race conditions, but it's still possible to * overwrite entries that have just been made valid. */ + #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN const uint64_t new_entry = ((uint64_t)(key) << 32) | ((uint64_t)(value) << 16) | 1; /* 1 = is_entry bit. */ + #else + const uint64_t new_entry = + ((uint64_t)(1) << 48) | /* 1 = is_entry bit. */ + ((uint64_t)(value) << 32) | + (uint64_t)(key); + #endif uint32_t i; for (i = 0; i < ht->entries_per_bucket; i++) { -- 2.17.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 768EFA0096 for ; Tue, 9 Apr 2019 21:08:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AB8075F1B; Tue, 9 Apr 2019 21:07:02 +0200 (CEST) Received: from mail-qt1-f193.google.com (mail-qt1-f193.google.com [209.85.160.193]) by dpdk.org (Postfix) with ESMTP id 50BF75689 for ; Tue, 9 Apr 2019 21:06:44 +0200 (CEST) Received: by mail-qt1-f193.google.com with SMTP id p20so21142234qtc.9 for ; Tue, 09 Apr 2019 12:06:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:reply-to; bh=D1GLWxvrYQT9Y/1LIEQXZEP5rNp6P52u208lq3BvheA=; b=jOYxAeSpgiQS3Nn/vvrVNQ/rDu4soHxd/o1wqpzqWaYgysZjqwzDJX4ZYAC1rGJ2vF Vadjcusr7q3BCqpzq6OGnxOsOL6J7CwO8XTKU7iXUSEyBtRG/lRJwUbe1wREmIBjuN4p ZohxmBYLHSaeVl1gFF9m8E7DE81PYCyV2XF4zw1yIcvXdjTsvf3iuJYyd5XDlLmbLdG5 qZtBgwF0HTVipzEF9Cpk2Qe3Snm593T7Igtxl6fLYP3Jv2y950/qXjASyIs8b92rTsL4 LtkEmRt+Rb9s/92/VvHmP+9nL1wFDMnQHhzwRWXP43LFYQoHg7XwsFMZ72qsHEzMYxWE xibQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:reply-to; bh=D1GLWxvrYQT9Y/1LIEQXZEP5rNp6P52u208lq3BvheA=; b=MYK/7Npg8vqZmNUNhr4uKxyNzcAPrZ4AbqJUbnuwr/z/RUS824GScyUnl16NrA2uCj W+wK9UfcnWzXz7bsoHpWGat6jQYi+UjJhvESS8rPU2UoiNAggEn8N+BjBSwpN8s7Pf8f HS0u7loDAWQrLk+v8TSZGUWrwpSCQv5bIiCIhKMBSNRUfk/CDSTutWYyhwkF2U3AY9tr 6y4fpJBEEJ0eTuZaJHOs0lxUbb3oV7/J8UMLXTmiEs0XGSdJst7M+vM85JcHVGnpWOQe 9IRlId4qL6nu4NMyfWov7SIQeuL0ac0PpT8Wx0K2W+cZSwScs7oPpSsJP0bgo5eKeozU IVPA== X-Gm-Message-State: APjAAAVQV4gYGat5kpeXfz5eGZaRnnl4zr60eOFygsHdl2aWU4+VMZoY osdDCXTNEs3tmYiFiiNgTn8G4H0ipQc= X-Google-Smtp-Source: APXvYqyCOdiZJetBZuoxEWcfRhQwH+vYpmIzUuuJBhBz6pgUdskYCzv4Hr1HaHEM7fW9KFC9n77iuQ== X-Received: by 2002:ac8:168c:: with SMTP id r12mr30606033qtj.300.1554836803423; Tue, 09 Apr 2019 12:06:43 -0700 (PDT) Received: from csz25116.canlab.ibm.com ([199.246.40.57]) by smtp.gmail.com with ESMTPSA id q23sm17934789qkc.16.2019.04.09.12.06.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Apr 2019 12:06:42 -0700 (PDT) From: Vivian Kong X-Google-Original-From: Vivian Kong To: dev@dpdk.org Date: Tue, 9 Apr 2019 15:06:26 -0400 Message-Id: <20190409190630.31975-9-vivkong@ca.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190409190630.31975-1-vivkong@ca.ibm.com> References: <20190409190630.31975-1-vivkong@ca.ibm.com> Subject: [dpdk-dev] [RFC 08/12] hash: add support for s390x architecture X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: vivkong@ca.ibm.com List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190409190626.Dp8eADjQ2ylnFTLnaMT8Ljh8X4fObkEG2bZo5nURmrU@z> Add big endian support for s390x architecture. Signed-off-by: Vivian Kong --- lib/librte_hash/rte_fbk_hash.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/librte_hash/rte_fbk_hash.h b/lib/librte_hash/rte_fbk_hash.h index c4d6976d2..5e49950a7 100644 --- a/lib/librte_hash/rte_fbk_hash.h +++ b/lib/librte_hash/rte_fbk_hash.h @@ -125,9 +125,16 @@ rte_fbk_hash_add_key_with_bucket(struct rte_fbk_hash_table *ht, * corrupted due to race conditions, but it's still possible to * overwrite entries that have just been made valid. */ + #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN const uint64_t new_entry = ((uint64_t)(key) << 32) | ((uint64_t)(value) << 16) | 1; /* 1 = is_entry bit. */ + #else + const uint64_t new_entry = + ((uint64_t)(1) << 48) | /* 1 = is_entry bit. */ + ((uint64_t)(value) << 32) | + (uint64_t)(key); + #endif uint32_t i; for (i = 0; i < ht->entries_per_bucket; i++) { -- 2.17.1