From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 8C3491B217 for ; Thu, 3 Jan 2019 09:15:01 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from yskoh@mellanox.com) with ESMTPS (AES256-SHA encrypted); 3 Jan 2019 10:15:00 +0200 Received: from scfae-sc-2.mti.labs.mlnx (scfae-sc-2.mti.labs.mlnx [10.101.0.96]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x038EJfp008603; Thu, 3 Jan 2019 10:14:58 +0200 From: Yongseok Koh To: Andy Green Cc: Olivier Matz , dpdk stable Date: Thu, 3 Jan 2019 00:13:45 -0800 Message-Id: <20190103081400.14191-22-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190103081400.14191-1-yskoh@mellanox.com> References: <20190103081400.14191-1-yskoh@mellanox.com> Subject: [dpdk-stable] patch 'mbuf: fix reference counter integer promotion' has been queued to LTS release 17.11.5 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: Thu, 03 Jan 2019 08:15:01 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 01/04/19. 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. Yongseok --- >>From c7e94462ba69a778ef76f97dcafbf8de0370883f Mon Sep 17 00:00:00 2001 From: Andy Green Date: Thu, 17 May 2018 21:49:27 +0800 Subject: [PATCH] mbuf: fix reference counter integer promotion [ upstream commit ee07d519ceb05e59dd970c48a42cf2f09b3ac4dc ] GCC 8.1 warned: "1 + value", where value is an uint16_t causes promotion to a signed int. The compiler complained that we are shoving an int into a uint16_t return type with different size and sign. Bumping and returning value directly instead removes the promotion and the problem. Fixes: f20b50b946da ("mbuf: optimize refcnt update") Signed-off-by: Andy Green Acked-by: Olivier Matz --- lib/librte_mbuf/rte_mbuf.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index e5697614f..4f6e0f7e3 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -789,8 +789,9 @@ rte_mbuf_refcnt_update(struct rte_mbuf *m, int16_t value) * reference counter can occur. */ if (likely(rte_mbuf_refcnt_read(m) == 1)) { - rte_mbuf_refcnt_set(m, 1 + value); - return 1 + value; + ++value; + rte_mbuf_refcnt_set(m, value); + return value; } return __rte_mbuf_refcnt_update(m, value); -- 2.11.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-01-02 23:59:13.262883446 -0800 +++ 0022-mbuf-fix-reference-counter-integer-promotion.patch 2019-01-02 23:59:12.076816000 -0800 @@ -1,8 +1,10 @@ -From ee07d519ceb05e59dd970c48a42cf2f09b3ac4dc Mon Sep 17 00:00:00 2001 +From c7e94462ba69a778ef76f97dcafbf8de0370883f Mon Sep 17 00:00:00 2001 From: Andy Green Date: Thu, 17 May 2018 21:49:27 +0800 Subject: [PATCH] mbuf: fix reference counter integer promotion +[ upstream commit ee07d519ceb05e59dd970c48a42cf2f09b3ac4dc ] + GCC 8.1 warned: "1 + value", where value is an uint16_t causes promotion @@ -14,20 +16,18 @@ promotion and the problem. Fixes: f20b50b946da ("mbuf: optimize refcnt update") -Fixes: a53aa2b9f3be ("mbuf: support attaching external buffer") -Cc: stable@dpdk.org Signed-off-by: Andy Green Acked-by: Olivier Matz --- - lib/librte_mbuf/rte_mbuf.h | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) + lib/librte_mbuf/rte_mbuf.h | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h -index eab13c6bf..8a2dae23b 100644 +index e5697614f..4f6e0f7e3 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h -@@ -836,8 +836,9 @@ rte_mbuf_refcnt_update(struct rte_mbuf *m, int16_t value) +@@ -789,8 +789,9 @@ rte_mbuf_refcnt_update(struct rte_mbuf *m, int16_t value) * reference counter can occur. */ if (likely(rte_mbuf_refcnt_read(m) == 1)) { @@ -39,18 +39,6 @@ } return __rte_mbuf_refcnt_update(m, value); -@@ -927,8 +928,9 @@ rte_mbuf_ext_refcnt_update(struct rte_mbuf_ext_shared_info *shinfo, - int16_t value) - { - if (likely(rte_mbuf_ext_refcnt_read(shinfo) == 1)) { -- rte_mbuf_ext_refcnt_set(shinfo, 1 + value); -- return 1 + value; -+ ++value; -+ rte_mbuf_ext_refcnt_set(shinfo, value); -+ return value; - } - - return (uint16_t)rte_atomic16_add_return(&shinfo->refcnt_atomic, value); -- 2.11.0