* [dpdk-dev] [PATCH v1] net/mlx4: fix missing initializers for old GCC
@ 2017-10-24 12:35 Moti Haimovsky
2017-10-24 14:03 ` Nélio Laranjeiro
2017-10-24 14:44 ` Adrien Mazarguil
0 siblings, 2 replies; 6+ messages in thread
From: Moti Haimovsky @ 2017-10-24 12:35 UTC (permalink / raw)
To: adrien.mazarguil; +Cc: dev, Moti Haimovsky
This patch works around compilation issues seen on RHEL 7.2
using GCC 4.8.5:
[...] In function 'mlx4_rss_init':
[...]/mlx4_rxq.c:433:19: error: 'wq_num' may be used uninitialized
in this function [-Werror=maybe-uninitialized]
Fixes: ff3397e90080 ("net/mlx4: relax Rx queue configuration order")
Signed-off-by: Moti Haimovsky <motih@mellanox.com>
---
drivers/net/mlx4/mlx4_rxq.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
index fb28290..4c50077 100644
--- a/drivers/net/mlx4/mlx4_rxq.c
+++ b/drivers/net/mlx4/mlx4_rxq.c
@@ -417,6 +417,8 @@ void mlx4_rss_detach(struct mlx4_rss *rss)
if (wq) {
wq_num = wq->wq_num;
claim_zero(ibv_destroy_wq(wq));
+ } else {
+ wq_num = 0; /* Shut up GCC 4.8 warnings. */
}
claim_zero(ibv_destroy_cq(cq));
if (!wq) {
--
1.8.3.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH v1] net/mlx4: fix missing initializers for old GCC
2017-10-24 12:35 [dpdk-dev] [PATCH v1] net/mlx4: fix missing initializers for old GCC Moti Haimovsky
@ 2017-10-24 14:03 ` Nélio Laranjeiro
2017-10-24 14:35 ` Adrien Mazarguil
2017-10-24 14:44 ` Adrien Mazarguil
1 sibling, 1 reply; 6+ messages in thread
From: Nélio Laranjeiro @ 2017-10-24 14:03 UTC (permalink / raw)
To: Moti Haimovsky; +Cc: adrien.mazarguil, dev
Hi Moti,
On Tue, Oct 24, 2017 at 03:35:33PM +0300, Moti Haimovsky wrote:
> This patch works around compilation issues seen on RHEL 7.2
> using GCC 4.8.5:
>
> [...] In function 'mlx4_rss_init':
> [...]/mlx4_rxq.c:433:19: error: 'wq_num' may be used uninitialized
> in this function [-Werror=maybe-uninitialized]
>
> Fixes: ff3397e90080 ("net/mlx4: relax Rx queue configuration order")
>
> Signed-off-by: Moti Haimovsky <motih@mellanox.com>
> ---
> drivers/net/mlx4/mlx4_rxq.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
> index fb28290..4c50077 100644
> --- a/drivers/net/mlx4/mlx4_rxq.c
> +++ b/drivers/net/mlx4/mlx4_rxq.c
> @@ -417,6 +417,8 @@ void mlx4_rss_detach(struct mlx4_rss *rss)
> if (wq) {
> wq_num = wq->wq_num;
> claim_zero(ibv_destroy_wq(wq));
> + } else {
> + wq_num = 0; /* Shut up GCC 4.8 warnings. */
> }
> claim_zero(ibv_destroy_cq(cq));
> if (!wq) {
Why not initialising the wq_num at 0 directly instead of adding this
else branch?
Regards,
--
Nélio Laranjeiro
6WIND
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH v1] net/mlx4: fix missing initializers for old GCC
2017-10-24 14:03 ` Nélio Laranjeiro
@ 2017-10-24 14:35 ` Adrien Mazarguil
2017-10-24 15:21 ` Nélio Laranjeiro
2017-10-24 18:27 ` Ferruh Yigit
0 siblings, 2 replies; 6+ messages in thread
From: Adrien Mazarguil @ 2017-10-24 14:35 UTC (permalink / raw)
To: Nélio Laranjeiro; +Cc: Moti Haimovsky, dev
Hi Nelio,
On Tue, Oct 24, 2017 at 04:03:15PM +0200, Nélio Laranjeiro wrote:
> Hi Moti,
>
> On Tue, Oct 24, 2017 at 03:35:33PM +0300, Moti Haimovsky wrote:
> > This patch works around compilation issues seen on RHEL 7.2
> > using GCC 4.8.5:
> >
> > [...] In function 'mlx4_rss_init':
> > [...]/mlx4_rxq.c:433:19: error: 'wq_num' may be used uninitialized
> > in this function [-Werror=maybe-uninitialized]
> >
> > Fixes: ff3397e90080 ("net/mlx4: relax Rx queue configuration order")
> >
> > Signed-off-by: Moti Haimovsky <motih@mellanox.com>
> > ---
> > drivers/net/mlx4/mlx4_rxq.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
> > index fb28290..4c50077 100644
> > --- a/drivers/net/mlx4/mlx4_rxq.c
> > +++ b/drivers/net/mlx4/mlx4_rxq.c
> > @@ -417,6 +417,8 @@ void mlx4_rss_detach(struct mlx4_rss *rss)
> > if (wq) {
> > wq_num = wq->wq_num;
> > claim_zero(ibv_destroy_wq(wq));
> > + } else {
> > + wq_num = 0; /* Shut up GCC 4.8 warnings. */
> > }
> > claim_zero(ibv_destroy_cq(cq));
> > if (!wq) {
>
> Why not initialising the wq_num at 0 directly instead of adding this
> else branch?
Actually that was my suggestion, it is done to highlight the code path
where buggy GCC versions choke on what they mistake for an uninitialized
variable. Initializing this variable earlier could possibly hide bugs
otherwise.
Patch is OK for me as is:
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
--
Adrien Mazarguil
6WIND
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH v1] net/mlx4: fix missing initializers for old GCC
2017-10-24 12:35 [dpdk-dev] [PATCH v1] net/mlx4: fix missing initializers for old GCC Moti Haimovsky
2017-10-24 14:03 ` Nélio Laranjeiro
@ 2017-10-24 14:44 ` Adrien Mazarguil
1 sibling, 0 replies; 6+ messages in thread
From: Adrien Mazarguil @ 2017-10-24 14:44 UTC (permalink / raw)
To: Moti Haimovsky; +Cc: dev
On Tue, Oct 24, 2017 at 03:35:33PM +0300, Moti Haimovsky wrote:
> This patch works around compilation issues seen on RHEL 7.2
> using GCC 4.8.5:
>
> [...] In function 'mlx4_rss_init':
> [...]/mlx4_rxq.c:433:19: error: 'wq_num' may be used uninitialized
> in this function [-Werror=maybe-uninitialized]
>
> Fixes: ff3397e90080 ("net/mlx4: relax Rx queue configuration order")
>
> Signed-off-by: Moti Haimovsky <motih@mellanox.com>
> ---
> drivers/net/mlx4/mlx4_rxq.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
> index fb28290..4c50077 100644
> --- a/drivers/net/mlx4/mlx4_rxq.c
> +++ b/drivers/net/mlx4/mlx4_rxq.c
> @@ -417,6 +417,8 @@ void mlx4_rss_detach(struct mlx4_rss *rss)
> if (wq) {
> wq_num = wq->wq_num;
> claim_zero(ibv_destroy_wq(wq));
> + } else {
> + wq_num = 0; /* Shut up GCC 4.8 warnings. */
Wait, there's an indentation issue here, please remove unnecessary extra
space before "wq_num".
> }
> claim_zero(ibv_destroy_cq(cq));
> if (!wq) {
> --
> 1.8.3.1
>
--
Adrien Mazarguil
6WIND
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH v1] net/mlx4: fix missing initializers for old GCC
2017-10-24 14:35 ` Adrien Mazarguil
@ 2017-10-24 15:21 ` Nélio Laranjeiro
2017-10-24 18:27 ` Ferruh Yigit
1 sibling, 0 replies; 6+ messages in thread
From: Nélio Laranjeiro @ 2017-10-24 15:21 UTC (permalink / raw)
To: Adrien Mazarguil; +Cc: Moti Haimovsky, dev
On Tue, Oct 24, 2017 at 04:35:05PM +0200, Adrien Mazarguil wrote:
> Hi Nelio,
>
> On Tue, Oct 24, 2017 at 04:03:15PM +0200, Nélio Laranjeiro wrote:
> > Hi Moti,
> >
> > On Tue, Oct 24, 2017 at 03:35:33PM +0300, Moti Haimovsky wrote:
> > > This patch works around compilation issues seen on RHEL 7.2
> > > using GCC 4.8.5:
> > >
> > > [...] In function 'mlx4_rss_init':
> > > [...]/mlx4_rxq.c:433:19: error: 'wq_num' may be used uninitialized
> > > in this function [-Werror=maybe-uninitialized]
> > >
> > > Fixes: ff3397e90080 ("net/mlx4: relax Rx queue configuration order")
> > >
> > > Signed-off-by: Moti Haimovsky <motih@mellanox.com>
> > > ---
> > > drivers/net/mlx4/mlx4_rxq.c | 2 ++
> > > 1 file changed, 2 insertions(+)
> > >
> > > diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
> > > index fb28290..4c50077 100644
> > > --- a/drivers/net/mlx4/mlx4_rxq.c
> > > +++ b/drivers/net/mlx4/mlx4_rxq.c
> > > @@ -417,6 +417,8 @@ void mlx4_rss_detach(struct mlx4_rss *rss)
> > > if (wq) {
> > > wq_num = wq->wq_num;
> > > claim_zero(ibv_destroy_wq(wq));
> > > + } else {
> > > + wq_num = 0; /* Shut up GCC 4.8 warnings. */
> > > }
> > > claim_zero(ibv_destroy_cq(cq));
> > > if (!wq) {
> >
> > Why not initialising the wq_num at 0 directly instead of adding this
> > else branch?
>
> Actually that was my suggestion, it is done to highlight the code path
> where buggy GCC versions choke on what they mistake for an uninitialized
> variable. Initializing this variable earlier could possibly hide bugs
> otherwise.
I'll agree with this also.
>
> Patch is OK for me as is:
>
> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
>
> --
> Adrien Mazarguil
> 6WIND
--
Nélio Laranjeiro
6WIND
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH v1] net/mlx4: fix missing initializers for old GCC
2017-10-24 14:35 ` Adrien Mazarguil
2017-10-24 15:21 ` Nélio Laranjeiro
@ 2017-10-24 18:27 ` Ferruh Yigit
1 sibling, 0 replies; 6+ messages in thread
From: Ferruh Yigit @ 2017-10-24 18:27 UTC (permalink / raw)
To: Adrien Mazarguil, Nélio Laranjeiro; +Cc: Moti Haimovsky, dev
On 10/24/2017 7:35 AM, Adrien Mazarguil wrote:
> Hi Nelio,
>
> On Tue, Oct 24, 2017 at 04:03:15PM +0200, Nélio Laranjeiro wrote:
>> Hi Moti,
>>
>> On Tue, Oct 24, 2017 at 03:35:33PM +0300, Moti Haimovsky wrote:
>>> This patch works around compilation issues seen on RHEL 7.2
>>> using GCC 4.8.5:
>>>
>>> [...] In function 'mlx4_rss_init':
>>> [...]/mlx4_rxq.c:433:19: error: 'wq_num' may be used uninitialized
>>> in this function [-Werror=maybe-uninitialized]
>>>
>>> Fixes: ff3397e90080 ("net/mlx4: relax Rx queue configuration order")
>>>
>>> Signed-off-by: Moti Haimovsky <motih@mellanox.com>
> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Squashed into relevant commit in next-net, thanks.
(whitespace issue fixed while applying)
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-10-24 18:27 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-24 12:35 [dpdk-dev] [PATCH v1] net/mlx4: fix missing initializers for old GCC Moti Haimovsky
2017-10-24 14:03 ` Nélio Laranjeiro
2017-10-24 14:35 ` Adrien Mazarguil
2017-10-24 15:21 ` Nélio Laranjeiro
2017-10-24 18:27 ` Ferruh Yigit
2017-10-24 14:44 ` Adrien Mazarguil
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).