[dpdk-stable] patch 'mbuf: fix reference counter integer promotion' has been queued to LTS release 17.11.5
Yongseok Koh
yskoh at mellanox.com
Thu Jan 3 09:13:45 CET 2019
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 <andy at warmcat.com>
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 <andy at warmcat.com>
Acked-by: Olivier Matz <olivier.matz at 6wind.com>
---
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 <andy at warmcat.com>
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 at dpdk.org
Signed-off-by: Andy Green <andy at warmcat.com>
Acked-by: Olivier Matz <olivier.matz at 6wind.com>
---
- 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
More information about the stable
mailing list