[dpdk-dev,v3] ixgbe: eliminate duplicate filterlist symbols
Checks
Commit Message
From: David Harton <dharton@cisco.com>
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 <dharton@cisco.com>
---
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(-)
Comments
On 9/14/2017 1:50 PM, David C Harton wrote:
> From: David Harton <dharton@cisco.com>
>
> 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 <dharton@cisco.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
(title needs to be "net/ixgbe: ...", but this can be fixed while applying)
On 9/14/2017 2:38 PM, Ferruh Yigit wrote:
> On 9/14/2017 1:50 PM, David C Harton wrote:
>> From: David Harton <dharton@cisco.com>
>>
>> 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 <dharton@cisco.com>
> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
>
> (title needs to be "net/ixgbe: ...", but this can be fixed while applying)
>
Reviewed-by: Radu Nicolau <radu.nicolau@intel.com>
On 9/18/2017 2:13 PM, Radu Nicolau wrote:
>
> On 9/14/2017 2:38 PM, Ferruh Yigit wrote:
>> On 9/14/2017 1:50 PM, David C Harton wrote:
>>> From: David Harton <dharton@cisco.com>
>>>
>>> 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 <dharton@cisco.com>
>> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
>>
>> (title needs to be "net/ixgbe: ...", but this can be fixed while applying)
>>
> Reviewed-by: Radu Nicolau <radu.nicolau@intel.com>
Applied to dpdk-next-net/master, thanks.
@@ -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));
@@ -364,49 +364,6 @@ struct rte_flow {
enum rte_filter_type filter_type;
void *rule;
};
-/* ntuple filter list structure */
-struct ixgbe_ntuple_filter_ele {
- TAILQ_ENTRY(ixgbe_ntuple_filter_ele) entries;
- struct rte_eth_ntuple_filter filter_info;
-};
-/* ethertype filter list structure */
-struct ixgbe_ethertype_filter_ele {
- TAILQ_ENTRY(ixgbe_ethertype_filter_ele) entries;
- struct rte_eth_ethertype_filter filter_info;
-};
-/* syn filter list structure */
-struct ixgbe_eth_syn_filter_ele {
- TAILQ_ENTRY(ixgbe_eth_syn_filter_ele) entries;
- struct rte_eth_syn_filter filter_info;
-};
-/* fdir filter list structure */
-struct ixgbe_fdir_rule_ele {
- TAILQ_ENTRY(ixgbe_fdir_rule_ele) entries;
- struct ixgbe_fdir_rule filter_info;
-};
-/* l2_tunnel filter list structure */
-struct ixgbe_eth_l2_tunnel_conf_ele {
- TAILQ_ENTRY(ixgbe_eth_l2_tunnel_conf_ele) entries;
- struct rte_eth_l2_tunnel_conf filter_info;
-};
-/* ixgbe_flow memory list structure */
-struct ixgbe_flow_mem {
- TAILQ_ENTRY(ixgbe_flow_mem) entries;
- struct rte_flow *flow;
-};
-
-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 +649,7 @@ ixgbe_dev_l2_tunnel_filter_add(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
@@ -79,6 +79,51 @@
#define IXGBE_MAX_N_TUPLE_PRIO 7
#define IXGBE_MAX_FLX_SOURCE_OFF 62
+/* ntuple filter list structure */
+struct ixgbe_ntuple_filter_ele {
+ TAILQ_ENTRY(ixgbe_ntuple_filter_ele) entries;
+ struct rte_eth_ntuple_filter filter_info;
+};
+/* ethertype filter list structure */
+struct ixgbe_ethertype_filter_ele {
+ TAILQ_ENTRY(ixgbe_ethertype_filter_ele) entries;
+ struct rte_eth_ethertype_filter filter_info;
+};
+/* syn filter list structure */
+struct ixgbe_eth_syn_filter_ele {
+ TAILQ_ENTRY(ixgbe_eth_syn_filter_ele) entries;
+ struct rte_eth_syn_filter filter_info;
+};
+/* fdir filter list structure */
+struct ixgbe_fdir_rule_ele {
+ TAILQ_ENTRY(ixgbe_fdir_rule_ele) entries;
+ struct ixgbe_fdir_rule filter_info;
+};
+/* l2_tunnel filter list structure */
+struct ixgbe_eth_l2_tunnel_conf_ele {
+ TAILQ_ENTRY(ixgbe_eth_l2_tunnel_conf_ele) entries;
+ struct rte_eth_l2_tunnel_conf filter_info;
+};
+/* ixgbe_flow memory list structure */
+struct ixgbe_flow_mem {
+ TAILQ_ENTRY(ixgbe_flow_mem) entries;
+ struct rte_flow *flow;
+};
+
+TAILQ_HEAD(ixgbe_ntuple_filter_list, ixgbe_ntuple_filter_ele);
+TAILQ_HEAD(ixgbe_ethertype_filter_list, ixgbe_ethertype_filter_ele);
+TAILQ_HEAD(ixgbe_syn_filter_list, ixgbe_eth_syn_filter_ele);
+TAILQ_HEAD(ixgbe_fdir_rule_filter_list, ixgbe_fdir_rule_ele);
+TAILQ_HEAD(ixgbe_l2_tunnel_filter_list, ixgbe_eth_l2_tunnel_conf_ele);
+TAILQ_HEAD(ixgbe_flow_mem_list, ixgbe_flow_mem);
+
+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 +2645,17 @@ ixgbe_parse_fdir_filter(struct rte_eth_dev *dev,
}
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;