Skip to contentSkip to conversation

ixgbe: eliminate duplicate filterlist symbols

PATCH Superseded David Harton 3 participants 12 messages Aug 25, 2017 – Sep 18, 2017 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ixgbe: eliminate duplicate filterlist symbols

Some compilers generate warnings for duplicate symbols for the set of filter lists current defined in ixgbe_ethdev.h. This commits moves the defintion and declaration to the source file that actually uses them and provides a function to initialize the values akin to its flush function.

---
 drivers/net/ixgbe/ixgbe_ethdev.c |  8 ++------
 drivers/net/ixgbe/ixgbe_ethdev.h |  7 +------
 drivers/net/ixgbe/ixgbe_flow.c   | 18 ++++++++++++++++++
 3 files changed, 21 insertions(+), 12 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +2 -6
index 1ec5aaf..ed21af5 100644
@@ -1332,12 +1332,8 @@ struct rte_ixgbe_xstats_name_off {
 	/* initialize l2 tunnel filter list & hash */
 	ixgbe_l2_tn_filter_init(eth_dev);
 
-	TAILQ_INIT(&filter_ntuple_list);
-	TAILQ_INIT(&filter_ethertype_list);
-	TAILQ_INIT(&filter_syn_list);
-	TAILQ_INIT(&filter_fdir_list);
-	TAILQ_INIT(&filter_l2_tunnel_list);
-	TAILQ_INIT(&ixgbe_flow_list);
+	/* initialize flow filter lists */
+	ixgbe_filterlist_init();
 
 	/* initialize bandwidth configuration info */
 	memset(bw_conf, 0, sizeof(struct ixgbe_bw_conf));
drivers/net/ixgbe/ixgbe_ethdev.h +1 -6
index caa50c8..3f1aeb5 100644
@@ -396,17 +396,11 @@ struct ixgbe_flow_mem {
 };
 
 TAILQ_HEAD(ixgbe_ntuple_filter_list, ixgbe_ntuple_filter_ele);
-struct ixgbe_ntuple_filter_list filter_ntuple_list;
 TAILQ_HEAD(ixgbe_ethertype_filter_list, ixgbe_ethertype_filter_ele);
-struct ixgbe_ethertype_filter_list filter_ethertype_list;
 TAILQ_HEAD(ixgbe_syn_filter_list, ixgbe_eth_syn_filter_ele);
-struct ixgbe_syn_filter_list filter_syn_list;
 TAILQ_HEAD(ixgbe_fdir_rule_filter_list, ixgbe_fdir_rule_ele);
-struct ixgbe_fdir_rule_filter_list filter_fdir_list;
 TAILQ_HEAD(ixgbe_l2_tunnel_filter_list, ixgbe_eth_l2_tunnel_conf_ele);
-struct ixgbe_l2_tunnel_filter_list filter_l2_tunnel_list;
 TAILQ_HEAD(ixgbe_flow_mem_list, ixgbe_flow_mem);
-struct ixgbe_flow_mem_list ixgbe_flow_list;
 
 /*
  * Statistics counters collected by the MACsec
@@ -692,6 +686,7 @@ int ixgbe_syn_filter_set(struct rte_eth_dev *dev,
 int
 ixgbe_dev_l2_tunnel_filter_del(struct rte_eth_dev *dev,
 			       struct rte_eth_l2_tunnel_conf *l2_tunnel);
+void ixgbe_filterlist_init(void);
 void ixgbe_filterlist_flush(void);
 /*
  * Flow director function prototypes
drivers/net/ixgbe/ixgbe_flow.c +18 -0
index d679608..6dbfd25 100644
@@ -79,6 +79,13 @@
 #define IXGBE_MAX_N_TUPLE_PRIO 7
 #define IXGBE_MAX_FLX_SOURCE_OFF 62
 
+static struct ixgbe_ntuple_filter_list filter_ntuple_list;
+static struct ixgbe_ethertype_filter_list filter_ethertype_list;
+static struct ixgbe_syn_filter_list filter_syn_list;
+static struct ixgbe_fdir_rule_filter_list filter_fdir_list;
+static struct ixgbe_l2_tunnel_filter_list filter_l2_tunnel_list;
+static struct ixgbe_flow_mem_list ixgbe_flow_list;
+
 /**
  * Endless loop will never happen with below assumption
  * 1. there is at least one no-void item(END)
@@ -2600,6 +2607,17 @@ static inline uint8_t signature_match(const struct rte_flow_item pattern[])
 }
 
 void
+ixgbe_filterlist_init(void)
+{
+	TAILQ_INIT(&filter_ntuple_list);
+	TAILQ_INIT(&filter_ethertype_list);
+	TAILQ_INIT(&filter_syn_list);
+	TAILQ_INIT(&filter_fdir_list);
+	TAILQ_INIT(&filter_l2_tunnel_list);
+	TAILQ_INIT(&ixgbe_flow_list);
+}
+
+void
 ixgbe_filterlist_flush(void)
 {
 	struct ixgbe_ntuple_filter_ele *ntuple_filter_ptr;
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 19 lines · David Harton

Some compilers generate warnings for duplicate symbols for the set of filter lists current defined in ixgbe_ethdev.h. This commits moves the defintion and declaration to the source file that actually uses them and provides a function to initialize the values akin to its flush function.

---
 drivers/net/ixgbe/ixgbe_ethdev.c |  8 ++------
 drivers/net/ixgbe/ixgbe_ethdev.h |  7 +------
 drivers/net/ixgbe/ixgbe_flow.c   | 18 ++++++++++++++++++
 3 files changed, 21 insertions(+), 12 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
index 1ec5aaf..ed21af5 100644
@@ -1332,12 +1332,8 @@ struct rte_ixgbe_xstats_name_off {
 	/* initialize l2 tunnel filter list & hash */

drivers/net/ixgbe/ixgbe_ethdev.c struct rte_ixgbe_xstats_name_off { · line 1336

Quoted 10 lines
drivers/net/ixgbe/ixgbe_ethdev.c +2 -6
 	ixgbe_l2_tn_filter_init(eth_dev);
 
-	TAILQ_INIT(&filter_ntuple_list);
-	TAILQ_INIT(&filter_ethertype_list);
-	TAILQ_INIT(&filter_syn_list);
-	TAILQ_INIT(&filter_fdir_list);
-	TAILQ_INIT(&filter_l2_tunnel_list);
-	TAILQ_INIT(&ixgbe_flow_list);
+	/* initialize flow filter lists */
+	ixgbe_filterlist_init();

Will it work if list initialization converted to the static initialization? That would remove requirement of this function call.

something like:

drivers/net/ixgbe/ixgbe_flow.c +5 -0
index c8645f056..6184eb4af 100644
@@ -79,6 +79,24 @@
 #define IXGBE_MAX_N_TUPLE_PRIO 7
 #define IXGBE_MAX_FLX_SOURCE_OFF 62
 
+static TAILQ_HEAD(ixgbe_ntuple_filter_list, ixgbe_ntuple_filter_ele)
+       filter_ntuple_list = TAILQ_HEAD_INITIALIZER(filter_ntuple_list);
+
+static TAILQ_HEAD(ixgbe_ethertype_filter_list, ixgbe_ethertype_filter_ele)
+       filter_ethertype_list =

TAILQ_HEAD_INITIALIZER(filter_ethertype_list);
+
+static TAILQ_HEAD(ixgbe_syn_filter_list, ixgbe_eth_syn_filter_ele)
+ filter_syn_list = TAILQ_HEAD_INITIALIZER(filter_syn_list);
+
+static TAILQ_HEAD(ixgbe_fdir_rule_filter_list, ixgbe_fdir_rule_ele)
+ filter_fdir_list = TAILQ_HEAD_INITIALIZER(filter_fdir_list);
+
+static TAILQ_HEAD(ixgbe_l2_tunnel_filter_list, ixgbe_eth_l2_tunnel_conf_ele)
+ filter_l2_tunnel_list =
TAILQ_HEAD_INITIALIZER(filter_l2_tunnel_list);
+
+static TAILQ_HEAD(ixgbe_flow_mem_list, ixgbe_flow_mem)
+ ixgbe_flow_list = TAILQ_HEAD_INITIALIZER(ixgbe_flow_list);
+

#2 lore raw
Quoted 34 lines

-----Original Message-----
From: Ferruh Yigit [mailto:[email protected]]
Sent: Monday, August 28, 2017 9:27 AM
To: David Harton (dharton) <[email protected]>; [email protected]
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH] ixgbe: eliminate duplicate filterlist symbols

Quoted 22 lines · David Harton

Some compilers generate warnings for duplicate symbols for the set of filter lists current defined in ixgbe_ethdev.h.
This commits moves the defintion and declaration to the source file that actually uses them and provides a function to initialize the values akin to its flush function.

---
 drivers/net/ixgbe/ixgbe_ethdev.c |  8 ++------
drivers/net/ixgbe/ixgbe_ethdev.h |  7 +------
 drivers/net/ixgbe/ixgbe_flow.c   | 18 ++++++++++++++++++
 3 files changed, 21 insertions(+), 12 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
index 1ec5aaf..ed21af5 100644
@@ -1332,12 +1332,8 @@ struct rte_ixgbe_xstats_name_off {
 	/* initialize l2 tunnel filter list & hash */
 	ixgbe_l2_tn_filter_init(eth_dev);
 
Quoted 11 lines

drivers/net/ixgbe/ixgbe_ethdev.c struct rte_ixgbe_xstats_name_off { · line 1336

Quoted 8 lines
drivers/net/ixgbe/ixgbe_ethdev.c +2 -6
-	TAILQ_INIT(&filter_ntuple_list);
-	TAILQ_INIT(&filter_ethertype_list);
-	TAILQ_INIT(&filter_syn_list);
-	TAILQ_INIT(&filter_fdir_list);
-	TAILQ_INIT(&filter_l2_tunnel_list);
-	TAILQ_INIT(&ixgbe_flow_list);
+	/* initialize flow filter lists */
+	ixgbe_filterlist_init();

Will it work if list initialization converted to the static initialization? That would remove requirement of this function call.

I was trying to keep the behavior the same:
.probe -> eth_ixgbe_dev_init -> ixgbe_filterlist_init .remove -> eth_ixgbe_dev_uninit -> ixgbe_filterlist_flush

While I think the below would work I always like mirror/parallel relationships like ctor/dtor for objects.

Is that reasonable?

Thanks,
Dave

Quoted 33 lines

something like:

(quoted diff) +0 -0

b/drivers/net/ixgbe/ixgbe_flow.c index c8645f056..6184eb4af 100644

drivers/net/ixgbe/ixgbe_flow.c +14 -0
@@ -79,6 +79,24 @@
 #define IXGBE_MAX_N_TUPLE_PRIO 7
 #define IXGBE_MAX_FLX_SOURCE_OFF 62
 
+static TAILQ_HEAD(ixgbe_ntuple_filter_list, ixgbe_ntuple_filter_ele)
+       filter_ntuple_list = TAILQ_HEAD_INITIALIZER(filter_ntuple_list);
+
+static TAILQ_HEAD(ixgbe_ethertype_filter_list,
 ixgbe_ethertype_filter_ele)
+       filter_ethertype_list =
 TAILQ_HEAD_INITIALIZER(filter_ethertype_list);
+
+static TAILQ_HEAD(ixgbe_syn_filter_list, ixgbe_eth_syn_filter_ele)
+       filter_syn_list = TAILQ_HEAD_INITIALIZER(filter_syn_list);
+
+static TAILQ_HEAD(ixgbe_fdir_rule_filter_list, ixgbe_fdir_rule_ele)
+       filter_fdir_list = TAILQ_HEAD_INITIALIZER(filter_fdir_list);
+
+static TAILQ_HEAD(ixgbe_l2_tunnel_filter_list,
 ixgbe_eth_l2_tunnel_conf_ele)
+       filter_l2_tunnel_list =

TAILQ_HEAD_INITIALIZER(filter_l2_tunnel_list);

drivers/net/ixgbe/ixgbe_flow.c +4 -0
+
+static TAILQ_HEAD(ixgbe_flow_mem_list, ixgbe_flow_mem)
+       ixgbe_flow_list = TAILQ_HEAD_INITIALIZER(ixgbe_flow_list);
+
#3 lore raw
Quoted 46 lines · David Harton (dharton)
Quoted 34 lines

-----Original Message-----
From: Ferruh Yigit [mailto:[email protected]]
Sent: Monday, August 28, 2017 9:27 AM
To: David Harton (dharton) <[email protected]>; [email protected]
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH] ixgbe: eliminate duplicate filterlist symbols

Quoted 22 lines · David Harton

Some compilers generate warnings for duplicate symbols for the set of filter lists current defined in ixgbe_ethdev.h.
This commits moves the defintion and declaration to the source file that actually uses them and provides a function to initialize the values akin to its flush function.

---
 drivers/net/ixgbe/ixgbe_ethdev.c |  8 ++------
drivers/net/ixgbe/ixgbe_ethdev.h |  7 +------
 drivers/net/ixgbe/ixgbe_flow.c   | 18 ++++++++++++++++++
 3 files changed, 21 insertions(+), 12 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
index 1ec5aaf..ed21af5 100644
@@ -1332,12 +1332,8 @@ struct rte_ixgbe_xstats_name_off {
 	/* initialize l2 tunnel filter list & hash */
 	ixgbe_l2_tn_filter_init(eth_dev);
 
Quoted 11 lines

drivers/net/ixgbe/ixgbe_ethdev.c struct rte_ixgbe_xstats_name_off { · line 1336

Quoted 8 lines
drivers/net/ixgbe/ixgbe_ethdev.c +2 -6
-	TAILQ_INIT(&filter_ntuple_list);
-	TAILQ_INIT(&filter_ethertype_list);
-	TAILQ_INIT(&filter_syn_list);
-	TAILQ_INIT(&filter_fdir_list);
-	TAILQ_INIT(&filter_l2_tunnel_list);
-	TAILQ_INIT(&ixgbe_flow_list);
+	/* initialize flow filter lists */
+	ixgbe_filterlist_init();

Will it work if list initialization converted to the static initialization? That would remove requirement of this function call.

Quoted 5 lines

I was trying to keep the behavior the same:
.probe -> eth_ixgbe_dev_init -> ixgbe_filterlist_init .remove -> eth_ixgbe_dev_uninit -> ixgbe_filterlist_flush

While I think the below would work I always like mirror/parallel relationships like ctor/dtor for objects.

I would agree if ixgbe_filterlist_init() initializes something more than list itself, but for this case initialization can be avoided completely which I would prefer.

Driver maintainer also cc'ed for more comment.

Quoted 39 lines

Is that reasonable?

Thanks,
Dave

Quoted 33 lines

something like:

(quoted diff) +0 -0

b/drivers/net/ixgbe/ixgbe_flow.c index c8645f056..6184eb4af 100644

drivers/net/ixgbe/ixgbe_flow.c +14 -0
@@ -79,6 +79,24 @@
 #define IXGBE_MAX_N_TUPLE_PRIO 7
 #define IXGBE_MAX_FLX_SOURCE_OFF 62
 
+static TAILQ_HEAD(ixgbe_ntuple_filter_list, ixgbe_ntuple_filter_ele)
+       filter_ntuple_list = TAILQ_HEAD_INITIALIZER(filter_ntuple_list);
+
+static TAILQ_HEAD(ixgbe_ethertype_filter_list,
 ixgbe_ethertype_filter_ele)
+       filter_ethertype_list =
 TAILQ_HEAD_INITIALIZER(filter_ethertype_list);
+
+static TAILQ_HEAD(ixgbe_syn_filter_list, ixgbe_eth_syn_filter_ele)
+       filter_syn_list = TAILQ_HEAD_INITIALIZER(filter_syn_list);
+
+static TAILQ_HEAD(ixgbe_fdir_rule_filter_list, ixgbe_fdir_rule_ele)
+       filter_fdir_list = TAILQ_HEAD_INITIALIZER(filter_fdir_list);
+
+static TAILQ_HEAD(ixgbe_l2_tunnel_filter_list,
 ixgbe_eth_l2_tunnel_conf_ele)
+       filter_l2_tunnel_list =

TAILQ_HEAD_INITIALIZER(filter_l2_tunnel_list);

drivers/net/ixgbe/ixgbe_flow.c +4 -0
+
+static TAILQ_HEAD(ixgbe_flow_mem_list, ixgbe_flow_mem)
+       ixgbe_flow_list = TAILQ_HEAD_INITIALIZER(ixgbe_flow_list);
+
#4 lore raw
Quoted 51 lines · Ferruh Yigit
Quoted 50 lines · David Harton (dharton)
Quoted 34 lines

-----Original Message-----
From: Ferruh Yigit [mailto:[email protected]]
Sent: Monday, August 28, 2017 9:27 AM
To: David Harton (dharton) <[email protected]>; [email protected]
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH] ixgbe: eliminate duplicate filterlist symbols

Quoted 22 lines · David Harton

Some compilers generate warnings for duplicate symbols for the set of filter lists current defined in ixgbe_ethdev.h.
This commits moves the defintion and declaration to the source file that actually uses them and provides a function to initialize the values akin to its flush function.

---
 drivers/net/ixgbe/ixgbe_ethdev.c |  8 ++------
drivers/net/ixgbe/ixgbe_ethdev.h |  7 +------
 drivers/net/ixgbe/ixgbe_flow.c   | 18 ++++++++++++++++++
 3 files changed, 21 insertions(+), 12 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
index 1ec5aaf..ed21af5 100644
@@ -1332,12 +1332,8 @@ struct rte_ixgbe_xstats_name_off {
 	/* initialize l2 tunnel filter list & hash */
 	ixgbe_l2_tn_filter_init(eth_dev);
 
Quoted 11 lines

drivers/net/ixgbe/ixgbe_ethdev.c struct rte_ixgbe_xstats_name_off { · line 1336

Quoted 8 lines
drivers/net/ixgbe/ixgbe_ethdev.c +2 -6
-	TAILQ_INIT(&filter_ntuple_list);
-	TAILQ_INIT(&filter_ethertype_list);
-	TAILQ_INIT(&filter_syn_list);
-	TAILQ_INIT(&filter_fdir_list);
-	TAILQ_INIT(&filter_l2_tunnel_list);
-	TAILQ_INIT(&ixgbe_flow_list);
+	/* initialize flow filter lists */
+	ixgbe_filterlist_init();

Will it work if list initialization converted to the static initialization? That would remove requirement of this function call.

I was trying to keep the behavior the same:
.probe -> eth_ixgbe_dev_init -> ixgbe_filterlist_init .remove -> eth_ixgbe_dev_uninit -> ixgbe_filterlist_flush

Quoted 7 lines
Quoted 1 line

While I think the below would work I always like mirror/parallel relationships like ctor/dtor for objects.

I would agree if ixgbe_filterlist_init() initializes something more than list itself, but for this case initialization can be avoided completely which I would prefer.

Driver maintainer also cc'ed for more comment.

It seems there is no more comment. So, I suggest lets focus on your fix, my suggestion to convert to static initialization can be done later if desired.

Still, what do you think about moving declaration of structs as well to the ixgbe_flow.c? After your change, only ixgbe_flow.c will be using them, no need to keep them in ixgbe_ethdev.h.

Thanks,
ferruh

Quoted 41 lines
Quoted 40 lines

Is that reasonable?

Thanks,
Dave

Quoted 33 lines

something like:

(quoted diff) +0 -0

b/drivers/net/ixgbe/ixgbe_flow.c index c8645f056..6184eb4af 100644

drivers/net/ixgbe/ixgbe_flow.c +14 -0
@@ -79,6 +79,24 @@
 #define IXGBE_MAX_N_TUPLE_PRIO 7
 #define IXGBE_MAX_FLX_SOURCE_OFF 62
 
+static TAILQ_HEAD(ixgbe_ntuple_filter_list, ixgbe_ntuple_filter_ele)
+       filter_ntuple_list = TAILQ_HEAD_INITIALIZER(filter_ntuple_list);
+
+static TAILQ_HEAD(ixgbe_ethertype_filter_list,
 ixgbe_ethertype_filter_ele)
+       filter_ethertype_list =
 TAILQ_HEAD_INITIALIZER(filter_ethertype_list);
+
+static TAILQ_HEAD(ixgbe_syn_filter_list, ixgbe_eth_syn_filter_ele)
+       filter_syn_list = TAILQ_HEAD_INITIALIZER(filter_syn_list);
+
+static TAILQ_HEAD(ixgbe_fdir_rule_filter_list, ixgbe_fdir_rule_ele)
+       filter_fdir_list = TAILQ_HEAD_INITIALIZER(filter_fdir_list);
+
+static TAILQ_HEAD(ixgbe_l2_tunnel_filter_list,
 ixgbe_eth_l2_tunnel_conf_ele)
+       filter_l2_tunnel_list =

TAILQ_HEAD_INITIALIZER(filter_l2_tunnel_list);

drivers/net/ixgbe/ixgbe_flow.c +4 -0
+
+static TAILQ_HEAD(ixgbe_flow_mem_list, ixgbe_flow_mem)
+       ixgbe_flow_list = TAILQ_HEAD_INITIALIZER(ixgbe_flow_list);
+
#5 lore raw
Quoted 72 lines

-----Original Message-----
From: Ferruh Yigit [mailto:[email protected]]
Sent: Thursday, September 14, 2017 6:10 AM
To: David Harton (dharton) <[email protected]>; [email protected]
Cc: [email protected]; Wenzhuo Lu <[email protected]>
Subject: Re: [dpdk-dev] [PATCH] ixgbe: eliminate duplicate filterlist symbols

Quoted 47 lines · Ferruh Yigit
Quoted 46 lines · David Harton (dharton)
Quoted 45 lines

-----Original Message-----
From: Ferruh Yigit [mailto:[email protected]]
Sent: Monday, August 28, 2017 9:27 AM
To: David Harton (dharton) <[email protected]>; [email protected]
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH] ixgbe: eliminate duplicate filterlist symbols

Quoted 20 lines · David Harton

Some compilers generate warnings for duplicate symbols for the set of filter lists current defined in ixgbe_ethdev.h.
This commits moves the defintion and declaration to the source file that actually uses them and provides a function to initialize the values akin to its flush function.

---
 drivers/net/ixgbe/ixgbe_ethdev.c |  8 ++------
drivers/net/ixgbe/ixgbe_ethdev.h |  7 +------
 drivers/net/ixgbe/ixgbe_flow.c   | 18 ++++++++++++++++++
 3 files changed, 21 insertions(+), 12 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
index 1ec5aaf..ed21af5 100644
@@ -1332,12 +1332,8 @@ struct rte_ixgbe_xstats_name_off {
 	/* initialize l2 tunnel filter list & hash */

drivers/net/ixgbe/ixgbe_ethdev.c struct rte_ixgbe_xstats_name_off { · line 1336

Quoted 10 lines
drivers/net/ixgbe/ixgbe_ethdev.c +2 -6
 	ixgbe_l2_tn_filter_init(eth_dev);
 
-	TAILQ_INIT(&filter_ntuple_list);
-	TAILQ_INIT(&filter_ethertype_list);
-	TAILQ_INIT(&filter_syn_list);
-	TAILQ_INIT(&filter_fdir_list);
-	TAILQ_INIT(&filter_l2_tunnel_list);
-	TAILQ_INIT(&ixgbe_flow_list);
+	/* initialize flow filter lists */
+	ixgbe_filterlist_init();

Will it work if list initialization converted to the static initialization? That would remove requirement of this function call.

Quoted 5 lines
Quoted 5 lines

I was trying to keep the behavior the same:
.probe -> eth_ixgbe_dev_init -> ixgbe_filterlist_init .remove -> eth_ixgbe_dev_uninit -> ixgbe_filterlist_flush

While I think the below would work I always like mirror/parallel

relationships like ctor/dtor for objects.

Quoted 6 lines

I would agree if ixgbe_filterlist_init() initializes something more than list itself, but for this case initialization can be avoided completely which I would prefer.

Driver maintainer also cc'ed for more comment.

Quoted 7 lines

It seems there is no more comment. So, I suggest lets focus on your fix, my suggestion to convert to static initialization can be done later if desired.

Still, what do you think about moving declaration of structs as well to the ixgbe_flow.c? After your change, only ixgbe_flow.c will be using them, no need to keep them in ixgbe_ethdev.h.

Works for me. Let me make the changes and test.

Regards,
Dave

Quoted 46 lines

Thanks,
ferruh

Quoted 42 lines
Quoted 41 lines

Is that reasonable?

Thanks,
Dave

Quoted 34 lines

something like:

(quoted diff) +0 -0

b/drivers/net/ixgbe/ixgbe_flow.c index c8645f056..6184eb4af 100644

drivers/net/ixgbe/ixgbe_flow.c +15 -0
@@ -79,6 +79,24 @@
 #define IXGBE_MAX_N_TUPLE_PRIO 7
 #define IXGBE_MAX_FLX_SOURCE_OFF 62
 
+static TAILQ_HEAD(ixgbe_ntuple_filter_list, ixgbe_ntuple_filter_ele)
+       filter_ntuple_list =
+TAILQ_HEAD_INITIALIZER(filter_ntuple_list);
+
+static TAILQ_HEAD(ixgbe_ethertype_filter_list,
 ixgbe_ethertype_filter_ele)
+       filter_ethertype_list =
 TAILQ_HEAD_INITIALIZER(filter_ethertype_list);
+
+static TAILQ_HEAD(ixgbe_syn_filter_list, ixgbe_eth_syn_filter_ele)
+       filter_syn_list = TAILQ_HEAD_INITIALIZER(filter_syn_list);
+
+static TAILQ_HEAD(ixgbe_fdir_rule_filter_list, ixgbe_fdir_rule_ele)
+       filter_fdir_list = TAILQ_HEAD_INITIALIZER(filter_fdir_list);
+
+static TAILQ_HEAD(ixgbe_l2_tunnel_filter_list,
 ixgbe_eth_l2_tunnel_conf_ele)
+       filter_l2_tunnel_list =

TAILQ_HEAD_INITIALIZER(filter_l2_tunnel_list);

drivers/net/ixgbe/ixgbe_flow.c +4 -0
+
+static TAILQ_HEAD(ixgbe_flow_mem_list, ixgbe_flow_mem)
+       ixgbe_flow_list = TAILQ_HEAD_INITIALIZER(ixgbe_flow_list);
+
#6 lore raw
In reply to Ferruh Yigit

Hi Konstantin,

A gentle reminder to weigh in on this patch and the discussion between Ferruh and myself below.

Thanks,
Dave

Quoted 87 lines

-----Original Message-----
From: David Harton (dharton)

Quoted 26 lines

-----Original Message-----
From: Ferruh Yigit [mailto:[email protected]]

Quoted 22 lines · David Harton

Some compilers generate warnings for duplicate symbols for the set of filter lists current defined in ixgbe_ethdev.h.
This commits moves the defintion and declaration to the source file that actually uses them and provides a function to initialize the values akin to its flush function.

---
 drivers/net/ixgbe/ixgbe_ethdev.c |  8 ++------
drivers/net/ixgbe/ixgbe_ethdev.h |  7 +------
 drivers/net/ixgbe/ixgbe_flow.c   | 18 ++++++++++++++++++
 3 files changed, 21 insertions(+), 12 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +0 -0
index 1ec5aaf..ed21af5 100644
@@ -1332,12 +1332,8 @@ struct rte_ixgbe_xstats_name_off {
 	/* initialize l2 tunnel filter list & hash */
 	ixgbe_l2_tn_filter_init(eth_dev);
 
Quoted 11 lines

drivers/net/ixgbe/ixgbe_ethdev.c struct rte_ixgbe_xstats_name_off { · line 1336

Quoted 8 lines
drivers/net/ixgbe/ixgbe_ethdev.c +2 -6
-	TAILQ_INIT(&filter_ntuple_list);
-	TAILQ_INIT(&filter_ethertype_list);
-	TAILQ_INIT(&filter_syn_list);
-	TAILQ_INIT(&filter_fdir_list);
-	TAILQ_INIT(&filter_l2_tunnel_list);
-	TAILQ_INIT(&ixgbe_flow_list);
+	/* initialize flow filter lists */
+	ixgbe_filterlist_init();

Will it work if list initialization converted to the static initialization? That would remove requirement of this function call.

I was trying to keep the behavior the same:
.probe -> eth_ixgbe_dev_init -> ixgbe_filterlist_init .remove -> eth_ixgbe_dev_uninit -> ixgbe_filterlist_flush

While I think the below would work I always like mirror/parallel relationships like ctor/dtor for objects.

Is that reasonable?

Thanks,
Dave

Quoted 34 lines

something like:

(quoted diff) +0 -0

b/drivers/net/ixgbe/ixgbe_flow.c index c8645f056..6184eb4af 100644

drivers/net/ixgbe/ixgbe_flow.c +15 -0
@@ -79,6 +79,24 @@
 #define IXGBE_MAX_N_TUPLE_PRIO 7
 #define IXGBE_MAX_FLX_SOURCE_OFF 62
 
+static TAILQ_HEAD(ixgbe_ntuple_filter_list, ixgbe_ntuple_filter_ele)
+       filter_ntuple_list =
+TAILQ_HEAD_INITIALIZER(filter_ntuple_list);
+
+static TAILQ_HEAD(ixgbe_ethertype_filter_list,
 ixgbe_ethertype_filter_ele)
+       filter_ethertype_list =
 TAILQ_HEAD_INITIALIZER(filter_ethertype_list);
+
+static TAILQ_HEAD(ixgbe_syn_filter_list, ixgbe_eth_syn_filter_ele)
+       filter_syn_list = TAILQ_HEAD_INITIALIZER(filter_syn_list);
+
+static TAILQ_HEAD(ixgbe_fdir_rule_filter_list, ixgbe_fdir_rule_ele)
+       filter_fdir_list = TAILQ_HEAD_INITIALIZER(filter_fdir_list);
+
+static TAILQ_HEAD(ixgbe_l2_tunnel_filter_list,
 ixgbe_eth_l2_tunnel_conf_ele)
+       filter_l2_tunnel_list =

TAILQ_HEAD_INITIALIZER(filter_l2_tunnel_list);

drivers/net/ixgbe/ixgbe_flow.c +4 -0
+
+static TAILQ_HEAD(ixgbe_flow_mem_list, ixgbe_flow_mem)
+       ixgbe_flow_list = TAILQ_HEAD_INITIALIZER(ixgbe_flow_list);
+
#7 lore raw

PATCH v2 1/1 ixgbe: eliminate duplicate filterlist symbols

In reply to David Harton

From: David Harton <[email protected]>

Some compilers generate warnings for duplicate symbols for the set of filter lists current defined in ixgbe_ethdev.h. This commits moves the defintion and declaration to the source file that actually uses them and provides a function to initialize the values akin to its flush function.

---

v2
* Moved flow filter structs to ixgbe_flow.c.

v1
* Moved flow filter definitions and initialization to ixgbe_flow.c.

 drivers/net/ixgbe/ixgbe_ethdev.c |  8 ++----
 drivers/net/ixgbe/ixgbe_ethdev.h | 44 +------------------------------
 drivers/net/ixgbe/ixgbe_flow.c   | 56 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 59 insertions(+), 49 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +2 -6
index 1ec5aaf..ed21af5 100644
@@ -1332,12 +1332,8 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev)
 	/* initialize l2 tunnel filter list & hash */
 	ixgbe_l2_tn_filter_init(eth_dev);
 
-	TAILQ_INIT(&filter_ntuple_list);
-	TAILQ_INIT(&filter_ethertype_list);
-	TAILQ_INIT(&filter_syn_list);
-	TAILQ_INIT(&filter_fdir_list);
-	TAILQ_INIT(&filter_l2_tunnel_list);
-	TAILQ_INIT(&ixgbe_flow_list);
+	/* initialize flow filter lists */
+	ixgbe_filterlist_init();
 
 	/* initialize bandwidth configuration info */
 	memset(bw_conf, 0, sizeof(struct ixgbe_bw_conf));
drivers/net/ixgbe/ixgbe_ethdev.h +1 -43

56 lines not on this page · raw message

drivers/net/ixgbe/ixgbe_flow.c +56 -0

68 lines not on this page · raw message

Signature · 1 line
2.10.3.dirty
#8 lore raw

PATCH v3 1/1 ixgbe: eliminate duplicate filterlist symbols

From: David Harton <[email protected]>

Some compilers generate warnings for duplicate symbols for the set of filter lists current defined in ixgbe_ethdev.h. This commits moves the definition and declaration to the source file that actually uses them and provides a function to initialize the values akin to its flush function.

---

v3
* Fixed spelling in commit message. Not sure why running checkpatches.sh locally didn't catch it. :(

v2
* Moved flow filter structs to ixgbe_flow.c.

v1
* Moved flow filter definitions and initialization to ixgbe_flow.c.

 drivers/net/ixgbe/ixgbe_ethdev.c |  8 ++----
 drivers/net/ixgbe/ixgbe_ethdev.h | 44 +------------------------------
 drivers/net/ixgbe/ixgbe_flow.c   | 56 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 59 insertions(+), 49 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +2 -6
index 1ec5aaf..ed21af5 100644
@@ -1332,12 +1332,8 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev)
 	/* initialize l2 tunnel filter list & hash */
 	ixgbe_l2_tn_filter_init(eth_dev);
 
-	TAILQ_INIT(&filter_ntuple_list);
-	TAILQ_INIT(&filter_ethertype_list);
-	TAILQ_INIT(&filter_syn_list);
-	TAILQ_INIT(&filter_fdir_list);
-	TAILQ_INIT(&filter_l2_tunnel_list);
-	TAILQ_INIT(&ixgbe_flow_list);
+	/* initialize flow filter lists */
+	ixgbe_filterlist_init();
 
 	/* initialize bandwidth configuration info */
 	memset(bw_conf, 0, sizeof(struct ixgbe_bw_conf));
drivers/net/ixgbe/ixgbe_ethdev.h +1 -43

56 lines not on this page · raw message

drivers/net/ixgbe/ixgbe_flow.c +56 -0

68 lines not on this page · raw message

Signature · 1 line
2.10.3.dirty
Reviewed-by on v3 1/1
#9 lore raw
Quoted 9 lines · David C Harton

From: David Harton <[email protected]>

Some compilers generate warnings for duplicate symbols for the set of filter lists current defined in ixgbe_ethdev.h. This commits moves the definition and declaration to the source file that actually uses them and provides a function to initialize the values akin to its flush function.

(title needs to be "net/ixgbe: ...", but this can be fixed while applying)

Reviewed-by
#10 lore raw
Quoted 9 lines · Ferruh Yigit
Quoted 8 lines · David C Harton

From: David Harton <[email protected]>

Some compilers generate warnings for duplicate symbols for the set of filter lists current defined in ixgbe_ethdev.h. This commits moves the definition and declaration to the source file that actually uses them and provides a function to initialize the values akin to its flush function.

Quoted 5 lines
Quoted 1 line

(title needs to be "net/ixgbe: ...", but this can be fixed while applying)

Applied
#11 lore raw
Quoted 11 lines · Radu Nicolau
Quoted 9 lines · Ferruh Yigit
Quoted 8 lines · David C Harton

From: David Harton <[email protected]>

Some compilers generate warnings for duplicate symbols for the set of filter lists current defined in ixgbe_ethdev.h. This commits moves the definition and declaration to the source file that actually uses them and provides a function to initialize the values akin to its flush function.

Quoted 6 lines
Quoted 5 lines
Quoted 1 line

(title needs to be "net/ixgbe: ...", but this can be fixed while applying)

Applied to dpdk-next-net/master, thanks.