patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 1/5] eal: fix build with -O1
       [not found] <20181116165854.24017-1-thomas@monjalon.net>
@ 2018-11-16 16:58 ` Thomas Monjalon
  2018-11-16 16:58 ` [dpdk-stable] [PATCH 2/5] kni: fix possible uninitialized variable Thomas Monjalon
  2018-11-16 16:58 ` [dpdk-stable] [PATCH 3/5] net/mlx4: " Thomas Monjalon
  2 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2018-11-16 16:58 UTC (permalink / raw)
  To: dev; +Cc: stable

In case of optimized compilation, RTE_BUILD_BUG_ON use an external
variable which is neither defined, nor used.
It seems not optimized out in case of OPDL compiled with clang -O1:
	opdl_ring.c: undefined reference to `RTE_BUILD_BUG_ON_detected_error'
	clang-6.0: fatal error: linker command failed with exit code 1

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 lib/librte_eal/common/include/rte_common.h | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h
index 87f0f6302..57acb8485 100644
--- a/lib/librte_eal/common/include/rte_common.h
+++ b/lib/librte_eal/common/include/rte_common.h
@@ -270,16 +270,7 @@ rte_is_aligned(void *ptr, unsigned align)
 /**
  * Triggers an error at compilation time if the condition is true.
  */
-#ifndef __OPTIMIZE__
 #define RTE_BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
-#else
-extern int RTE_BUILD_BUG_ON_detected_error;
-#define RTE_BUILD_BUG_ON(condition) do {             \
-	((void)sizeof(char[1 - 2*!!(condition)]));   \
-	if (condition)                               \
-		RTE_BUILD_BUG_ON_detected_error = 1; \
-} while(0)
-#endif
 
 /**
  * Combines 32b inputs most significant set bits into the least
-- 
2.19.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dpdk-stable] [PATCH 2/5] kni: fix possible uninitialized variable
       [not found] <20181116165854.24017-1-thomas@monjalon.net>
  2018-11-16 16:58 ` [dpdk-stable] [PATCH 1/5] eal: fix build with -O1 Thomas Monjalon
@ 2018-11-16 16:58 ` Thomas Monjalon
  2018-11-16 16:58 ` [dpdk-stable] [PATCH 3/5] net/mlx4: " Thomas Monjalon
  2 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2018-11-16 16:58 UTC (permalink / raw)
  To: dev; +Cc: stable

This error can be raised:
	lib/librte_kni/rte_kni.c:531:15: error:
	'req' may be used uninitialized in this function

It should not happen because kni_fifo_get() would return 0 if
req is not initialized, so the function would return before using req.
But GCC complains about it in -O1 optimization,
and a NULL initialization is harmless here.

Fixes: 3fc5ca2f6352 ("kni: initial import")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 lib/librte_kni/rte_kni.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c
index c9726d4f8..73aeccccf 100644
--- a/lib/librte_kni/rte_kni.c
+++ b/lib/librte_kni/rte_kni.c
@@ -483,7 +483,7 @@ int
 rte_kni_handle_request(struct rte_kni *kni)
 {
 	unsigned ret;
-	struct rte_kni_request *req;
+	struct rte_kni_request *req = NULL;
 
 	if (kni == NULL)
 		return -1;
-- 
2.19.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dpdk-stable] [PATCH 3/5] net/mlx4: fix possible uninitialized variable
       [not found] <20181116165854.24017-1-thomas@monjalon.net>
  2018-11-16 16:58 ` [dpdk-stable] [PATCH 1/5] eal: fix build with -O1 Thomas Monjalon
  2018-11-16 16:58 ` [dpdk-stable] [PATCH 2/5] kni: fix possible uninitialized variable Thomas Monjalon
@ 2018-11-16 16:58 ` Thomas Monjalon
  2 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2018-11-16 16:58 UTC (permalink / raw)
  To: dev; +Cc: stable

When compiling with gcc -O1, this error appears:
	drivers/net/mlx4/mlx4_ethdev.c: In function ‘mlx4_rxmode_toggle’:
	rte_log.h:321:3: error:
	‘mode’ may be used uninitialized in this function

The function mlx4_rxmode_toggle is never called with a value which
is not in the switch block, but GCC complains about it with -O1.
So the default case is "fixed" by setting string "undefined".

Fixes: eacaac7bae36 ("net/mlx4: restore promisc and allmulti support")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/net/mlx4/mlx4_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/mlx4/mlx4_ethdev.c b/drivers/net/mlx4/mlx4_ethdev.c
index 30deb3ef0..195a1b6df 100644
--- a/drivers/net/mlx4/mlx4_ethdev.c
+++ b/drivers/net/mlx4/mlx4_ethdev.c
@@ -360,6 +360,8 @@ mlx4_rxmode_toggle(struct rte_eth_dev *dev, enum rxmode_toggle toggle)
 		mode = "all multicast";
 		dev->data->all_multicast = toggle & 1;
 		break;
+	default:
+		mode = "undefined";
 	}
 	if (!mlx4_flow_sync(priv, &error))
 		return;
-- 
2.19.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-16 16:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20181116165854.24017-1-thomas@monjalon.net>
2018-11-16 16:58 ` [dpdk-stable] [PATCH 1/5] eal: fix build with -O1 Thomas Monjalon
2018-11-16 16:58 ` [dpdk-stable] [PATCH 2/5] kni: fix possible uninitialized variable Thomas Monjalon
2018-11-16 16:58 ` [dpdk-stable] [PATCH 3/5] net/mlx4: " Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).