From: Ferruh Yigit <ferruh.yigit@intel.com> To: Adrien Mazarguil <adrien.mazarguil@6wind.com>, Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, Bernard Iremonger <bernard.iremonger@intel.com> Cc: dev@dpdk.org, stable@dpdk.org Subject: [dpdk-stable] [PATCH 08/10] app/testpmd: fix global variable multiple definitions Date: Thu, 5 Sep 2019 15:53:13 +0100 Message-ID: <20190905145315.19395-9-ferruh.yigit@intel.com> (raw) In-Reply-To: <20190905145315.19395-1-ferruh.yigit@intel.com> Some flow config related global variables are defined in a header file which was causing multiple definitions of the variables, fixed it by moving them to the .c file. Issue has been detected by '-fno-common' gcc flag. Also while being there, removed duplicated 'ACTION_RAW_ENCAP_MAX_DAT definition, moved 'vxlan_encap_conf' & 'nvgre_encap_conf' initialization to 'cmdline_flow.c' which is better location than 'testpmd.c' relocated 'action_raw_encap_data' & 'action_raw_decap_data' struct definitions slightly within the file Fixes: 1960be7d32f8 ("app/testpmd: add VXLAN encap/decap") Fixes: dcd962fc6b4e ("app/testpmd: add NVGRE encap/decap") Fixes: a1191d39cb57 ("app/testpmd: add MPLSoUDP encapsulation") Fixes: 3e77031be855 ("app/testpmd: add MPLSoGRE encapsulation") Cc: stable@dpdk.org Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> --- app/test-pmd/cmdline_flow.c | 77 +++++++++++++++++++++++++++++-------- app/test-pmd/testpmd.c | 35 ----------------- app/test-pmd/testpmd.h | 18 +++++---- 3 files changed, 71 insertions(+), 59 deletions(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 369426cbd..bc2ba7987 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -316,9 +316,7 @@ struct action_rss_data { uint16_t queue[ACTION_RSS_QUEUE_NUM]; }; -/** Maximum number of items in struct rte_flow_action_vxlan_encap. */ -#define ACTION_VXLAN_ENCAP_ITEMS_NUM 6 - +/** Maximum data size in struct rte_flow_action_raw_encap. */ #define ACTION_RAW_ENCAP_MAX_DATA 128 /** Storage for struct rte_flow_action_raw_encap. */ @@ -330,6 +328,13 @@ struct raw_encap_conf { struct raw_encap_conf raw_encap_conf = {.size = 0}; +/** Storage for struct rte_flow_action_raw_encap including external data. */ +struct action_raw_encap_data { + struct rte_flow_action_raw_encap conf; + uint8_t data[ACTION_RAW_ENCAP_MAX_DATA]; + uint8_t preserve[ACTION_RAW_ENCAP_MAX_DATA]; +}; + /** Storage for struct rte_flow_action_raw_decap. */ struct raw_decap_conf { uint8_t data[ACTION_RAW_ENCAP_MAX_DATA]; @@ -338,6 +343,35 @@ struct raw_decap_conf { struct raw_decap_conf raw_decap_conf = {.size = 0}; +/** Storage for struct rte_flow_action_raw_decap including external data. */ +struct action_raw_decap_data { + struct rte_flow_action_raw_decap conf; + uint8_t data[ACTION_RAW_ENCAP_MAX_DATA]; +}; + +struct vxlan_encap_conf vxlan_encap_conf = { + .select_ipv4 = 1, + .select_vlan = 0, + .select_tos_ttl = 0, + .vni = "\x00\x00\x00", + .udp_src = 0, + .udp_dst = RTE_BE16(4789), + .ipv4_src = RTE_IPV4(127, 0, 0, 1), + .ipv4_dst = RTE_IPV4(255, 255, 255, 255), + .ipv6_src = "\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x01", + .ipv6_dst = "\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x11\x11", + .vlan_tci = 0, + .ip_tos = 0, + .ip_ttl = 255, + .eth_src = "\x00\x00\x00\x00\x00\x00", + .eth_dst = "\xff\xff\xff\xff\xff\xff", +}; + +/** Maximum number of items in struct rte_flow_action_vxlan_encap. */ +#define ACTION_VXLAN_ENCAP_ITEMS_NUM 6 + /** Storage for struct rte_flow_action_vxlan_encap including external data. */ struct action_vxlan_encap_data { struct rte_flow_action_vxlan_encap conf; @@ -352,6 +386,21 @@ struct action_vxlan_encap_data { struct rte_flow_item_vxlan item_vxlan; }; +struct nvgre_encap_conf nvgre_encap_conf = { + .select_ipv4 = 1, + .select_vlan = 0, + .tni = "\x00\x00\x00", + .ipv4_src = RTE_IPV4(127, 0, 0, 1), + .ipv4_dst = RTE_IPV4(255, 255, 255, 255), + .ipv6_src = "\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x01", + .ipv6_dst = "\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x11\x11", + .vlan_tci = 0, + .eth_src = "\x00\x00\x00\x00\x00\x00", + .eth_dst = "\xff\xff\xff\xff\xff\xff", +}; + /** Maximum number of items in struct rte_flow_action_nvgre_encap. */ #define ACTION_NVGRE_ENCAP_ITEMS_NUM 5 @@ -368,21 +417,17 @@ struct action_nvgre_encap_data { struct rte_flow_item_nvgre item_nvgre; }; -/** Maximum data size in struct rte_flow_action_raw_encap. */ -#define ACTION_RAW_ENCAP_MAX_DATA 128 +struct l2_encap_conf l2_encap_conf; -/** Storage for struct rte_flow_action_raw_encap including external data. */ -struct action_raw_encap_data { - struct rte_flow_action_raw_encap conf; - uint8_t data[ACTION_RAW_ENCAP_MAX_DATA]; - uint8_t preserve[ACTION_RAW_ENCAP_MAX_DATA]; -}; +struct l2_decap_conf l2_decap_conf; -/** Storage for struct rte_flow_action_raw_decap including external data. */ -struct action_raw_decap_data { - struct rte_flow_action_raw_decap conf; - uint8_t data[ACTION_RAW_ENCAP_MAX_DATA]; -}; +struct mplsogre_encap_conf mplsogre_encap_conf; + +struct mplsogre_decap_conf mplsogre_decap_conf; + +struct mplsoudp_encap_conf mplsoudp_encap_conf; + +struct mplsoudp_decap_conf mplsoudp_decap_conf; /** Maximum number of subsequent tokens and arguments on the stack. */ #define CTX_STACK_SIZE 16 diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index cbf73e685..e301563d6 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -478,41 +478,6 @@ uint8_t bitrate_enabled; struct gro_status gro_ports[RTE_MAX_ETHPORTS]; uint8_t gro_flush_cycles = GRO_DEFAULT_FLUSH_CYCLES; -struct vxlan_encap_conf vxlan_encap_conf = { - .select_ipv4 = 1, - .select_vlan = 0, - .select_tos_ttl = 0, - .vni = "\x00\x00\x00", - .udp_src = 0, - .udp_dst = RTE_BE16(4789), - .ipv4_src = RTE_IPV4(127, 0, 0, 1), - .ipv4_dst = RTE_IPV4(255, 255, 255, 255), - .ipv6_src = "\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x01", - .ipv6_dst = "\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x11\x11", - .vlan_tci = 0, - .ip_tos = 0, - .ip_ttl = 255, - .eth_src = "\x00\x00\x00\x00\x00\x00", - .eth_dst = "\xff\xff\xff\xff\xff\xff", -}; - -struct nvgre_encap_conf nvgre_encap_conf = { - .select_ipv4 = 1, - .select_vlan = 0, - .tni = "\x00\x00\x00", - .ipv4_src = RTE_IPV4(127, 0, 0, 1), - .ipv4_dst = RTE_IPV4(255, 255, 255, 255), - .ipv6_src = "\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x01", - .ipv6_dst = "\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x11\x11", - .vlan_tci = 0, - .eth_src = "\x00\x00\x00\x00\x00\x00", - .eth_dst = "\xff\xff\xff\xff\xff\xff", -}; - /* Forward function declarations */ static void setup_attached_port(portid_t pi); static void map_port_queue_stats_mapping_registers(portid_t pi, diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index d73955da1..79adebaeb 100644 --- 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; /* 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) -- 2.21.0
next prev parent reply index Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <20190905145315.19395-1-ferruh.yigit@intel.com> 2019-09-05 14:53 ` [dpdk-stable] [PATCH 01/10] bus/fslmc: " Ferruh Yigit 2019-09-10 16:36 ` Sachin Saxena 2019-09-05 14:53 ` [dpdk-stable] [PATCH 02/10] net/igb: " Ferruh Yigit 2019-09-05 14:53 ` [dpdk-stable] [PATCH 03/10] crypto/null: " Ferruh Yigit 2019-09-05 14:53 ` [dpdk-stable] [PATCH 04/10] crypto/octeontx: " Ferruh Yigit 2019-09-26 11:20 ` [dpdk-stable] [EXT] " Anoob Joseph 2019-09-26 18:03 ` Ferruh Yigit 2019-09-05 14:53 ` [dpdk-stable] [PATCH 05/10] crypto/dpaa2_sec: " Ferruh Yigit 2019-09-10 16:53 ` [dpdk-stable] [dpdk-dev] " Sachin Saxena 2019-10-24 14:53 ` [dpdk-stable] " David Marchand 2019-10-24 14:55 ` Ferruh Yigit 2019-10-24 16:56 ` David Marchand 2019-10-25 10:25 ` Ferruh Yigit 2019-09-05 14:53 ` [dpdk-stable] [PATCH 06/10] crypto/virtio: " Ferruh Yigit 2019-09-05 14:53 ` [dpdk-stable] [PATCH 07/10] compress/octeontx: " Ferruh Yigit 2019-09-05 16:00 ` [dpdk-stable] [EXT] " Ashish Gupta 2019-09-05 14:53 ` Ferruh Yigit [this message] 2019-10-12 12:36 ` [dpdk-stable] [PATCH 08/10] app/testpmd: " Thomas Monjalon 2019-09-05 14:53 ` [dpdk-stable] [PATCH 09/10] app/test-pipeline: " Ferruh Yigit 2019-09-05 15:01 ` Dumitrescu, Cristian 2019-09-05 15:19 ` Ferruh Yigit 2019-09-05 14:53 ` [dpdk-stable] [PATCH 10/10] test: " Ferruh Yigit 2019-09-05 15:45 ` Honnappa Nagarahalli
Reply instructions: You may reply publically to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190905145315.19395-9-ferruh.yigit@intel.com \ --to=ferruh.yigit@intel.com \ --cc=adrien.mazarguil@6wind.com \ --cc=bernard.iremonger@intel.com \ --cc=dev@dpdk.org \ --cc=jingjing.wu@intel.com \ --cc=stable@dpdk.org \ --cc=wenzhuo.lu@intel.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
patches for DPDK stable branches Archives are clonable: git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \ stable@dpdk.org public-inbox-index stable Newsgroup available over NNTP: nntp://inbox.dpdk.org/inbox.dpdk.stable AGPL code for this site: git clone https://public-inbox.org/ public-inbox