DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] ixgbe: fix icc compile error
@ 2016-03-23 17:45 Ferruh Yigit
  2016-03-23 19:35 ` Stephen Hemminger
  0 siblings, 1 reply; 6+ messages in thread
From: Ferruh Yigit @ 2016-03-23 17:45 UTC (permalink / raw)
  To: dev; +Cc: Ferruh Yigit

Fixes: 06554d381d97 ("ixgbe: speed up non-vector Tx")

icc (icc (ICC) 16.0.1 20151021) is generating following compile error:
"
  CC ixgbe_rxtx.o
  .../drivers/net/ixgbe/ixgbe_rxtx.c(153): error #3656: variable
  "free" may be used before its value is set
                      (nb_free > 0 && m->pool != free[0]->pool)) {
			                         ^
"

Indeed this is a false positive and code is correct.
"nb_free" check prevents the free[] access before its value set.

But the patch is just for compiler to remove compiler error.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 drivers/net/ixgbe/ixgbe_rxtx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index ff6ddb8..ef1a26f 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -128,7 +128,8 @@ ixgbe_tx_free_bufs(struct ixgbe_tx_queue *txq)
 	struct ixgbe_tx_entry *txep;
 	uint32_t status;
 	int i, nb_free = 0;
-	struct rte_mbuf *m, *free[RTE_IXGBE_TX_MAX_FREE_BUF_SZ];
+	struct rte_mbuf *m;
+	struct rte_mbuf *free[RTE_IXGBE_TX_MAX_FREE_BUF_SZ] = {0};
 
 	/* check DD bit on threshold descriptor */
 	status = txq->tx_ring[txq->tx_next_dd].wb.status;
-- 
2.5.0

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

* Re: [dpdk-dev] [PATCH] ixgbe: fix icc compile error
  2016-03-23 17:45 [dpdk-dev] [PATCH] ixgbe: fix icc compile error Ferruh Yigit
@ 2016-03-23 19:35 ` Stephen Hemminger
  2016-03-23 21:26   ` Ferruh Yigit
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2016-03-23 19:35 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev

On Wed, 23 Mar 2016 17:45:58 +0000
Ferruh Yigit <ferruh.yigit@intel.com> wrote:

> Fixes: 06554d381d97 ("ixgbe: speed up non-vector Tx")
> 
> icc (icc (ICC) 16.0.1 20151021) is generating following compile error:
> "
>   CC ixgbe_rxtx.o
>   .../drivers/net/ixgbe/ixgbe_rxtx.c(153): error #3656: variable
>   "free" may be used before its value is set
>                       (nb_free > 0 && m->pool != free[0]->pool)) {
> 			                         ^
> "
> 
> Indeed this is a false positive and code is correct.
> "nb_free" check prevents the free[] access before its value set.
> 
> But the patch is just for compiler to remove compiler error.
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
>  drivers/net/ixgbe/ixgbe_rxtx.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
> index ff6ddb8..ef1a26f 100644
> --- a/drivers/net/ixgbe/ixgbe_rxtx.c
> +++ b/drivers/net/ixgbe/ixgbe_rxtx.c
> @@ -128,7 +128,8 @@ ixgbe_tx_free_bufs(struct ixgbe_tx_queue *txq)
>  	struct ixgbe_tx_entry *txep;
>  	uint32_t status;
>  	int i, nb_free = 0;
> -	struct rte_mbuf *m, *free[RTE_IXGBE_TX_MAX_FREE_BUF_SZ];
> +	struct rte_mbuf *m;
> +	struct rte_mbuf *free[RTE_IXGBE_TX_MAX_FREE_BUF_SZ] = {0};
>  
>  	/* check DD bit on threshold descriptor */
>  	status = txq->tx_ring[txq->tx_next_dd].wb.status;

Although this fixes a compiler bug, it also introduces a performance hit.
The initialization will generate a string instruct (rep; stosz) and this
stalls the multi-execution unit on many Intel CPU's.

Better to add a override to the Makefile (for icc only and with big comment).

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

* Re: [dpdk-dev] [PATCH] ixgbe: fix icc compile error
  2016-03-23 19:35 ` Stephen Hemminger
@ 2016-03-23 21:26   ` Ferruh Yigit
  2016-03-24 17:34     ` [dpdk-dev] [PATCH v2] ixgbe: disable icc compile warning Ferruh Yigit
  0 siblings, 1 reply; 6+ messages in thread
