DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/3] examples: fix building with GCC 10
@ 2020-02-05 13:47 Timothy Redaelli
  2020-02-05 13:47 ` [dpdk-dev] [PATCH 1/3] examples/vhost_blk: " Timothy Redaelli
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Timothy Redaelli @ 2020-02-05 13:47 UTC (permalink / raw)
  To: dev; +Cc: stable

GCC 10 defaults to -fno-common, this means a linker error will now be
reported if the same global variable is defined in more than one
compilation unit.

See https://gcc.gnu.org/gcc-10/porting_to.html for more informations.

I didn't put -fcommon to CFLAGS since:
  Compiling with -fno-common is useful on targets for which it provides
  better performance, or if you wish to verify that the program will work
  on other systems that always treat uninitialized variable definitions
  this way.
from gcc man page

Timothy Redaelli (3):
  examples/vhost_blk: fix building with GCC 10
  examples/eventdev_pipeline: fix building with GCC 10
  examples/qos_sched: fix building with GCC 10

 examples/eventdev_pipeline/main.c            | 2 ++
 examples/eventdev_pipeline/pipeline_common.h | 4 ++--
 examples/qos_sched/cfg_file.c                | 3 +++
 examples/qos_sched/main.h                    | 4 ++--
 examples/vhost_blk/vhost_blk.c               | 2 ++
 examples/vhost_blk/vhost_blk.h               | 4 ++--
 6 files changed, 13 insertions(+), 6 deletions(-)

-- 
2.24.1


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

* [dpdk-dev] [PATCH 1/3] examples/vhost_blk: fix building with GCC 10
  2020-02-05 13:47 [dpdk-dev] [PATCH 0/3] examples: fix building with GCC 10 Timothy Redaelli
@ 2020-02-05 13:47 ` Timothy Redaelli
  2020-02-05 15:12   ` Maxime Coquelin
  2020-02-05 14:12 ` [dpdk-dev] [PATCH v2 3/3] app/test-pipeline: " Timothy Redaelli
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Timothy Redaelli @ 2020-02-05 13:47 UTC (permalink / raw)
  To: dev; +Cc: stable, jin.yu

GCC 10 defaults to -fno-common, this means a linker error will now be
reported if the same global variable is defined in more than one
compilation unit.

Fixes: c19beb3f38cd ("examples/vhost_blk: introduce vhost storage sample")
Cc: jin.yu@intel.com
Cc: stable@dpdk.org
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
---
 examples/vhost_blk/vhost_blk.c | 2 ++
 examples/vhost_blk/vhost_blk.h | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/examples/vhost_blk/vhost_blk.c b/examples/vhost_blk/vhost_blk.c
index e1036bf3a..143ae19f3 100644
--- a/examples/vhost_blk/vhost_blk.c
+++ b/examples/vhost_blk/vhost_blk.c
@@ -31,6 +31,8 @@
 			    (1ULL << VIRTIO_F_NOTIFY_ON_EMPTY) | \
 			    (1ULL << VHOST_USER_F_PROTOCOL_FEATURES))
 
+struct vhost_blk_ctrlr *g_vhost_ctrlr;
+
 /* Path to folder where character device will be created. Can be set by user. */
 static char dev_pathname[PATH_MAX] = "";
 static sem_t exit_sem;
diff --git a/examples/vhost_blk/vhost_blk.h b/examples/vhost_blk/vhost_blk.h
index 933e2b7c5..17258d284 100644
--- a/examples/vhost_blk/vhost_blk.h
+++ b/examples/vhost_blk/vhost_blk.h
@@ -112,8 +112,8 @@ struct inflight_blk_task {
 	struct rte_vhost_inflight_info_packed *inflight_packed;
 };
 
-struct vhost_blk_ctrlr *g_vhost_ctrlr;
-struct vhost_device_ops vhost_blk_device_ops;
+extern struct vhost_blk_ctrlr *g_vhost_ctrlr;
+extern struct vhost_device_ops vhost_blk_device_ops;
 
 int vhost_bdev_process_blk_commands(struct vhost_block_dev *bdev,
 				     struct vhost_blk_task *task);
-- 
2.24.1


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

