From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by dpdk.org (Postfix) with ESMTP id BD2C92BC8 for ; Mon, 15 Oct 2018 13:52:35 +0200 (CEST) Received: by mail-wr1-f41.google.com with SMTP id 63-v6so20930443wra.11 for ; Mon, 15 Oct 2018 04:52:35 -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=2PYFuBtnzN/v0DajvfFcTvbKCBCl1ba1x+rgiGm5HuE=; b=RGpNAuB7EKVzo4jrPWzT0j8zqaj3A0CAImoOOZyDnrEWRph6ctoWGaeHbe4jcdzSDY fQ4+ufmMPYRJlYr9Xwxlb1maUeqEKl0hOCgnmBwltzhEI7dgO9B/DKwbW9Ii6DRAVyEa t9784AJlc9AysuU55vsNhgOkcKI3Yc1K0e6YZyasUO6qLBNXGzF0uwfxcKISncqxiBX/ 720LYquXKdAmh2sZtlCj+nd+2u0GN0LvuqZPkAPMipy5VhTRcerRwmOn3dEdQ8DMGZt0 e+TfoSc+0hjQ1bMNLITuZ4FkI7MPJUMEWqkreoh9dgHZogXqI/ZSWNRT2IkncwIWixf1 ffyw== X-Gm-Message-State: ABuFfojFjVgyoeqBtTiUw0lapLwybYTazEcC2TXU9QQK3wTt0Oc1n5QU t9cxEsEpNgF0lf+EQ0yTa7xz2nkr X-Google-Smtp-Source: ACcGV61Gl1Piemf+hUydOKW+pcxZqCp0iGxu5YbJgTquj4XFmVRMNN9qJ5h6QTYRMExAVp7gNVvXnQ== X-Received: by 2002:adf:c594:: with SMTP id m20-v6mr14147357wrg.30.1539604355349; Mon, 15 Oct 2018 04:52:35 -0700 (PDT) Received: from localhost ([2a01:4b00:f419:6f00:8361:8946:ba2b:d556]) by smtp.gmail.com with ESMTPSA id t24-v6sm8806781wra.5.2018.10.15.04.52.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Oct 2018 04:52:34 -0700 (PDT) From: Luca Boccassi To: Vivek Sharma Cc: Cristian Dumitrescu , dpdk stable Date: Mon, 15 Oct 2018 12:51:44 +0100 Message-Id: <20181015115144.27626-24-bluca@debian.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181015115144.27626-1-bluca@debian.org> References: <20181003162121.16364-1-bluca@debian.org> <20181015115144.27626-1-bluca@debian.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'eal: use correct data type for bitmap slab operations' 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, 15 Oct 2018 11:52:35 -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/17/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 c9e733e77b3207b70133b42a83207c7991d4dcb8 Mon Sep 17 00:00:00 2001 From: Vivek Sharma Date: Tue, 25 Sep 2018 09:53:06 +0000 Subject: [PATCH] eal: use correct data type for bitmap slab operations [ upstream commit bed70e5deb1bc927c5adb375d15c1d32c6c137d8 ] Currently, slab operations use unsigned long data type for 64-bit slab related operations. On target 'i686-native-linuxapp-gcc', unsigned long is 32-bit and thus, slab operations breaks on this target. Changing slab operations to use unsigned long long for correct functioning on all targets. Fixes: de3cfa2c9823 ("sched: initial import") Fixes: 693f715da45c ("remove extra parentheses in return statement") Signed-off-by: Vivek Sharma Acked-by: Cristian Dumitrescu --- lib/librte_sched/rte_bitmap.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/librte_sched/rte_bitmap.h b/lib/librte_sched/rte_bitmap.h index bbf4da94be..6828a7c3b0 100644 --- a/lib/librte_sched/rte_bitmap.h +++ b/lib/librte_sched/rte_bitmap.h @@ -116,7 +116,7 @@ __rte_bitmap_index1_inc(struct rte_bitmap *bmp) static inline uint64_t __rte_bitmap_mask1_get(struct rte_bitmap *bmp) { - return (~1lu) << bmp->offset1; + return (~1llu) << bmp->offset1; } static inline void @@ -345,7 +345,7 @@ rte_bitmap_get(struct rte_bitmap *bmp, uint32_t pos) index2 = pos >> RTE_BITMAP_SLAB_BIT_SIZE_LOG2; offset2 = pos & RTE_BITMAP_SLAB_BIT_MASK; slab2 = bmp->array2 + index2; - return (*slab2) & (1lu << offset2); + return (*slab2) & (1llu << offset2); } /** @@ -370,8 +370,8 @@ rte_bitmap_set(struct rte_bitmap *bmp, uint32_t pos) slab2 = bmp->array2 + index2; slab1 = bmp->array1 + index1; - *slab2 |= 1lu << offset2; - *slab1 |= 1lu << offset1; + *slab2 |= 1llu << offset2; + *slab1 |= 1llu << offset1; } /** @@ -398,7 +398,7 @@ rte_bitmap_set_slab(struct rte_bitmap *bmp, uint32_t pos, uint64_t slab) slab1 = bmp->array1 + index1; *slab2 |= slab; - *slab1 |= 1lu << offset1; + *slab1 |= 1llu << offset1; } static inline uint64_t @@ -436,7 +436,7 @@ rte_bitmap_clear(struct rte_bitmap *bmp, uint32_t pos) slab2 = bmp->array2 + index2; /* Return if array2 slab is not all-zeros */ - *slab2 &= ~(1lu << offset2); + *slab2 &= ~(1llu << offset2); if (*slab2){ return; } @@ -452,7 +452,7 @@ rte_bitmap_clear(struct rte_bitmap *bmp, uint32_t pos) index1 = pos >> (RTE_BITMAP_SLAB_BIT_SIZE_LOG2 + RTE_BITMAP_CL_BIT_SIZE_LOG2); offset1 = (pos >> RTE_BITMAP_CL_BIT_SIZE_LOG2) & RTE_BITMAP_SLAB_BIT_MASK; slab1 = bmp->array1 + index1; - *slab1 &= ~(1lu << offset1); + *slab1 &= ~(1llu << offset1); return; } -- 2.19.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-10-15 12:48:35.220885343 +0100 +++ 0024-eal-use-correct-data-type-for-bitmap-slab-operations.patch 2018-10-15 12:48:34.617096016 +0100 @@ -1,8 +1,10 @@ -From bed70e5deb1bc927c5adb375d15c1d32c6c137d8 Mon Sep 17 00:00:00 2001 +From c9e733e77b3207b70133b42a83207c7991d4dcb8 Mon Sep 17 00:00:00 2001 From: Vivek Sharma Date: Tue, 25 Sep 2018 09:53:06 +0000 Subject: [PATCH] eal: use correct data type for bitmap slab operations +[ upstream commit bed70e5deb1bc927c5adb375d15c1d32c6c137d8 ] + Currently, slab operations use unsigned long data type for 64-bit slab related operations. On target 'i686-native-linuxapp-gcc', unsigned long is 32-bit and thus, slab operations breaks on this target. Changing slab @@ -11,20 +13,18 @@ Fixes: de3cfa2c9823 ("sched: initial import") Fixes: 693f715da45c ("remove extra parentheses in return statement") -Cc: stable@dpdk.org Signed-off-by: Vivek Sharma Acked-by: Cristian Dumitrescu --- - lib/librte_eal/common/include/rte_bitmap.h | 14 +++++++------- - test/test/test_bitmap.c | 18 ++++++++++++++++++ - 2 files changed, 25 insertions(+), 7 deletions(-) - -diff --git a/lib/librte_eal/common/include/rte_bitmap.h b/lib/librte_eal/common/include/rte_bitmap.h -index d9facc642d..7a36ce73c6 100644 ---- a/lib/librte_eal/common/include/rte_bitmap.h -+++ b/lib/librte_eal/common/include/rte_bitmap.h -@@ -88,7 +88,7 @@ __rte_bitmap_index1_inc(struct rte_bitmap *bmp) + lib/librte_sched/rte_bitmap.h | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/lib/librte_sched/rte_bitmap.h b/lib/librte_sched/rte_bitmap.h +index bbf4da94be..6828a7c3b0 100644 +--- a/lib/librte_sched/rte_bitmap.h ++++ b/lib/librte_sched/rte_bitmap.h +@@ -116,7 +116,7 @@ __rte_bitmap_index1_inc(struct rte_bitmap *bmp) static inline uint64_t __rte_bitmap_mask1_get(struct rte_bitmap *bmp) { @@ -33,7 +33,7 @@ } static inline void -@@ -317,7 +317,7 @@ rte_bitmap_get(struct rte_bitmap *bmp, uint32_t pos) +@@ -345,7 +345,7 @@ rte_bitmap_get(struct rte_bitmap *bmp, uint32_t pos) index2 = pos >> RTE_BITMAP_SLAB_BIT_SIZE_LOG2; offset2 = pos & RTE_BITMAP_SLAB_BIT_MASK; slab2 = bmp->array2 + index2; @@ -42,7 +42,7 @@ } /** -@@ -342,8 +342,8 @@ rte_bitmap_set(struct rte_bitmap *bmp, uint32_t pos) +@@ -370,8 +370,8 @@ rte_bitmap_set(struct rte_bitmap *bmp, uint32_t pos) slab2 = bmp->array2 + index2; slab1 = bmp->array1 + index1; @@ -53,7 +53,7 @@ } /** -@@ -370,7 +370,7 @@ rte_bitmap_set_slab(struct rte_bitmap *bmp, uint32_t pos, uint64_t slab) +@@ -398,7 +398,7 @@ rte_bitmap_set_slab(struct rte_bitmap *bmp, uint32_t pos, uint64_t slab) slab1 = bmp->array1 + index1; *slab2 |= slab; @@ -62,7 +62,7 @@ } static inline uint64_t -@@ -408,7 +408,7 @@ rte_bitmap_clear(struct rte_bitmap *bmp, uint32_t pos) +@@ -436,7 +436,7 @@ rte_bitmap_clear(struct rte_bitmap *bmp, uint32_t pos) slab2 = bmp->array2 + index2; /* Return if array2 slab is not all-zeros */ @@ -71,7 +71,7 @@ if (*slab2){ return; } -@@ -424,7 +424,7 @@ rte_bitmap_clear(struct rte_bitmap *bmp, uint32_t pos) +@@ -452,7 +452,7 @@ rte_bitmap_clear(struct rte_bitmap *bmp, uint32_t pos) index1 = pos >> (RTE_BITMAP_SLAB_BIT_SIZE_LOG2 + RTE_BITMAP_CL_BIT_SIZE_LOG2); offset1 = (pos >> RTE_BITMAP_CL_BIT_SIZE_LOG2) & RTE_BITMAP_SLAB_BIT_MASK; slab1 = bmp->array1 + index1; @@ -80,42 +80,6 @@ return; } -diff --git a/test/test/test_bitmap.c b/test/test/test_bitmap.c -index c3169e9d55..95c5184882 100644 ---- a/test/test/test_bitmap.c -+++ b/test/test/test_bitmap.c -@@ -101,6 +101,7 @@ test_bitmap_slab_set_get(struct rte_bitmap *bmp) - static int - test_bitmap_set_get_clear(struct rte_bitmap *bmp) - { -+ uint64_t val; - int i; - - rte_bitmap_reset(bmp); -@@ -124,6 +125,23 @@ test_bitmap_set_get_clear(struct rte_bitmap *bmp) - } - } - -+ rte_bitmap_reset(bmp); -+ -+ /* Alternate slab set test */ -+ for (i = 0; i < MAX_BITS; i++) { -+ if (i % RTE_BITMAP_SLAB_BIT_SIZE) -+ rte_bitmap_set(bmp, i); -+ } -+ -+ for (i = 0; i < MAX_BITS; i++) { -+ val = rte_bitmap_get(bmp, i); -+ if (((i % RTE_BITMAP_SLAB_BIT_SIZE) && !val) || -+ (!(i % RTE_BITMAP_SLAB_BIT_SIZE) && val)) { -+ printf("Failed to get set bit.\n"); -+ return TEST_FAILED; -+ } -+ } -+ - return TEST_SUCCESS; - } - -- 2.19.1