[dpdk-stable] patch 'ring: remove signed type flip-flopping' has been queued to LTS release 17.11.5

Yongseok Koh yskoh at mellanox.com
Thu Jan 3 09:13:44 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 fd01e7cec2c5b5bc24b75f2ad3ea2ee73dbf2bba Mon Sep 17 00:00:00 2001
From: Andy Green <andy at warmcat.com>
Date: Thu, 17 May 2018 21:49:22 +0800
Subject: [PATCH] ring: remove signed type flip-flopping

[ backported from upstream commit e8ed5056c8747cd5d95a41749e48987ad44dc9b3 ]

GCC 8.1 warns:

rte_ring.h:350:46:
warning: conversion to 'uint32_t' {aka 'unsigned int'}
from 'int' may change the sign of the result
[-Wsign-conversion]
  update_tail(&r->prod, prod_head, prod_next, is_sp, 1);

The visible apis take unsigned int, then call a private
api taking an int, which finally calls an api taking an
unsigned int.

Convert the private api to take unsigned int removing
5 x warning similar to that shown above.

Fixes: 0dfc98c507b1 ("ring: separate out head index manipulation")

Signed-off-by: Andy Green <andy at warmcat.com>
Acked-by: Olivier Matz <olivier.matz at 6wind.com>
---
 lib/librte_ring/rte_ring.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h