* [dpdk-dev] [PATCH v2 3/3] app/test-pipeline: fix building with GCC 10
  2020-02-05 13:47 [dpdk-dev] [PATCH 0/3] examples: fix building with GCC 10 Timothy Redaelli
  2020-02-05 13:47 ` [dpdk-dev] [PATCH 1/3] examples/vhost_blk: " Timothy Redaelli
@ 2020-02-05 14:12 ` Timothy Redaelli
  2020-02-05 14:21   ` Dumitrescu, Cristian
  2020-02-05 17:05 ` [dpdk-dev] [PATCH 2/3] examples/eventdev_pipeline: " Timothy Redaelli
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Timothy Redaelli @ 2020-02-05 14:12 UTC (permalink / raw)
  To: stable; +Cc: dev, david.marchand, cristian.dumitrescu

GCC 10 defaults to -fno-common, this means a linker error will now be
reported if the same global variable is defined in more than one
compilation unit.

Fixes: 48f31ca50cc4 ("app/pipeline: packet framework benchmark")
Cc: cristian.dumitrescu@intel.com
Cc: stable@dpdk.org
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
---

v2:
    app is already declared as extern in main.h. (as reported by David)

---
 app/test-pipeline/config.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/app/test-pipeline/config.c b/app/test-pipeline/config.c
index 28ac9fcc0..33f3f1c82 100644
--- a/app/test-pipeline/config.c
+++ b/app/test-pipeline/config.c
@@ -42,8 +42,6 @@
 
 #include "main.h"
 
-struct app_params app;
-
 static const char usage[] = "\n";
 
 void
-- 
2.24.1


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

* Re: [dpdk-dev] [PATCH v2 3/3] app/test-pipeline: fix building with GCC 10
  2020-02-05 14:12 ` [dpdk-dev] [PATCH v2 3/3] app/test-pipeline: " Timothy Redaelli
@ 2020-02-05 14:21   ` Dumitrescu, Cristian
  0 siblings, 0 replies; 9+ messages in thread
From: Dumitrescu, Cristian @ 2020-02-05 14:21 UTC (permalink / raw)
  To: Timothy Redaelli, stable; +Cc: dev, david.marchand



> -----Original Message-----
> From: Timothy Redaelli <tredaelli@redhat.com>
> Sent: Wednesday, February 5, 2020 2:12 PM
> To: stable@dpdk.org
> Cc: dev@dpdk.org; david.marchand@redhat.com; Dumitrescu, Cristian
> <cristian.dumitrescu@intel.com>
> Subject: [PATCH v2 3/3] app/test-pipeline: fix building with GCC 10
> 
> GCC 10 defaults to -fno-common, this means a linker error will now be
> reported if the same global variable is defined in more than one
> compilation unit.
> 
> Fixes: 48f31ca50cc4 ("app/pipeline: packet framework benchmark")
> Cc: cristian.dumitrescu@intel.com
> Cc: stable@dpdk.org
> Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
> ---
> 
> v2:
>     app is already declared as extern in main.h. (as reported by David)
> 
> ---
>  app/test-pipeline/config.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/app/test-pipeline/config.c b/app/test-pipeline/config.c
> index 28ac9fcc0..33f3f1c82 100644
> --- a/app/test-pipeline/config.c
> +++ b/app/test-pipeline/config.c
> @@ -42,8 +42,6 @@
> 
>  #include "main.h"
> 
> -struct app_params app;
> -
>  static const char usage[] = "\n";
> 
>  void
> --
> 2.24.1

Yes, app is declared in main.h and defined & initialized in init.c, no need to have it defined the second time in config.c.

Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>



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

* Re: [dpdk-dev] [PATCH 1/3] examples/vhost_blk: fix building with GCC 10
  2020-02-05 13:47 ` [dpdk-dev] [PATCH 1/3] examples/vhost_blk: " Timothy Redaelli
@ 2020-02-05 15:12   ` Maxime Coquelin
  0 siblings, 0 replies; 9+ messages in thread
From: Maxime Coquelin @ 2020-02-05 15:12 UTC (permalink / raw)
  To: Timothy Redaelli, dev; +Cc: stable, jin.yu



On 2/5/20 2:47 PM, Timothy Redaelli wrote:
> GCC 10 defaults to -fno-common, this means a linker error will now be
> reported if the same global variable is defined in more than one
> compilation unit.
> 
> Fixes: c19beb3f38cd ("examples/vhost_blk: introduce vhost storage sample")
> Cc: jin.yu@intel.com
> Cc: stable@dpdk.org
> Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
> ---
>  examples/vhost_blk/vhost_blk.c | 2 ++
>  examples/vhost_blk/vhost_blk.h | 4 ++--
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime


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

