* [dpdk-dev] [PATCH] test: Disable strict-aliasing warnings
@ 2015-03-26 19:17 Pablo de Lara
2015-03-27 8:41 ` Qiu, Michael
` (4 more replies)
0 siblings, 5 replies; 17+ messages in thread
From: Pablo de Lara @ 2015-03-26 19:17 UTC (permalink / raw)
To: dev
DPDK does not build on gcc 4.4, as it complains due to
strict-aliasing rules in virtual_pmd and link_bonding_mode4 tests,
with no errors in next gcc versions:
CC virtual_pmd.o
CC test_link_bonding_mode4.o
cc1: warnings being treated as errors
/root/dpdk/app/test/test_link_bonding_mode4.c: In function ‘test_mode4_expired’:
/root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:645: error: dereferencing pointer ‘pkt.409’ does break strict-aliasing rules
/root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:729: error: dereferencing pointer ‘pkt.409’ does break strict-aliasing rules
...
cc1: warnings being treated as errors
/root/dpdk/app/test/virtual_pmd.c: In function ‘virtual_ethdev_stats_reset’:
/root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:645: error: dereferencing pointer ‘pkt.338’ does break strict-aliasing rules
/root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:729: error: dereferencing pointer ‘pkt.338’ does break strict-aliasing rules
This patch fixes the compilation by disabling
these warnings.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
app/test/Makefile | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/app/test/Makefile b/app/test/Makefile
index 4aca77c..0d62d07 100644
--- a/app/test/Makefile
+++ b/app/test/Makefile
@@ -158,6 +158,11 @@ CFLAGS_test_memcpy_perf.o += -fno-var-tracking-assignments
endif
endif
+# Disable warnings of no-strict-aliasing in virtual_pmd
+# and test_link_bonding_mode4 tests
+CFLAGS_virtual_pmd.o += -Wno-strict-aliasing
+CFLAGS_test_link_bonding_mode4.o += -Wno-strict-aliasing
+
# this application needs libraries first
DEPDIRS-y += lib
--
1.7.4.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [dpdk-dev] [PATCH] test: Disable strict-aliasing warnings
2015-03-26 19:17 [dpdk-dev] [PATCH] test: Disable strict-aliasing warnings Pablo de Lara
@ 2015-03-27 8:41 ` Qiu, Michael
2015-03-27 8:57 ` De Lara Guarch, Pablo
2015-03-27 9:20 ` Thomas Monjalon
` (3 subsequent siblings)
4 siblings, 1 reply; 17+ messages in thread
From: Qiu, Michael @ 2015-03-27 8:41 UTC (permalink / raw)
To: De Lara Guarch, Pablo, dev
On 3/27/2015 3:18 AM, Pablo de Lara wrote:
> DPDK does not build on gcc 4.4, as it complains due to
Why? Will gcc 4.4 not supported?
Thanks,
Michael
> strict-aliasing rules in virtual_pmd and link_bonding_mode4 tests,
> with no errors in next gcc versions:
>
> CC virtual_pmd.o
> CC test_link_bonding_mode4.o
> cc1: warnings being treated as errors
> /root/dpdk/app/test/test_link_bonding_mode4.c: In function ‘test_mode4_expired’:
> /root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:645: error: dereferencing pointer ‘pkt.409’ does break strict-aliasing rules
> /root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:729: error: dereferencing pointer ‘pkt.409’ does break strict-aliasing rules
> ...
> cc1: warnings being treated as errors
> /root/dpdk/app/test/virtual_pmd.c: In function ‘virtual_ethdev_stats_reset’:
> /root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:645: error: dereferencing pointer ‘pkt.338’ does break strict-aliasing rules
> /root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:729: error: dereferencing pointer ‘pkt.338’ does break strict-aliasing rules
>
> This patch fixes the compilation by disabling
> these warnings.
>
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> ---
> app/test/Makefile | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/app/test/Makefile b/app/test/Makefile
> index 4aca77c..0d62d07 100644
> --- a/app/test/Makefile
> +++ b/app/test/Makefile
> @@ -158,6 +158,11 @@ CFLAGS_test_memcpy_perf.o += -fno-var-tracking-assignments
> endif
> endif
>
> +# Disable warnings of no-strict-aliasing in virtual_pmd
> +# and test_link_bonding_mode4 tests
> +CFLAGS_virtual_pmd.o += -Wno-strict-aliasing
> +CFLAGS_test_link_bonding_mode4.o += -Wno-strict-aliasing
> +
> # this application needs libraries first
> DEPDIRS-y += lib
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [dpdk-dev] [PATCH] test: Disable strict-aliasing warnings
2015-03-27 8:41 ` Qiu, Michael
@ 2015-03-27 8:57 ` De Lara Guarch, Pablo
0 siblings, 0 replies; 17+ messages in thread
From: De Lara Guarch, Pablo @ 2015-03-27 8:57 UTC (permalink / raw)
To: Qiu, Michael, dev
> -----Original Message-----
> From: Qiu, Michael
> Sent: Friday, March 27, 2015 8:41 AM
> To: De Lara Guarch, Pablo; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] test: Disable strict-aliasing warnings
>
> On 3/27/2015 3:18 AM, Pablo de Lara wrote:
> > DPDK does not build on gcc 4.4, as it complains due to
>
> Why? Will gcc 4.4 not supported?
Afaik, we still support gcc 4.4, since it is part of RHEL 6.5.
Thanks,
Pablo
>
> Thanks,
> Michael
> > strict-aliasing rules in virtual_pmd and link_bonding_mode4 tests,
> > with no errors in next gcc versions:
> >
> > CC virtual_pmd.o
> > CC test_link_bonding_mode4.o
> > cc1: warnings being treated as errors
> > /root/dpdk/app/test/test_link_bonding_mode4.c: In function
> 'test_mode4_expired':
> > /root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:645: error:
> dereferencing pointer 'pkt.409' does break strict-aliasing rules
> > /root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:729: error:
> dereferencing pointer 'pkt.409' does break strict-aliasing rules
> > ...
> > cc1: warnings being treated as errors
> > /root/dpdk/app/test/virtual_pmd.c: In function
> 'virtual_ethdev_stats_reset':
> > /root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:645: error:
> dereferencing pointer 'pkt.338' does break strict-aliasing rules
> > /root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:729: error:
> dereferencing pointer 'pkt.338' does break strict-aliasing rules
> >
> > This patch fixes the compilation by disabling
> > these warnings.
> >
> > Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> > ---
> > app/test/Makefile | 5 +++++
> > 1 files changed, 5 insertions(+), 0 deletions(-)
> >
> > diff --git a/app/test/Makefile b/app/test/Makefile
> > index 4aca77c..0d62d07 100644
> > --- a/app/test/Makefile
> > +++ b/app/test/Makefile
> > @@ -158,6 +158,11 @@ CFLAGS_test_memcpy_perf.o += -fno-var-
> tracking-assignments
> > endif
> > endif
> >
> > +# Disable warnings of no-strict-aliasing in virtual_pmd
> > +# and test_link_bonding_mode4 tests
> > +CFLAGS_virtual_pmd.o += -Wno-strict-aliasing
> > +CFLAGS_test_link_bonding_mode4.o += -Wno-strict-aliasing
> > +
> > # this application needs libraries first
> > DEPDIRS-y += lib
> >
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [dpdk-dev] [PATCH] test: Disable strict-aliasing warnings
2015-03-26 19:17 [dpdk-dev] [PATCH] test: Disable strict-aliasing warnings Pablo de Lara
2015-03-27 8:41 ` Qiu, Michael
@ 2015-03-27 9:20 ` Thomas Monjalon
2015-03-27 9:29 ` De Lara Guarch, Pablo
2015-03-27 10:55 ` [dpdk-dev] [PATCH v2 0/2] test: fix strict aliasing rule errors in gcc 4.4 Pawel Wodkowski
` (2 subsequent siblings)
4 siblings, 1 reply; 17+ messages in thread
From: Thomas Monjalon @ 2015-03-27 9:20 UTC (permalink / raw)
To: Pablo de Lara; +Cc: dev
2015-03-26 19:17, Pablo de Lara:
> DPDK does not build on gcc 4.4, as it complains due to
> strict-aliasing rules in virtual_pmd and link_bonding_mode4 tests,
> with no errors in next gcc versions:
Do you mean it's not possible to fix it in the code?
You are disabling some checks which may be relevant.
> CC virtual_pmd.o
> CC test_link_bonding_mode4.o
> cc1: warnings being treated as errors
> /root/dpdk/app/test/test_link_bonding_mode4.c: In function ‘test_mode4_expired’:
> /root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:645: error: dereferencing pointer ‘pkt.409’ does break strict-aliasing rules
> /root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:729: error: dereferencing pointer ‘pkt.409’ does break strict-aliasing rules
> ...
> cc1: warnings being treated as errors
> /root/dpdk/app/test/virtual_pmd.c: In function ‘virtual_ethdev_stats_reset’:
> /root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:645: error: dereferencing pointer ‘pkt.338’ does break strict-aliasing rules
> /root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:729: error: dereferencing pointer ‘pkt.338’ does break strict-aliasing rules
>
> This patch fixes the compilation by disabling
> these warnings.
>
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> ---
> app/test/Makefile | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/app/test/Makefile b/app/test/Makefile
> index 4aca77c..0d62d07 100644
> --- a/app/test/Makefile
> +++ b/app/test/Makefile
> @@ -158,6 +158,11 @@ CFLAGS_test_memcpy_perf.o += -fno-var-tracking-assignments
> endif
> endif
>
> +# Disable warnings of no-strict-aliasing in virtual_pmd
> +# and test_link_bonding_mode4 tests
> +CFLAGS_virtual_pmd.o += -Wno-strict-aliasing
> +CFLAGS_test_link_bonding_mode4.o += -Wno-strict-aliasing
> +
> # this application needs libraries first
> DEPDIRS-y += lib
>
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [dpdk-dev] [PATCH] test: Disable strict-aliasing warnings
2015-03-27 9:20 ` Thomas Monjalon
@ 2015-03-27 9:29 ` De Lara Guarch, Pablo
2015-03-27 10:00 ` Thomas Monjalon
0 siblings, 1 reply; 17+ messages in thread
From: De Lara Guarch, Pablo @ 2015-03-27 9:29 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Friday, March 27, 2015 9:20 AM
> To: De Lara Guarch, Pablo
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] test: Disable strict-aliasing warnings
>
> 2015-03-26 19:17, Pablo de Lara:
> > DPDK does not build on gcc 4.4, as it complains due to
> > strict-aliasing rules in virtual_pmd and link_bonding_mode4 tests,
> > with no errors in next gcc versions:
>
> Do you mean it's not possible to fix it in the code?
> You are disabling some checks which may be relevant.
I mean it is possible to fix, but probably not worth it, considering that
newer gcc versions have no issues (and gcc 4.4 is from 2011).
I have seen that there are other libraries that disable these warnings as well,
so I assumed we could do the same here.
Pablo
>
> > CC virtual_pmd.o
> > CC test_link_bonding_mode4.o
> > cc1: warnings being treated as errors
> > /root/dpdk/app/test/test_link_bonding_mode4.c: In function
> ‘test_mode4_expired’:
> > /root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:645: error:
> dereferencing pointer ‘pkt.409’ does break strict-aliasing rules
> > /root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:729: error:
> dereferencing pointer ‘pkt.409’ does break strict-aliasing rules
> > ...
> > cc1: warnings being treated as errors
> > /root/dpdk/app/test/virtual_pmd.c: In function
> ‘virtual_ethdev_stats_reset’:
> > /root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:645: error:
> dereferencing pointer ‘pkt.338’ does break strict-aliasing rules
> > /root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:729: error:
> dereferencing pointer ‘pkt.338’ does break strict-aliasing rules
> >
> > This patch fixes the compilation by disabling
> > these warnings.
> >
> > Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> > ---
> > app/test/Makefile | 5 +++++
> > 1 files changed, 5 insertions(+), 0 deletions(-)
> >
> > diff --git a/app/test/Makefile b/app/test/Makefile
> > index 4aca77c..0d62d07 100644
> > --- a/app/test/Makefile
> > +++ b/app/test/Makefile
> > @@ -158,6 +158,11 @@ CFLAGS_test_memcpy_perf.o += -fno-var-
> tracking-assignments
> > endif
> > endif
> >
> > +# Disable warnings of no-strict-aliasing in virtual_pmd
> > +# and test_link_bonding_mode4 tests
> > +CFLAGS_virtual_pmd.o += -Wno-strict-aliasing
> > +CFLAGS_test_link_bonding_mode4.o += -Wno-strict-aliasing
> > +
> > # this application needs libraries first
> > DEPDIRS-y += lib
> >
> >
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [dpdk-dev] [PATCH] test: Disable strict-aliasing warnings
2015-03-27 9:29 ` De Lara Guarch, Pablo
@ 2015-03-27 10:00 ` Thomas Monjalon
2015-03-27 10:11 ` De Lara Guarch, Pablo
0 siblings, 1 reply; 17+ messages in thread
From: Thomas Monjalon @ 2015-03-27 10:00 UTC (permalink / raw)
To: De Lara Guarch, Pablo; +Cc: dev
2015-03-27 09:29, De Lara Guarch, Pablo:
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> > 2015-03-26 19:17, Pablo de Lara:
> > > DPDK does not build on gcc 4.4, as it complains due to
> > > strict-aliasing rules in virtual_pmd and link_bonding_mode4 tests,
> > > with no errors in next gcc versions:
> >
> > Do you mean it's not possible to fix it in the code?
> > You are disabling some checks which may be relevant.
>
> I mean it is possible to fix, but probably not worth it, considering that
> newer gcc versions have no issues (and gcc 4.4 is from 2011).
> I have seen that there are other libraries that disable these warnings as well,
> so I assumed we could do the same here.
It is preferred to avoid doing it.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [dpdk-dev] [PATCH] test: Disable strict-aliasing warnings
2015-03-27 10:00 ` Thomas Monjalon
@ 2015-03-27 10:11 ` De Lara Guarch, Pablo
2015-03-30 11:11 ` De Lara Guarch, Pablo
0 siblings, 1 reply; 17+ messages in thread
From: De Lara Guarch, Pablo @ 2015-03-27 10:11 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon
> Sent: Friday, March 27, 2015 10:01 AM
> To: De Lara Guarch, Pablo
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] test: Disable strict-aliasing warnings
>
> 2015-03-27 09:29, De Lara Guarch, Pablo:
> > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> > > 2015-03-26 19:17, Pablo de Lara:
> > > > DPDK does not build on gcc 4.4, as it complains due to
> > > > strict-aliasing rules in virtual_pmd and link_bonding_mode4 tests,
> > > > with no errors in next gcc versions:
> > >
> > > Do you mean it's not possible to fix it in the code?
> > > You are disabling some checks which may be relevant.
> >
> > I mean it is possible to fix, but probably not worth it, considering that
> > newer gcc versions have no issues (and gcc 4.4 is from 2011).
> > I have seen that there are other libraries that disable these warnings as
> well,
> > so I assumed we could do the same here.
>
> It is preferred to avoid doing it.
Actually, I just realized that I missed checking the gcc version, so I was disabling the warnings in all versions.
I can send a v2 with that check, so we will still take into account those warnings for newer versions,
and just ignore it in gcc 4.4.
Thanks,
Pablo
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH v2 0/2] test: fix strict aliasing rule errors in gcc 4.4
2015-03-26 19:17 [dpdk-dev] [PATCH] test: Disable strict-aliasing warnings Pablo de Lara
2015-03-27 8:41 ` Qiu, Michael
2015-03-27 9:20 ` Thomas Monjalon
@ 2015-03-27 10:55 ` Pawel Wodkowski
2015-03-27 10:56 ` [dpdk-dev] [PATCH v2 1/2] test: fix strict aliasing rule error in virtual pmd Pawel Wodkowski
` (2 more replies)
2015-03-27 15:46 ` [dpdk-dev] [PATCH] test: Disable strict-aliasing warnings Stephen Hemminger
2015-03-30 11:06 ` [dpdk-dev] [PATCH v2] DPDK does not build on gcc 4.4, as it complains due to strict-aliasing rules in virtual_pmd and link_bonding_mode4 tests, with no errors in next gcc versions: Pablo de Lara
4 siblings, 3 replies; 17+ messages in thread
From: Pawel Wodkowski @ 2015-03-27 10:55 UTC (permalink / raw)
To: dev
Fix strict aliasing rule error seen in gcc 4.4 in virtual pmd and mode 4 link
bonding mode 4 test.
changes v2:
- fix error in code instead disabling compiler warning.
Pawel Wodkowski (2):
test: fix strict aliasing rule error in virtual pmd
test: fix strict aliasing rule error in link bonding mode 4 test
app/test/test_link_bonding_mode4.c | 5 +++--
app/test/virtual_pmd.c | 10 +++++-----
2 files changed, 8 insertions(+), 7 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH v2 1/2] test: fix strict aliasing rule error in virtual pmd
2015-03-27 10:55 ` [dpdk-dev] [PATCH v2 0/2] test: fix strict aliasing rule errors in gcc 4.4 Pawel Wodkowski
@ 2015-03-27 10:56 ` Pawel Wodkowski
2015-03-27 15:47 ` Stephen Hemminger
2015-03-27 10:56 ` [dpdk-dev] [PATCH v2 2/2] test: fix strict aliasing rule error in link bonding mode 4 test Pawel Wodkowski
2015-03-30 20:48 ` [dpdk-dev] [PATCH v2 0/2] test: fix strict aliasing rule errors in gcc 4.4 Thomas Monjalon
2 siblings, 1 reply; 17+ messages in thread
From: Pawel Wodkowski @ 2015-03-27 10:56 UTC (permalink / raw)
To: dev
Fix strict aliasing rule error seen in gcc 4.4
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
---
app/test/virtual_pmd.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c
index 9b07ab1..f163562 100644
--- a/app/test/virtual_pmd.c
+++ b/app/test/virtual_pmd.c
@@ -75,15 +75,15 @@ virtual_ethdev_start_fail(struct rte_eth_dev *eth_dev __rte_unused)
}
static void virtual_ethdev_stop(struct rte_eth_dev *eth_dev __rte_unused)
{
- struct rte_mbuf *pkt = NULL;
+ void *pkt = NULL;
struct virtual_ethdev_private *prv = eth_dev->data->dev_private;
eth_dev->data->dev_link.link_status = 0;
eth_dev->data->dev_started = 0;
- while (rte_ring_dequeue(prv->rx_queue, (void **)&pkt) != -ENOENT)
+ while (rte_ring_dequeue(prv->rx_queue, &pkt) != -ENOENT)
rte_pktmbuf_free(pkt);
- while (rte_ring_dequeue(prv->tx_queue, (void **)&pkt) != -ENOENT)
+ while (rte_ring_dequeue(prv->tx_queue, &pkt) != -ENOENT)
rte_pktmbuf_free(pkt);
}
@@ -223,9 +223,9 @@ static void
virtual_ethdev_stats_reset(struct rte_eth_dev *dev)
{
struct virtual_ethdev_private *dev_private = dev->data->dev_private;
- struct rte_mbuf *pkt = NULL;
+ void *pkt = NULL;
- while (rte_ring_dequeue(dev_private->tx_queue, (void **)&pkt) == -ENOBUFS)
+ while (rte_ring_dequeue(dev_private->tx_queue, &pkt) == -ENOBUFS)
rte_pktmbuf_free(pkt);
/* Reset internal statistics */
--
1.9.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH v2 2/2] test: fix strict aliasing rule error in link bonding mode 4 test
2015-03-27 10:55 ` [dpdk-dev] [PATCH v2 0/2] test: fix strict aliasing rule errors in gcc 4.4 Pawel Wodkowski
2015-03-27 10:56 ` [dpdk-dev] [PATCH v2 1/2] test: fix strict aliasing rule error in virtual pmd Pawel Wodkowski
@ 2015-03-27 10:56 ` Pawel Wodkowski
2015-03-30 20:48 ` [dpdk-dev] [PATCH v2 0/2] test: fix strict aliasing rule errors in gcc 4.4 Thomas Monjalon
2 siblings, 0 replies; 17+ messages in thread
From: Pawel Wodkowski @ 2015-03-27 10:56 UTC (permalink / raw)
To: dev
Fix strict aliasing rule error seen in gcc 4.4
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
---
app/test/test_link_bonding_mode4.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/app/test/test_link_bonding_mode4.c b/app/test/test_link_bonding_mode4.c
index c35129f..02380f9 100644
--- a/app/test/test_link_bonding_mode4.c
+++ b/app/test/test_link_bonding_mode4.c
@@ -1181,7 +1181,6 @@ test_mode4_expired(void)
{
struct slave_conf *slave, *exp_slave = NULL;
struct rte_mbuf *pkts[MAX_PKT_BURST];
- struct rte_mbuf *pkt = NULL;
int retval;
uint32_t old_delay;
@@ -1239,7 +1238,9 @@ test_mode4_expired(void)
/* Remove replay for slave that supose to be expired. */
if (slave == exp_slave) {
while (rte_ring_count(slave->rx_queue) > 0) {
- rte_ring_dequeue(slave->rx_queue, (void **)&pkt);
+ void *pkt = NULL;
+
+ rte_ring_dequeue(slave->rx_queue, &pkt);
rte_pktmbuf_free(pkt);
}
}
--
1.9.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [dpdk-dev] [PATCH] test: Disable strict-aliasing warnings
2015-03-26 19:17 [dpdk-dev] [PATCH] test: Disable strict-aliasing warnings Pablo de Lara
` (2 preceding siblings ...)
2015-03-27 10:55 ` [dpdk-dev] [PATCH v2 0/2] test: fix strict aliasing rule errors in gcc 4.4 Pawel Wodkowski
@ 2015-03-27 15:46 ` Stephen Hemminger
2015-03-27 15:48 ` De Lara Guarch, Pablo
2015-03-30 11:06 ` [dpdk-dev] [PATCH v2] DPDK does not build on gcc 4.4, as it complains due to strict-aliasing rules in virtual_pmd and link_bonding_mode4 tests, with no errors in next gcc versions: Pablo de Lara
4 siblings, 1 reply; 17+ messages in thread
From: Stephen Hemminger @ 2015-03-27 15:46 UTC (permalink / raw)
To: Pablo de Lara; +Cc: dev
On Thu, 26 Mar 2015 19:17:35 +0000
Pablo de Lara <pablo.de.lara.guarch@intel.com> wrote:
> +# Disable warnings of no-strict-aliasing in virtual_pmd
> +# and test_link_bonding_mode4 tests
> +CFLAGS_virtual_pmd.o += -Wno-strict-aliasing
> +CFLAGS_test_link_bonding_mode4.o += -Wno-strict-aliasing
> +
>
There is a way to do it only for a specific (broken)
Gcc version using if's
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [dpdk-dev] [PATCH v2 1/2] test: fix strict aliasing rule error in virtual pmd
2015-03-27 10:56 ` [dpdk-dev] [PATCH v2 1/2] test: fix strict aliasing rule error in virtual pmd Pawel Wodkowski
@ 2015-03-27 15:47 ` Stephen Hemminger
0 siblings, 0 replies; 17+ messages in thread
From: Stephen Hemminger @ 2015-03-27 15:47 UTC (permalink / raw)
To: Pawel Wodkowski; +Cc: dev
On Fri, 27 Mar 2015 11:56:00 +0100
Pawel Wodkowski <pawelx.wodkowski@intel.com> wrote:
> Fix strict aliasing rule error seen in gcc 4.4
>
> Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
> ---
> app/test/virtual_pmd.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c
> index 9b07ab1..f163562 100644
> --- a/app/test/virtual_pmd.c
> +++ b/app/test/virtual_pmd.c
> @@ -75,15 +75,15 @@ virtual_ethdev_start_fail(struct rte_eth_dev *eth_dev __rte_unused)
> }
> static void virtual_ethdev_stop(struct rte_eth_dev *eth_dev __rte_unused)
> {
> - struct rte_mbuf *pkt = NULL;
> + void *pkt = NULL;
> struct virtual_ethdev_private *prv = eth_dev->data->dev_private;
>
> eth_dev->data->dev_link.link_status = 0;
> eth_dev->data->dev_started = 0;
> - while (rte_ring_dequeue(prv->rx_queue, (void **)&pkt) != -ENOENT)
> + while (rte_ring_dequeue(prv->rx_queue, &pkt) != -ENOENT)
> rte_pktmbuf_free(pkt);
>
> - while (rte_ring_dequeue(prv->tx_queue, (void **)&pkt) != -ENOENT)
> + while (rte_ring_dequeue(prv->tx_queue, &pkt) != -ENOENT)
> rte_pktmbuf_free(pkt);
> }
Losing type information doesn't make this better!
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [dpdk-dev] [PATCH] test: Disable strict-aliasing warnings
2015-03-27 15:46 ` [dpdk-dev] [PATCH] test: Disable strict-aliasing warnings Stephen Hemminger
@ 2015-03-27 15:48 ` De Lara Guarch, Pablo
0 siblings, 0 replies; 17+ messages in thread
From: De Lara Guarch, Pablo @ 2015-03-27 15:48 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev
> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Friday, March 27, 2015 3:46 PM
> To: De Lara Guarch, Pablo
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] test: Disable strict-aliasing warnings
>
> On Thu, 26 Mar 2015 19:17:35 +0000
> Pablo de Lara <pablo.de.lara.guarch@intel.com> wrote:
>
> > +# Disable warnings of no-strict-aliasing in virtual_pmd
> > +# and test_link_bonding_mode4 tests
> > +CFLAGS_virtual_pmd.o += -Wno-strict-aliasing
> > +CFLAGS_test_link_bonding_mode4.o += -Wno-strict-aliasing
> > +
> >
>
> There is a way to do it only for a specific (broken)
> Gcc version using if's
I know, I sent another email, saying that I missed an if to check the gcc version.
Anyway, Pawel has sent another patch to fix the issue.
Not sure which fix the community prefers.
Thanks,
Pablo
^ permalink raw reply [flat|nested] 17+ messages in thread
* [dpdk-dev] [PATCH v2] DPDK does not build on gcc 4.4, as it complains due to strict-aliasing rules in virtual_pmd and link_bonding_mode4 tests, with no errors in next gcc versions:
2015-03-26 19:17 [dpdk-dev] [PATCH] test: Disable strict-aliasing warnings Pablo de Lara
` (3 preceding siblings ...)
2015-03-27 15:46 ` [dpdk-dev] [PATCH] test: Disable strict-aliasing warnings Stephen Hemminger
@ 2015-03-30 11:06 ` Pablo de Lara
2015-03-30 20:47 ` Thomas Monjalon
4 siblings, 1 reply; 17+ messages in thread
From: Pablo de Lara @ 2015-03-30 11:06 UTC (permalink / raw)
To: dev
CC virtual_pmd.o
CC test_link_bonding_mode4.o
cc1: warnings being treated as errors
/root/dpdk/app/test/test_link_bonding_mode4.c: In function ‘test_mode4_expired’:
/root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:645: error: dereferencing pointer ‘pkt.409’ does break strict-aliasing rules
/root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:729: error: dereferencing pointer ‘pkt.409’ does break strict-aliasing rules
...
cc1: warnings being treated as errors
/root/dpdk/app/test/virtual_pmd.c: In function ‘virtual_ethdev_stats_reset’:
/root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:645: error: dereferencing pointer ‘pkt.338’ does break strict-aliasing rules
/root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:729: error: dereferencing pointer ‘pkt.338’ does break strict-aliasing rules
This patch fixes the compilation by disabling
these warnings.
Changes in v2:
Added missing gcc version check (checking if gcc 4.4 is present)
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
app/test/Makefile | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/app/test/Makefile b/app/test/Makefile
index 4aca77c..9639a71 100644
--- a/app/test/Makefile
+++ b/app/test/Makefile
@@ -158,6 +158,15 @@ CFLAGS_test_memcpy_perf.o += -fno-var-tracking-assignments
endif
endif
+# Disable warnings of no-strict-aliasing in virtual_pmd
+# and test_link_bonding_mode4 tests
+ifeq ($(CC), gcc)
+ifeq ($(shell test $(GCC_VERSION) -eq 44 && echo 1), 1)
+CFLAGS_virtual_pmd.o += -Wno-strict-aliasing
+CFLAGS_test_link_bonding_mode4.o += -Wno-strict-aliasing
+endif
+endif
+
# this application needs libraries first
DEPDIRS-y += lib
--
1.7.4.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [dpdk-dev] [PATCH] test: Disable strict-aliasing warnings
2015-03-27 10:11 ` De Lara Guarch, Pablo
@ 2015-03-30 11:11 ` De Lara Guarch, Pablo
0 siblings, 0 replies; 17+ messages in thread
From: De Lara Guarch, Pablo @ 2015-03-30 11:11 UTC (permalink / raw)
To: 'Thomas Monjalon'; +Cc: 'dev@dpdk.org'
> -----Original Message-----
> From: De Lara Guarch, Pablo
> Sent: Friday, March 27, 2015 10:11 AM
> To: Thomas Monjalon
> Cc: dev@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH] test: Disable strict-aliasing warnings
>
>
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon
> > Sent: Friday, March 27, 2015 10:01 AM
> > To: De Lara Guarch, Pablo
> > Cc: dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH] test: Disable strict-aliasing warnings
> >
> > 2015-03-27 09:29, De Lara Guarch, Pablo:
> > > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> > > > 2015-03-26 19:17, Pablo de Lara:
> > > > > DPDK does not build on gcc 4.4, as it complains due to
> > > > > strict-aliasing rules in virtual_pmd and link_bonding_mode4 tests,
> > > > > with no errors in next gcc versions:
> > > >
> > > > Do you mean it's not possible to fix it in the code?
> > > > You are disabling some checks which may be relevant.
> > >
> > > I mean it is possible to fix, but probably not worth it, considering that
> > > newer gcc versions have no issues (and gcc 4.4 is from 2011).
> > > I have seen that there are other libraries that disable these warnings as
> > well,
> > > so I assumed we could do the same here.
> >
> > It is preferred to avoid doing it.
>
> Actually, I just realized that I missed checking the gcc version, so I was
> disabling the warnings in all versions.
> I can send a v2 with that check, so we will still take into account those
> warnings for newer versions,
> and just ignore it in gcc 4.4.
I just sent a v2 of this patch. Pawel also sent another fix for this issue,
but Stephen had some concerns about it, so I just sent a v2 as an alternative,
so the community can decide between the two options.
>
> Thanks,
> Pablo
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [dpdk-dev] [PATCH v2] DPDK does not build on gcc 4.4, as it complains due to strict-aliasing rules in virtual_pmd and link_bonding_mode4 tests, with no errors in next gcc versions:
2015-03-30 11:06 ` [dpdk-dev] [PATCH v2] DPDK does not build on gcc 4.4, as it complains due to strict-aliasing rules in virtual_pmd and link_bonding_mode4 tests, with no errors in next gcc versions: Pablo de Lara
@ 2015-03-30 20:47 ` Thomas Monjalon
0 siblings, 0 replies; 17+ messages in thread
From: Thomas Monjalon @ 2015-03-30 20:47 UTC (permalink / raw)
To: Pablo de Lara; +Cc: dev
2015-03-30 12:06, Pablo de Lara:
> CC virtual_pmd.o
> CC test_link_bonding_mode4.o
> cc1: warnings being treated as errors
> /root/dpdk/app/test/test_link_bonding_mode4.c: In function ‘test_mode4_expired’:
> /root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:645: error: dereferencing pointer ‘pkt.409’ does break strict-aliasing rules
> /root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:729: error: dereferencing pointer ‘pkt.409’ does break strict-aliasing rules
> ...
> cc1: warnings being treated as errors
> /root/dpdk/app/test/virtual_pmd.c: In function ‘virtual_ethdev_stats_reset’:
> /root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:645: error: dereferencing pointer ‘pkt.338’ does break strict-aliasing rules
> /root/dpdk/x86_64-native-linuxapp-gcc/include/rte_ring.h:729: error: dereferencing pointer ‘pkt.338’ does break strict-aliasing rules
>
> This patch fixes the compilation by disabling
> these warnings.
>
> Changes in v2:
>
> Added missing gcc version check (checking if gcc 4.4 is present)
>
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Pawel's proposal was chosen because it doesn't require handling special
compiler version.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [dpdk-dev] [PATCH v2 0/2] test: fix strict aliasing rule errors in gcc 4.4
2015-03-27 10:55 ` [dpdk-dev] [PATCH v2 0/2] test: fix strict aliasing rule errors in gcc 4.4 Pawel Wodkowski
2015-03-27 10:56 ` [dpdk-dev] [PATCH v2 1/2] test: fix strict aliasing rule error in virtual pmd Pawel Wodkowski
2015-03-27 10:56 ` [dpdk-dev] [PATCH v2 2/2] test: fix strict aliasing rule error in link bonding mode 4 test Pawel Wodkowski
@ 2015-03-30 20:48 ` Thomas Monjalon
2 siblings, 0 replies; 17+ messages in thread
From: Thomas Monjalon @ 2015-03-30 20:48 UTC (permalink / raw)
To: Pawel Wodkowski; +Cc: dev
2015-03-27 11:55, Pawel Wodkowski:
> Fix strict aliasing rule error seen in gcc 4.4 in virtual pmd and mode 4 link
> bonding mode 4 test.
>
> changes v2:
> - fix error in code instead disabling compiler warning.
>
> Pawel Wodkowski (2):
> test: fix strict aliasing rule error in virtual pmd
> test: fix strict aliasing rule error in link bonding mode 4 test
>
> app/test/test_link_bonding_mode4.c | 5 +++--
> app/test/virtual_pmd.c | 10 +++++-----
> 2 files changed, 8 insertions(+), 7 deletions(-)
Applied, thanks
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2015-03-30 20:49 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-26 19:17 [dpdk-dev] [PATCH] test: Disable strict-aliasing warnings Pablo de Lara
2015-03-27 8:41 ` Qiu, Michael
2015-03-27 8:57 ` De Lara Guarch, Pablo
2015-03-27 9:20 ` Thomas Monjalon
2015-03-27 9:29 ` De Lara Guarch, Pablo
2015-03-27 10:00 ` Thomas Monjalon
2015-03-27 10:11 ` De Lara Guarch, Pablo
2015-03-30 11:11 ` De Lara Guarch, Pablo
2015-03-27 10:55 ` [dpdk-dev] [PATCH v2 0/2] test: fix strict aliasing rule errors in gcc 4.4 Pawel Wodkowski
2015-03-27 10:56 ` [dpdk-dev] [PATCH v2 1/2] test: fix strict aliasing rule error in virtual pmd Pawel Wodkowski
2015-03-27 15:47 ` Stephen Hemminger
2015-03-27 10:56 ` [dpdk-dev] [PATCH v2 2/2] test: fix strict aliasing rule error in link bonding mode 4 test Pawel Wodkowski
2015-03-30 20:48 ` [dpdk-dev] [PATCH v2 0/2] test: fix strict aliasing rule errors in gcc 4.4 Thomas Monjalon
2015-03-27 15:46 ` [dpdk-dev] [PATCH] test: Disable strict-aliasing warnings Stephen Hemminger
2015-03-27 15:48 ` De Lara Guarch, Pablo
2015-03-30 11:06 ` [dpdk-dev] [PATCH v2] DPDK does not build on gcc 4.4, as it complains due to strict-aliasing rules in virtual_pmd and link_bonding_mode4 tests, with no errors in next gcc versions: Pablo de Lara
2015-03-30 20:47 ` 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).