index 5b1cb2bfe..978c4dd17 100644
--- a/lib/librte_ring/rte_ring.h
+++ b/lib/librte_ring/rte_ring.h
@@ -396,7 +396,7 @@ update_tail(struct rte_ring_headtail *ht, uint32_t old_val, uint32_t new_val,
  *   If behavior == RTE_RING_QUEUE_FIXED, this will be 0 or n only.
  */
 static __rte_always_inline unsigned int
-__rte_ring_move_prod_head(struct rte_ring *r, int is_sp,
+__rte_ring_move_prod_head(struct rte_ring *r, unsigned int is_sp,
 		unsigned int n, enum rte_ring_queue_behavior behavior,
 		uint32_t *old_head, uint32_t *new_head,
 		uint32_t *free_entries)
@@ -465,7 +465,7 @@ __rte_ring_move_prod_head(struct rte_ring *r, int is_sp,
 static __rte_always_inline unsigned int
 __rte_ring_do_enqueue(struct rte_ring *r, void * const *obj_table,
 		 unsigned int n, enum rte_ring_queue_behavior behavior,
-		 int is_sp, unsigned int *free_space)
+		 unsigned int is_sp, unsigned int *free_space)
 {
 	uint32_t prod_head, prod_next;
 	uint32_t free_entries;
@@ -509,7 +509,7 @@ end:
  *     If behavior == RTE_RING_QUEUE_FIXED, this will be 0 or n only.
  */
 static __rte_always_inline unsigned int
-__rte_ring_move_cons_head(struct rte_ring *r, int is_sc,
+__rte_ring_move_cons_head(struct rte_ring *r, unsigned int is_sc,
 		unsigned int n, enum rte_ring_queue_behavior behavior,
 		uint32_t *old_head, uint32_t *new_head,
 		uint32_t *entries)
@@ -575,7 +575,7 @@ __rte_ring_move_cons_head(struct rte_ring *r, int is_sc,
 static __rte_always_inline unsigned int
 __rte_ring_do_dequeue(struct rte_ring *r, void **obj_table,
 		 unsigned int n, enum rte_ring_queue_behavior behavior,
-		 int is_sc, unsigned int *available)
+		 unsigned int is_sc, unsigned int *available)
 {
 	uint32_t cons_head, cons_next;
 	uint32_t entries;
-- 
2.11.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-01-02 23:59:13.209654010 -0800
+++ 0021-ring-remove-signed-type-flip-flopping.patch	2019-01-02 23:59:12.072818000 -0800
@@ -1,8 +1,10 @@
-From e8ed5056c8747cd5d95a41749e48987ad44dc9b3 Mon Sep 17 00:00:00 2001
+From fd01e7cec2c5b5bc24b75f2ad3ea2ee73dbf2bba Mon Sep 17 00:00:00 2001
 From: Andy Green <andy at warmcat.com>
 Date: Thu, 17 May 2018 21:49:22 +0800
 Subject: [PATCH] ring: remove signed type flip-flopping
 
+[ backported from upstream commit e8ed5056c8747cd5d95a41749e48987ad44dc9b3 ]
+
 GCC 8.1 warns:
 
 rte_ring.h:350:46:
@@ -19,43 +21,18 @@
 5 x warning similar to that shown above.
 
 Fixes: 0dfc98c507b1 ("ring: separate out head index manipulation")
-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_ring/rte_ring.h         | 4 ++--
- lib/librte_ring/rte_ring_c11_mem.h | 2 +-
- lib/librte_ring/rte_ring_generic.h | 4 ++--
- 3 files changed, 5 insertions(+), 5 deletions(-)
+ lib/librte_ring/rte_ring.h | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
 
 diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h
-index d3d3f7f97..124582251 100644
+index 5b1cb2bfe..978c4dd17 100644
 --- a/lib/librte_ring/rte_ring.h
 +++ b/lib/librte_ring/rte_ring.h
-@@ -335,7 +335,7 @@ void rte_ring_dump(FILE *f, const struct rte_ring *r);
- static __rte_always_inline unsigned int
- __rte_ring_do_enqueue(struct rte_ring *r, void * const *obj_table,
- 		 unsigned int n, enum rte_ring_queue_behavior behavior,
--		 int is_sp, unsigned int *free_space)
-+		 unsigned int is_sp, unsigned int *free_space)
- {
- 	uint32_t prod_head, prod_next;
- 	uint32_t free_entries;
-@@ -377,7 +377,7 @@ end:
- static __rte_always_inline unsigned int
- __rte_ring_do_dequeue(struct rte_ring *r, void **obj_table,
- 		 unsigned int n, enum rte_ring_queue_behavior behavior,
--		 int is_sc, unsigned int *available)
-+		 unsigned int is_sc, unsigned int *available)
- {
- 	uint32_t cons_head, cons_next;
- 	uint32_t entries;
-diff --git a/lib/librte_ring/rte_ring_c11_mem.h b/lib/librte_ring/rte_ring_c11_mem.h
-index 08825ea5b..cb3f82b1a 100644
---- a/lib/librte_ring/rte_ring_c11_mem.h
-+++ b/lib/librte_ring/rte_ring_c11_mem.h
-@@ -51,7 +51,7 @@ update_tail(struct rte_ring_headtail *ht, uint32_t old_val, uint32_t new_val,
+@@ -396,7 +396,7 @@ update_tail(struct rte_ring_headtail *ht, uint32_t old_val, uint32_t new_val,
   *   If behavior == RTE_RING_QUEUE_FIXED, this will be 0 or n only.
   */
  static __rte_always_inline unsigned int
@@ -64,20 +41,16 @@
  		unsigned int n, enum rte_ring_queue_behavior behavior,
  		uint32_t *old_head, uint32_t *new_head,
  		uint32_t *free_entries)
-diff --git a/lib/librte_ring/rte_ring_generic.h b/lib/librte_ring/rte_ring_generic.h
-index c2d482bc9..ea7dbe5b9 100644
---- a/lib/librte_ring/rte_ring_generic.h
-+++ b/lib/librte_ring/rte_ring_generic.h
-@@ -53,7 +53,7 @@ update_tail(struct rte_ring_headtail *ht, uint32_t old_val, uint32_t new_val,
-  *   If behavior == RTE_RING_QUEUE_FIXED, this will be 0 or n only.
-  */
+@@ -465,7 +465,7 @@ __rte_ring_move_prod_head(struct rte_ring *r, int is_sp,
  static __rte_always_inline unsigned int
--__rte_ring_move_prod_head(struct rte_ring *r, int is_sp,
-+__rte_ring_move_prod_head(struct rte_ring *r, unsigned int is_sp,
- 		unsigned int n, enum rte_ring_queue_behavior behavior,
- 		uint32_t *old_head, uint32_t *new_head,
- 		uint32_t *free_entries)
-@@ -123,7 +123,7 @@ __rte_ring_move_prod_head(struct rte_ring *r, int is_sp,
+ __rte_ring_do_enqueue(struct rte_ring *r, void * const *obj_table,
+ 		 unsigned int n, enum rte_ring_queue_behavior behavior,
+-		 int is_sp, unsigned int *free_space)
++		 unsigned int is_sp, unsigned int *free_space)
+ {
+ 	uint32_t prod_head, prod_next;
+ 	uint32_t free_entries;
+@@ -509,7 +509,7 @@ end:
   *     If behavior == RTE_RING_QUEUE_FIXED, this will be 0 or n only.
   */
  static __rte_always_inline unsigned int
@@ -86,6 +59,15 @@
  		unsigned int n, enum rte_ring_queue_behavior behavior,
  		uint32_t *old_head, uint32_t *new_head,
  		uint32_t *entries)
+@@ -575,7 +575,7 @@ __rte_ring_move_cons_head(struct rte_ring *r, int is_sc,
+ static __rte_always_inline unsigned int
+ __rte_ring_do_dequeue(struct rte_ring *r, void **obj_table,
+ 		 unsigned int n, enum rte_ring_queue_behavior behavior,
+-		 int is_sc, unsigned int *available)
++		 unsigned int is_sc, unsigned int *available)
+ {
+ 	uint32_t cons_head, cons_next;
+ 	uint32_t entries;
 -- 
 2.11.0
 


More information about the stable mailing list