* [dpdk-dev] [PATCH 2/3] examples/eventdev_pipeline: fix building with GCC 10
  2020-02-05 13:47 [dpdk-dev] [PATCH 0/3] examples: fix building with GCC 10 Timothy Redaelli
  2020-02-05 13:47 ` [dpdk-dev] [PATCH 1/3] examples/vhost_blk: " Timothy Redaelli
  2020-02-05 14:12 ` [dpdk-dev] [PATCH v2 3/3] app/test-pipeline: " Timothy Redaelli
@ 2020-02-05 17:05 ` Timothy Redaelli
  2020-02-05 17:05 ` [dpdk-dev] [PATCH 3/3] examples/qos_sched: " Timothy Redaelli
  2020-03-04  9:37 ` [dpdk-dev] [PATCH 0/3] examples: " David Marchand
  4 siblings, 0 replies; 9+ messages in thread
From: Timothy Redaelli @ 2020-02-05 17:05 UTC (permalink / raw)
  To: dev; +Cc: stable, pbhagavatula

Fixes: 3d1b33e44ae2 ("examples/eventdev: move common data into pipeline common")
Cc: pbhagavatula@marvell.com
Cc: stable@dpdk.org
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
---
 examples/eventdev_pipeline/main.c            | 2 ++
 examples/eventdev_pipeline/pipeline_common.h | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index d3ff1bbe4..d0da51b1c 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -10,6 +10,8 @@
 
 #include "pipeline_common.h"
 
+struct fastpath_data *fdata;
+
 struct config_data cdata = {
 	.num_packets = (1L << 25), /* do ~32M packets */
 	.num_fids = 512,
diff --git a/examples/eventdev_pipeline/pipeline_common.h b/examples/eventdev_pipeline/pipeline_common.h
index 8e30393d0..c7245f7f0 100644
--- a/examples/eventdev_pipeline/pipeline_common.h
+++ b/examples/eventdev_pipeline/pipeline_common.h
@@ -93,8 +93,8 @@ struct port_link {
 	uint8_t priority;
 };
 
-struct fastpath_data *fdata;
-struct config_data cdata;
+extern struct fastpath_data *fdata;
+extern struct config_data cdata;
 
 static __rte_always_inline void
 exchange_mac(struct rte_mbuf *m)
-- 
2.24.1


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

* [dpdk-dev] [PATCH 3/3] examples/qos_sched: fix building with GCC 10
  2020-02-05 13:47 [dpdk-dev] [PATCH 0/3] examples: fix building with GCC 10 Timothy Redaelli
                   ` (2 preceding siblings ...)
  2020-02-05 17:05 ` [dpdk-dev] [PATCH 2/3] examples/eventdev_pipeline: " Timothy Redaelli
@ 2020-02-05 17:05 ` Timothy Redaelli
  2020-03-04  9:37 ` [dpdk-dev] [PATCH 0/3] examples: " David Marchand
  4 siblings, 0 replies; 9+ messages in thread
From: Timothy Redaelli @ 2020-02-05 17:05 UTC (permalink / raw)
  To: dev; +Cc: stable, jasvinder.singh

GCC 10 defaults to -fno-common, this means a linker error will now be
reported if the same global variable is defined in more than one
compilation unit.

Fixes: be1e533238c0 ("examples/qos_sched: add TC and queue config flexibility")
Cc: jasvinder.singh@intel.com
Cc: stable@dpdk.org
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
---
 examples/qos_sched/cfg_file.c | 3 +++
 examples/qos_sched/main.h     | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/examples/qos_sched/cfg_file.c b/examples/qos_sched/cfg_file.c
index 5714c3f36..f078e4f7d 100644
--- a/examples/qos_sched/cfg_file.c
+++ b/examples/qos_sched/cfg_file.c
@@ -20,6 +20,9 @@
  * for new entries do we add in */
 #define CFG_ALLOC_ENTRY_BATCH 16
 
+uint32_t active_queues[RTE_SCHED_QUEUES_PER_PIPE];
+uint32_t n_active_queues;
+
 int
 cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params *port_params)
 {
diff --git a/examples/qos_sched/main.h b/examples/qos_sched/main.h
index baa2b3ead..23bc418d9 100644
--- a/examples/qos_sched/main.h
+++ b/examples/qos_sched/main.h
@@ -148,8 +148,8 @@ extern struct burst_conf burst_conf;
 extern struct ring_thresh rx_thresh;
 extern struct ring_thresh tx_thresh;
 
-uint32_t active_queues[RTE_SCHED_QUEUES_PER_PIPE];
-uint32_t n_active_queues;
+extern uint32_t active_queues[RTE_SCHED_QUEUES_PER_PIPE];
+extern uint32_t n_active_queues;
 
 extern struct rte_sched_port_params port_params;
 extern struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS];
-- 
2.24.1


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

* Re: [dpdk-dev] [PATCH 0/3] examples: fix building with GCC 10
  2020-02-05 13:47 [dpdk-dev] [PATCH 0/3] examples: fix building with GCC 10 Timothy Redaelli
                   ` (3 preceding siblings ...)
  2020-02-05 17:05 ` [dpdk-dev] [PATCH 3/3] examples/qos_sched: " Timothy Redaelli
@ 2020-03-04  9:37 ` David Marchand
  2020-03-04 10:17   ` David Marchand
  4 siblings, 1 reply; 9+ messages in thread
From: David Marchand @ 2020-03-04  9:37 UTC (permalink / raw)
  To: Timothy Redaelli; +Cc: dev, dpdk stable

On Wed, Feb 5, 2020 at 2:47 PM Timothy Redaelli <tredaelli@redhat.com> wrote:
>
> GCC 10 defaults to -fno-common, this means a linker error will now be
> reported if the same global variable is defined in more than one
> compilation unit.
>
> See https://gcc.gnu.org/gcc-10/porting_to.html for more informations.
>
> I didn't put -fcommon to CFLAGS since:
>   Compiling with -fno-common is useful on targets for which it provides
>   better performance, or if you wish to verify that the program will work
>   on other systems that always treat uninitialized variable definitions
>   this way.
> from gcc man page

For the series,
Acked-by: David Marchand <david.marchand@redhat.com>


-- 
David Marchand


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

* Re: [dpdk-dev] [PATCH 0/3] examples: fix building with GCC 10
  2020-03-04  9:37 ` [dpdk-dev] [PATCH 0/3] examples: " David Marchand
