ixgbe: eliminate duplicate filterlist symbols
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
@@ -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
@@ -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
@@ -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
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.Signed-off-by David Harton <[email protected]>--- 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@@ -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
-6ixgbe_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
@@ -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);
+
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 symbolsQuoted 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.Signed-off-by David Harton <[email protected]>--- 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@@ -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.cindexc8645f056..6184eb4af100644drivers/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); +
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 symbolsQuoted 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.Signed-off-by David Harton <[email protected]>--- 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@@ -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_flushWhile 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,
DaveQuoted 33 lines
something like:
(quoted diff) +0
-0
b/drivers/net/ixgbe/ixgbe_flow.cindexc8645f056..6184eb4af100644drivers/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); +
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 symbolsQuoted 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.Signed-off-by David Harton <[email protected]>--- 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@@ -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,
DaveQuoted 33 lines
something like:
(quoted diff) +0
-0
b/drivers/net/ixgbe/ixgbe_flow.cindexc8645f056..6184eb4af100644drivers/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); +
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 symbolsQuoted 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 symbolsQuoted 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.Signed-off-by David Harton <[email protected]>--- 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@@ -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
-6ixgbe_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_flushWhile 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, onlyixgbe_flow.cwill be using them, no need to keep them inixgbe_ethdev.h.
Works for me. Let me make the changes and test.
Regards,
Dave
Quoted 46 lines
Thanks,
ferruhQuoted 42 lines
Quoted 41 lines
Is that reasonable?
Thanks,
DaveQuoted 34 lines
something like:
(quoted diff) +0
-0
b/drivers/net/ixgbe/ixgbe_flow.cindexc8645f056..6184eb4af100644drivers/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); +
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.Signed-off-by David Harton <[email protected]>--- 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@@ -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_flushWhile I think the below would work I always like mirror/parallel relationships like ctor/dtor for objects.
Is that reasonable?
Thanks,
DaveQuoted 34 lines
something like:
(quoted diff) +0
-0
b/drivers/net/ixgbe/ixgbe_flow.cindexc8645f056..6184eb4af100644drivers/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); +
PATCH v2 1/1 ixgbe: eliminate duplicate filterlist symbols
In reply to David HartonFrom: 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
@@ -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
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
@@ -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
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.Signed-off-by David Harton <[email protected]>
(title needs to be "net/ixgbe: ...", but this can be fixed while applying)
Radu Nicolau
Reviewed-byQuoted 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
Signed-off-by David Harton <[email protected]>Reviewed-by Ferruh Yigit <[email protected]>(title needs to be "net/ixgbe: ...", but this can be fixed while applying)
Ferruh Yigit
AppliedQuoted 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
Signed-off-by David Harton <[email protected]>Reviewed-by Ferruh Yigit <[email protected]>(title needs to be "net/ixgbe: ...", but this can be fixed while applying)
Reviewed-by Radu Nicolau <[email protected]>
Applied to dpdk-next-net/master, thanks.