From patchwork Fri Aug 25 19:21:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Harton X-Patchwork-Id: 28017 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id A1B7A7D22; Fri, 25 Aug 2017 21:21:09 +0200 (CEST) Received: from alln-iport-1.cisco.com (alln-iport-1.cisco.com [173.37.142.88]) by dpdk.org (Postfix) with ESMTP id 2F98C7D1C for ; Fri, 25 Aug 2017 21:21:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=3847; q=dns/txt; s=iport; t=1503688867; x=1504898467; h=from:to:cc:subject:date:message-id; bh=TnVKuYXkWkxmoGx5PRBFibGYC6t8MY5knv46BGSmreI=; b=cZKuTJHEmtYlYhIlc6iSbpUy3CqH8ZwslVrrynoSOAAvYBnl8HEcnVFk IWSbei/6ROgh6a4mRWX5OTMrmEdJ0VUIqmEkyLCCLRhg9HtnPrdBoEYwH e0ol9jd44dOqTayVYisCZUFQcL3/4G+rb/PQIfX4qMsRMGflUg5nxPPM+ o=; X-IronPort-AV: E=Sophos;i="5.41,426,1498521600"; d="scan'208";a="448476101" Received: from alln-core-5.cisco.com ([173.36.13.138]) by alln-iport-1.cisco.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 25 Aug 2017 19:21:06 +0000 Received: from cpp-rtpbld-31.cisco.com (cpp-rtpbld-31.cisco.com [172.18.5.114]) by alln-core-5.cisco.com (8.14.5/8.14.5) with ESMTP id v7PJL5W1025726; Fri, 25 Aug 2017 19:21:06 GMT Received: by cpp-rtpbld-31.cisco.com (Postfix, from userid 140087) id BA8575C6; Fri, 25 Aug 2017 15:21:05 -0400 (EDT) From: David Harton To: konstantin.ananyev@intel.com Cc: dev@dpdk.org, David Harton Date: Fri, 25 Aug 2017 15:21:04 -0400 Message-Id: <20170825192104.37699-1-dharton@cisco.com> X-Mailer: git-send-email 2.10.3.dirty Subject: [dpdk-dev] [PATCH] ixgbe: eliminate duplicate filterlist symbols X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 1ec5aaf..ed21af5 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -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)); diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h index caa50c8..3f1aeb5 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.h +++ b/drivers/net/ixgbe/ixgbe_ethdev.h @@ -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 diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c index d679608..6dbfd25 100644 --- a/drivers/net/ixgbe/ixgbe_flow.c +++ b/drivers/net/ixgbe/ixgbe_flow.c @@ -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;