@ 2020-03-04 10:17   ` David Marchand
  0 siblings, 0 replies; 9+ messages in thread
From: David Marchand @ 2020-03-04 10:17 UTC (permalink / raw)
  To: Timothy Redaelli; +Cc: dev, dpdk stable

On Wed, Mar 4, 2020 at 10:37 AM David Marchand
<david.marchand@redhat.com> wrote:
>
> On Wed, Feb 5, 2020 at 2:47 PM Timothy Redaelli <tredaelli@redhat.com> wrote:
> >
> > GCC 10 defaults to -fno-common, this means a linker error will now be
> > reported if the same global variable is defined in more than one
> > compilation unit.
> >
> > See https://gcc.gnu.org/gcc-10/porting_to.html for more informations.
> >
> > I didn't put -fcommon to CFLAGS since:
> >   Compiling with -fno-common is useful on targets for which it provides
> >   better performance, or if you wish to verify that the program will work
> >   on other systems that always treat uninitialized variable definitions
> >   this way.
> > from gcc man page
>
> For the series,
> Acked-by: David Marchand <david.marchand@redhat.com>

Series applied, thanks.


-- 
David Marchand


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

end of thread, other threads:[~2020-03-04 10:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-05 13:47 [dpdk-dev] [PATCH 0/3] examples: fix building with GCC 10 Timothy Redaelli
2020-02-05 13:47 ` [dpdk-dev] [PATCH 1/3] examples/vhost_blk: " Timothy Redaelli
2020-02-05 15:12   ` Maxime Coquelin
2020-02-05 14:12 ` [dpdk-dev] [PATCH v2 3/3] app/test-pipeline: " Timothy Redaelli
2020-02-05 14:21   ` Dumitrescu, Cristian
2020-02-05 17:05 ` [dpdk-dev] [PATCH 2/3] examples/eventdev_pipeline: " Timothy Redaelli
2020-02-05 17:05 ` [dpdk-dev] [PATCH 3/3] examples/qos_sched: " Timothy Redaelli
2020-03-04  9:37 ` [dpdk-dev] [PATCH 0/3] examples: " David Marchand
2020-03-04 10:17   ` David Marchand

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