[dpdk-dev] app/testpmd: move variables definition in source

Message ID 1516794816-12588-1-git-send-email-katsikas.gp@gmail.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Georgios Katsikas Jan. 24, 2018, 11:53 a.m. UTC
  From: Georgios Katsikas <katsikas.gp@gmail.com>

This patch moves the definition of 3 variables in testpmd.h
into the respective .c file. The idea behind this move is
to allow external applications to compile against testpmd
without throwing compilation errors related to multiple
definition of variables.

Also, an extern dcb_q_mapping in testpmd.h is removed
since it appears that this variable is not defined
elsewhere in the tree.

Signed-off-by: Georgios Katsikas <katsikas.gp@gmail.com>
---
 app/test-pmd/testpmd.c | 18 ++++++++++++++++++
 app/test-pmd/testpmd.h |  7 +++----
 2 files changed, 21 insertions(+), 4 deletions(-)
  

Comments

Georgios Katsikas Jan. 30, 2018, 8:25 a.m. UTC | #1
Hi,

This is a kind reminder to review this short patch.
There seems to be 1 build failure out of 15, but the error looks irrelevant
to the patch according to: http://dpdk.org/dev/patchwork/patch/34403/
Please let me know if there is something I could fix.

Best regards,
Georgios

On Wed, Jan 24, 2018 at 12:53 PM Georgios P. Katsikas <katsikas.gp@gmail.com>
wrote:

> From: Georgios Katsikas <katsikas.gp@gmail.com>
>
> This patch moves the definition of 3 variables in testpmd.h
> into the respective .c file. The idea behind this move is
> to allow external applications to compile against testpmd
> without throwing compilation errors related to multiple
> definition of variables.
>
> Also, an extern dcb_q_mapping in testpmd.h is removed
> since it appears that this variable is not defined
> elsewhere in the tree.
>
> Signed-off-by: Georgios Katsikas <katsikas.gp@gmail.com>
> ---
>  app/test-pmd/testpmd.c | 18 ++++++++++++++++++
>  app/test-pmd/testpmd.h |  7 +++----
>  2 files changed, 21 insertions(+), 4 deletions(-)
>
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> index 5dc8cca..02e8787 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -91,6 +91,24 @@ uint8_t socket_num = UMA_NO_CONFIG;
>  uint8_t mp_anon = 0;
>
>  /*
> + * Store specified sockets on which memory pool to be used by ports
> + * is allocated.
> + */
> +uint8_t port_numa[RTE_MAX_ETHPORTS];
> +
> +/*
> + * Store specified sockets on which RX ring to be used by ports
> + * is allocated.
> + */
> +uint8_t rxring_numa[RTE_MAX_ETHPORTS];
> +
> +/*
> + * Store specified sockets on which TX ring to be used by ports
> + * is allocated.
> + */
> +uint8_t txring_numa[RTE_MAX_ETHPORTS];
> +
> +/*
>   * Record the Ethernet address of peer target ports to which packets are
>   * forwarded.
>   * Must be instantiated with the ethernet addresses of peer traffic
> generator
> diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
> index 47f8fa8..153abea 100644
> --- a/app/test-pmd/testpmd.h
> +++ b/app/test-pmd/testpmd.h
> @@ -329,19 +329,19 @@ extern uint32_t bypass_timeout; /**< Store the NIC
> bypass watchdog timeout */
>   * Store specified sockets on which memory pool to be used by ports
>   * is allocated.
>   */
> -uint8_t port_numa[RTE_MAX_ETHPORTS];
> +extern uint8_t port_numa[RTE_MAX_ETHPORTS];
>
>  /*
>   * Store specified sockets on which RX ring to be used by ports
>   * is allocated.
>   */
> -uint8_t rxring_numa[RTE_MAX_ETHPORTS];
> +extern uint8_t rxring_numa[RTE_MAX_ETHPORTS];
>
>  /*
>   * Store specified sockets on which TX ring to be used by ports
>   * is allocated.
>   */
> -uint8_t txring_numa[RTE_MAX_ETHPORTS];
> +extern uint8_t txring_numa[RTE_MAX_ETHPORTS];
>
>  extern uint8_t socket_num;
>
> @@ -384,7 +384,6 @@ extern int16_t tx_rs_thresh;
>
>  extern uint8_t dcb_config;
>  extern uint8_t dcb_test;
> -extern enum dcb_queue_mapping_mode dcb_q_mapping;
>
>  extern uint16_t mbuf_data_size; /**< Mbuf data space size. */
>  extern uint32_t param_total_num_mbufs;
> --
> 2.7.4
>
>
  
Thomas Monjalon Jan. 31, 2018, 10:18 p.m. UTC | #2
24/01/2018 12:53, Georgios P. Katsikas:
> From: Georgios Katsikas <katsikas.gp@gmail.com>
> 
> This patch moves the definition of 3 variables in testpmd.h
> into the respective .c file. The idea behind this move is
> to allow external applications to compile against testpmd
> without throwing compilation errors related to multiple
> definition of variables.
> 
> Also, an extern dcb_q_mapping in testpmd.h is removed
> since it appears that this variable is not defined
> elsewhere in the tree.
> 
> Signed-off-by: Georgios Katsikas <katsikas.gp@gmail.com>

Applied, thanks
  

Patch

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 5dc8cca..02e8787 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -91,6 +91,24 @@  uint8_t socket_num = UMA_NO_CONFIG;
 uint8_t mp_anon = 0;
 
 /*
+ * Store specified sockets on which memory pool to be used by ports
+ * is allocated.
+ */
+uint8_t port_numa[RTE_MAX_ETHPORTS];
+
+/*
+ * Store specified sockets on which RX ring to be used by ports
+ * is allocated.
+ */
+uint8_t rxring_numa[RTE_MAX_ETHPORTS];
+
+/*
+ * Store specified sockets on which TX ring to be used by ports
+ * is allocated.
+ */
+uint8_t txring_numa[RTE_MAX_ETHPORTS];
+
+/*
  * Record the Ethernet address of peer target ports to which packets are
  * forwarded.
  * Must be instantiated with the ethernet addresses of peer traffic generator
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 47f8fa8..153abea 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -329,19 +329,19 @@  extern uint32_t bypass_timeout; /**< Store the NIC bypass watchdog timeout */
  * Store specified sockets on which memory pool to be used by ports
  * is allocated.
  */
-uint8_t port_numa[RTE_MAX_ETHPORTS];
+extern uint8_t port_numa[RTE_MAX_ETHPORTS];
 
 /*
  * Store specified sockets on which RX ring to be used by ports
  * is allocated.
  */
-uint8_t rxring_numa[RTE_MAX_ETHPORTS];
+extern uint8_t rxring_numa[RTE_MAX_ETHPORTS];
 
 /*
  * Store specified sockets on which TX ring to be used by ports
  * is allocated.
  */
-uint8_t txring_numa[RTE_MAX_ETHPORTS];
+extern uint8_t txring_numa[RTE_MAX_ETHPORTS];
 
 extern uint8_t socket_num;
 
@@ -384,7 +384,6 @@  extern int16_t tx_rs_thresh;
 
 extern uint8_t dcb_config;
 extern uint8_t dcb_test;
-extern enum dcb_queue_mapping_mode dcb_q_mapping;
 
 extern uint16_t mbuf_data_size; /**< Mbuf data space size. */
 extern uint32_t param_total_num_mbufs;