[dpdk-stable] [PATCH 08/10] app/testpmd: fix global variable multiple definitions

Thomas Monjalon thomas at monjalon.net
Sat Oct 12 14:36:45 CEST 2019


05/09/2019 16:53, Ferruh Yigit:
> --- a/app/test-pmd/testpmd.h
> +++ b/app/test-pmd/testpmd.h
> @@ -507,7 +507,8 @@ struct vxlan_encap_conf {
>  	uint8_t eth_src[RTE_ETHER_ADDR_LEN];
>  	uint8_t eth_dst[RTE_ETHER_ADDR_LEN];
>  };
> -struct vxlan_encap_conf vxlan_encap_conf;
> +
> +extern struct vxlan_encap_conf vxlan_encap_conf;
>  
>  /* NVGRE encap/decap parameters. */
>  struct nvgre_encap_conf {
> @@ -522,7 +523,8 @@ struct nvgre_encap_conf {
>  	uint8_t eth_src[RTE_ETHER_ADDR_LEN];
>  	uint8_t eth_dst[RTE_ETHER_ADDR_LEN];
>  };
> -struct nvgre_encap_conf nvgre_encap_conf;
> +
> +extern struct nvgre_encap_conf nvgre_encap_conf;

I guess the empty line is not needed here and above.

>  /* L2 encap parameters. */
>  struct l2_encap_conf {
> @@ -532,13 +534,13 @@ struct l2_encap_conf {
>  	uint8_t eth_src[RTE_ETHER_ADDR_LEN];
>  	uint8_t eth_dst[RTE_ETHER_ADDR_LEN];
>  };
> -struct l2_encap_conf l2_encap_conf;
> +extern struct l2_encap_conf l2_encap_conf;
>  
>  /* L2 decap parameters. */
>  struct l2_decap_conf {
>  	uint32_t select_vlan:1;
>  };
> -struct l2_decap_conf l2_decap_conf;
> +extern struct l2_decap_conf l2_decap_conf;
>  
>  /* MPLSoGRE encap parameters. */
>  struct mplsogre_encap_conf {
> @@ -553,14 +555,14 @@ struct mplsogre_encap_conf {
>  	uint8_t eth_src[RTE_ETHER_ADDR_LEN];
>  	uint8_t eth_dst[RTE_ETHER_ADDR_LEN];
>  };
> -struct mplsogre_encap_conf mplsogre_encap_conf;
> +extern struct mplsogre_encap_conf mplsogre_encap_conf;
>  
>  /* MPLSoGRE decap parameters. */
>  struct mplsogre_decap_conf {
>  	uint32_t select_ipv4:1;
>  	uint32_t select_vlan:1;
>  };
> -struct mplsogre_decap_conf mplsogre_decap_conf;
> +extern struct mplsogre_decap_conf mplsogre_decap_conf;
>  
>  /* MPLSoUDP encap parameters. */
>  struct mplsoudp_encap_conf {
> @@ -577,14 +579,14 @@ struct mplsoudp_encap_conf {
>  	uint8_t eth_src[RTE_ETHER_ADDR_LEN];
>  	uint8_t eth_dst[RTE_ETHER_ADDR_LEN];
>  };
> -struct mplsoudp_encap_conf mplsoudp_encap_conf;
> +extern struct mplsoudp_encap_conf mplsoudp_encap_conf;
>  
>  /* MPLSoUDP decap parameters. */
>  struct mplsoudp_decap_conf {
>  	uint32_t select_ipv4:1;
>  	uint32_t select_vlan:1;
>  };
> -struct mplsoudp_decap_conf mplsoudp_decap_conf;
> +extern struct mplsoudp_decap_conf mplsoudp_decap_conf;
>  
>  static inline unsigned int
>  lcore_num(void)





More information about the stable mailing list