From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id BD84A1E2F for ; Mon, 29 Oct 2018 13:53:54 +0100 (CET) Received: by mail-wr1-f68.google.com with SMTP id w5-v6so8573820wrt.2 for ; Mon, 29 Oct 2018 05:53:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gdPQQ7kMohIFxaBaU1uGA8qdNdfhNG8iXxZyTcoPhUs=; b=k3oSx1Tf8XbeeVH1lB/8iJDBr3eCSfVDESTZrkRFHocX5SuPKChRN623JpTAAkW7DT a+552Mt0jFs+revTp4ScnNxkEJKE8qnCjMRVHyNrV8iHKHJeUBsbb+xlgJqpBRu9kZNp VGB1POexRXxL6DBs4jalYTltqihwDx+rJAXuqGJWJBZZneTi0JKm3Dnri+zgsEZGeH/O Vzfpp7sA7DlYnXQkqKFVvONhqirZdtflGBOM8A8202vMsZZGgVjonqI/hheFoQSpP7E7 oX68jI9xuvUzSxSlwDgoAua+wMdCGZthSyfGGN/i10F6wlc6HxTayRwG4In6I0GbPbKj Q3iw== X-Gm-Message-State: AGRZ1gLpwCEMBZ0gQn8SxcCBOXXVhORSS3wpAefcasMVfALqhAxLevY8 B9cljnqHjovHMyh7gmPfl8A= X-Google-Smtp-Source: AJdET5fkGhRQLn2hGfIbvEBuq9CgVhUqmWVLgi71f04uU4d3AUUpNkUZ/U7RS/sODxk6tFLl7uBfPg== X-Received: by 2002:adf:8c09:: with SMTP id z9-v6mr11494295wra.82.1540817634355; Mon, 29 Oct 2018 05:53:54 -0700 (PDT) Received: from localhost ([2a01:4b00:f419:6f00:8361:8946:ba2b:d556]) by smtp.gmail.com with ESMTPSA id j6-v6sm15147998wmd.29.2018.10.29.05.53.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Oct 2018 05:53:53 -0700 (PDT) From: Luca Boccassi To: Honnappa Nagarahalli Cc: Gavin Hu , Ola Liljedahl , Steve Capper , Yipeng Wang , Bruce Richardson , dpdk stable Date: Mon, 29 Oct 2018 12:53:15 +0000 Message-Id: <20181029125329.17729-6-bluca@debian.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181029125329.17729-1-bluca@debian.org> References: <20181015115144.27626-1-bluca@debian.org> <20181029125329.17729-1-bluca@debian.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'hash: fix key store element alignment' has been queued to LTS release 16.11.9 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2018 12:53:54 -0000 Hi, FYI, your patch has been queued to LTS release 16.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/31/18. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Luca Boccassi --- >>From 92e21e2bfb1b8dacc4aeb19514090ccb194bff60 Mon Sep 17 00:00:00 2001 From: Honnappa Nagarahalli Date: Fri, 26 Oct 2018 00:37:31 -0500 Subject: [PATCH] hash: fix key store element alignment [ upstream commit dbdbc4a2e9c4b67247ef2f6556debe7522b5d2e4 ] Fix the key store array element alignment such that every array element is aligned on KEY_ALIGNMENT boundary. This is required to make 'pdata' in 'struct rte_hash_key' align on its natural boundary for atomic load/store. Fixes: 473d1bebce43 ("hash: allow to store data in hash table") Signed-off-by: Honnappa Nagarahalli Reviewed-by: Gavin Hu Reviewed-by: Ola Liljedahl Reviewed-by: Steve Capper Reviewed-by: Yipeng Wang Acked-by: Bruce Richardson --- lib/librte_hash/rte_cuckoo_hash.c | 4 +++- lib/librte_hash/rte_cuckoo_hash.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c index 049ff9884..5aaa6ccd0 100644 --- a/lib/librte_hash/rte_cuckoo_hash.c +++ b/lib/librte_hash/rte_cuckoo_hash.c @@ -212,7 +212,9 @@ rte_hash_create(const struct rte_hash_parameters *params) goto err_unlock; } - const uint32_t key_entry_size = sizeof(struct rte_hash_key) + params->key_len; + const uint32_t key_entry_size = + RTE_ALIGN(sizeof(struct rte_hash_key) + params->key_len, + KEY_ALIGNMENT); const uint64_t key_tbl_size = (uint64_t) key_entry_size * num_key_slots; k = rte_zmalloc_socket(NULL, key_tbl_size, diff --git a/lib/librte_hash/rte_cuckoo_hash.h b/lib/librte_hash/rte_cuckoo_hash.h index 1b8ffed8e..dae3f4a3c 100644 --- a/lib/librte_hash/rte_cuckoo_hash.h +++ b/lib/librte_hash/rte_cuckoo_hash.h @@ -161,7 +161,7 @@ struct rte_hash_key { }; /* Variable key size */ char key[0]; -} __attribute__((aligned(KEY_ALIGNMENT))); +}; /* All different signature compare functions */ enum rte_hash_sig_compare_function { -- 2.19.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-10-29 12:48:14.585131127 +0000 +++ 0006-hash-fix-key-store-element-alignment.patch 2018-10-29 12:48:14.438417982 +0000 @@ -1,15 +1,16 @@ -From dbdbc4a2e9c4b67247ef2f6556debe7522b5d2e4 Mon Sep 17 00:00:00 2001 +From 92e21e2bfb1b8dacc4aeb19514090ccb194bff60 Mon Sep 17 00:00:00 2001 From: Honnappa Nagarahalli Date: Fri, 26 Oct 2018 00:37:31 -0500 Subject: [PATCH] hash: fix key store element alignment +[ upstream commit dbdbc4a2e9c4b67247ef2f6556debe7522b5d2e4 ] + Fix the key store array element alignment such that every array element is aligned on KEY_ALIGNMENT boundary. This is required to make 'pdata' in 'struct rte_hash_key' align on its natural boundary for atomic load/store. Fixes: 473d1bebce43 ("hash: allow to store data in hash table") -Cc: stable@dpdk.org Signed-off-by: Honnappa Nagarahalli Reviewed-by: Gavin Hu @@ -23,11 +24,11 @@ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c -index e08739370..d79ba68fd 100644 +index 049ff9884..5aaa6ccd0 100644 --- a/lib/librte_hash/rte_cuckoo_hash.c +++ b/lib/librte_hash/rte_cuckoo_hash.c -@@ -279,7 +279,9 @@ rte_hash_create(const struct rte_hash_parameters *params) - rte_ring_sp_enqueue(r_ext, (void *)((uintptr_t) i)); +@@ -212,7 +212,9 @@ rte_hash_create(const struct rte_hash_parameters *params) + goto err_unlock; } - const uint32_t key_entry_size = sizeof(struct rte_hash_key) + params->key_len; @@ -38,10 +39,10 @@ k = rte_zmalloc_socket(NULL, key_tbl_size, diff --git a/lib/librte_hash/rte_cuckoo_hash.h b/lib/librte_hash/rte_cuckoo_hash.h -index ff9518184..601b2ce78 100644 +index 1b8ffed8e..dae3f4a3c 100644 --- a/lib/librte_hash/rte_cuckoo_hash.h +++ b/lib/librte_hash/rte_cuckoo_hash.h -@@ -123,7 +123,7 @@ struct rte_hash_key { +@@ -161,7 +161,7 @@ struct rte_hash_key { }; /* Variable key size */ char key[0];