From: Ferruh Yigit @ 2016-03-23 21:26 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev

On 3/23/2016 7:35 PM, Stephen Hemminger wrote:
> On Wed, 23 Mar 2016 17:45:58 +0000
> Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> 
>> Fixes: 06554d381d97 ("ixgbe: speed up non-vector Tx")
>>
>> icc (icc (ICC) 16.0.1 20151021) is generating following compile error:
>> "
>>   CC ixgbe_rxtx.o
>>   .../drivers/net/ixgbe/ixgbe_rxtx.c(153): error #3656: variable
>>   "free" may be used before its value is set
>>                       (nb_free > 0 && m->pool != free[0]->pool)) {
>> 			                         ^
>> "
>>
>> Indeed this is a false positive and code is correct.
>> "nb_free" check prevents the free[] access before its value set.
>>
>> But the patch is just for compiler to remove compiler error.
>>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>> ---
>>  drivers/net/ixgbe/ixgbe_rxtx.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
>> index ff6ddb8..ef1a26f 100644
>> --- a/drivers/net/ixgbe/ixgbe_rxtx.c
>> +++ b/drivers/net/ixgbe/ixgbe_rxtx.c
>> @@ -128,7 +128,8 @@ ixgbe_tx_free_bufs(struct ixgbe_tx_queue *txq)
>>  	struct ixgbe_tx_entry *txep;
>>  	uint32_t status;
>>  	int i, nb_free = 0;
>> -	struct rte_mbuf *m, *free[RTE_IXGBE_TX_MAX_FREE_BUF_SZ];
>> +	struct rte_mbuf *m;
>> +	struct rte_mbuf *free[RTE_IXGBE_TX_MAX_FREE_BUF_SZ] = {0};
>>  
>>  	/* check DD bit on threshold descriptor */
>>  	status = txq->tx_ring[txq->tx_next_dd].wb.status;
> 
> Although this fixes a compiler bug, it also introduces a performance hit.
> The initialization will generate a string instruct (rep; stosz) and this
> stalls the multi-execution unit on many Intel CPU's.
> 
> Better to add a override to the Makefile (for icc only and with big comment).
> 

Thank you for the comment. Konstantin also expressed similar performance
concern related this patch.

Nack for the patch, we will look for different solution.

Regards,
ferruh

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

* [dpdk-dev] [PATCH v2] ixgbe: disable icc compile warning
  2016-03-23 21:26   ` Ferruh Yigit
@ 2016-03-24 17:34     ` Ferruh Yigit
  2016-03-24 17:47       ` Ananyev, Konstantin
  0 siblings, 1 reply; 6+ messages in thread
From: Ferruh Yigit @ 2016-03-24 17:34 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Konstantin Ananyev, Ferruh Yigit

icc (icc (ICC) 16.0.1 20151021) is generating following compile error:
"
  CC ixgbe_rxtx.o
  .../drivers/net/ixgbe/ixgbe_rxtx.c(153): error #3656: variable
  "free" may be used before its value is set
                      (nb_free > 0 && m->pool != free[0]->pool)) {
			                         ^
"

Indeed this is a false positive and code is correct.
"nb_free" check prevents the free[] access before its value set.

Disabling this icc warning (#3656) for file ixgbe_rxtx.c.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 drivers/net/ixgbe/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ixgbe/Makefile b/drivers/net/ixgbe/Makefile
index c032775..50bf51c 100644
--- a/drivers/net/ixgbe/Makefile
+++ b/drivers/net/ixgbe/Makefile
@@ -49,6 +49,8 @@ ifeq ($(CC), icc)
 #
 CFLAGS_BASE_DRIVER = -wd174 -wd593 -wd869 -wd981 -wd2259
 
+CFLAGS_ixgbe_rxtx.o += -wd3656
+
 else ifeq ($(CC), clang)
 #
 # CFLAGS for clang
-- 
2.5.0

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

* Re: [dpdk-dev] [PATCH v2] ixgbe: disable icc compile warning
  2016-03-24 17:34     ` [dpdk-dev] [PATCH v2] ixgbe: disable icc compile warning Ferruh Yigit
@ 2016-03-24 17:47       ` Ananyev, Konstantin
  2016-03-25 13:57         ` Bruce Richardson
  0 siblings, 1 reply; 6+ messages in thread
From: Ananyev, Konstantin @ 2016-03-24 17:47 UTC (permalink / raw)
  To: Yigit, Ferruh, dev; +Cc: Stephen Hemminger

> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Thursday, March 24, 2016 5:35 PM
> To: dev@dpdk.org
> Cc: Stephen Hemminger; Ananyev, Konstantin; Yigit, Ferruh
> Subject: [PATCH v2] ixgbe: disable icc compile warning
> 
> icc (icc (ICC) 16.0.1 20151021) is generating following compile error:
> "
>   CC ixgbe_rxtx.o
>   .../drivers/net/ixgbe/ixgbe_rxtx.c(153): error #3656: variable
>   "free" may be used before its value is set
>                       (nb_free > 0 && m->pool != free[0]->pool)) {
> 			                         ^
> "
> 
> Indeed this is a false positive and code is correct.
> "nb_free" check prevents the free[] access before its value set.
> 
> Disabling this icc warning (#3656) for file ixgbe_rxtx.c.
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
>  drivers/net/ixgbe/Makefile | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/ixgbe/Makefile b/drivers/net/ixgbe/Makefile
> index c032775..50bf51c 100644
> --- a/drivers/net/ixgbe/Makefile
> +++ b/drivers/net/ixgbe/Makefile
> @@ -49,6 +49,8 @@ ifeq ($(CC), icc)
>  #
>  CFLAGS_BASE_DRIVER = -wd174 -wd593 -wd869 -wd981 -wd2259
> 
> +CFLAGS_ixgbe_rxtx.o += -wd3656
> +
>  else ifeq ($(CC), clang)
>  #
>  # CFLAGS for clang
> --

Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

> 2.5.0

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

* Re: [dpdk-dev] [PATCH v2] ixgbe: disable icc compile warning
  2016-03-24 17:47       ` Ananyev, Konstantin
@ 2016-03-25 13:57         ` Bruce Richardson
  0 siblings, 0 replies; 6+ messages in thread
From: Bruce Richardson @ 2016-03-25 13:57 UTC (permalink / raw)
  To: Ananyev, Konstantin; +Cc: Yigit, Ferruh, dev, Stephen Hemminger

On Thu, Mar 24, 2016 at 05:47:21PM +0000, Ananyev, Konstantin wrote:
> > -----Original Message-----
> > From: Yigit, Ferruh
> > Sent: Thursday, March 24, 2016 5:35 PM
> > To: dev@dpdk.org
> > Cc: Stephen Hemminger; Ananyev, Konstantin; Yigit, Ferruh
> > Subject: [PATCH v2] ixgbe: disable icc compile warning
> > 
> > icc (icc (ICC) 16.0.1 20151021) is generating following compile error:
> > "
> >   CC ixgbe_rxtx.o
> >   .../drivers/net/ixgbe/ixgbe_rxtx.c(153): error #3656: variable
> >   "free" may be used before its value is set
> >                       (nb_free > 0 && m->pool != free[0]->pool)) {
> > 			                         ^
> > "
> > 
> > Indeed this is a false positive and code is correct.
> > "nb_free" check prevents the free[] access before its value set.
> > 
> > Disabling this icc warning (#3656) for file ixgbe_rxtx.c.
> > 
> > Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > ---
> >  drivers/net/ixgbe/Makefile | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/net/ixgbe/Makefile b/drivers/net/ixgbe/Makefile
> > index c032775..50bf51c 100644
> > --- a/drivers/net/ixgbe/Makefile
> > +++ b/drivers/net/ixgbe/Makefile
> > @@ -49,6 +49,8 @@ ifeq ($(CC), icc)
> >  #
> >  CFLAGS_BASE_DRIVER = -wd174 -wd593 -wd869 -wd981 -wd2259
> > 
> > +CFLAGS_ixgbe_rxtx.o += -wd3656
> > +
> >  else ifeq ($(CC), clang)
> >  #
> >  # CFLAGS for clang
> > --
> 
> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
>
Applied to dpdk-next-net/rel_16_04

/Bruce

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

end of thread, other threads:[~2016-03-25 13:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-23 17:45 [dpdk-dev] [PATCH] ixgbe: fix icc compile error Ferruh Yigit
2016-03-23 19:35 ` Stephen Hemminger
2016-03-23 21:26   ` Ferruh Yigit
2016-03-24 17:34     ` [dpdk-dev] [PATCH v2] ixgbe: disable icc compile warning Ferruh Yigit
2016-03-24 17:47       ` Ananyev, Konstantin
2016-03-25 13:57         ` Bruce Richardson

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).