From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 4A75A7E92 for ; Mon, 20 Oct 2014 04:50:43 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 19 Oct 2014 19:48:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,749,1406617200"; d="scan'208";a="607882983" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga001.fm.intel.com with ESMTP; 19 Oct 2014 19:58:50 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id s9K2wnmx028321; Mon, 20 Oct 2014 10:58:49 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id s9K2wlKj024185; Mon, 20 Oct 2014 10:58:49 +0800 Received: (from hzhan75@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s9K2wlIn024181; Mon, 20 Oct 2014 10:58:47 +0800 From: Helin Zhang To: dev@dpdk.org Date: Mon, 20 Oct 2014 10:58:17 +0800 Message-Id: <1413773898-24137-3-git-send-email-helin.zhang@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1413773898-24137-1-git-send-email-helin.zhang@intel.com> References: <1411089280-23595-1-git-send-email-helin.zhang@intel.com> <1413773898-24137-1-git-send-email-helin.zhang@intel.com> Subject: [dpdk-dev] [PATCH v3 2/3] i40e: extern two functions and relevant macros X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2014 02:50:43 -0000 To reuse code, 'i40e_config_hena()' and 'i40e_parse_hena()' and their relevant macros need to be extern, and then can be used for both PF and VF parts. Signed-off-by: Helin Zhang --- lib/librte_pmd_i40e/i40e_ethdev.c | 34 ++-------------------------------- lib/librte_pmd_i40e/i40e_ethdev.h | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 33 deletions(-) v3 changes: * Removed macros in i40e_ehtdev.c, as they have been moved to i40e_ethdev.h. diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c b/lib/librte_pmd_i40e/i40e_ethdev.c index dbf231f..28bde90 100644 --- a/lib/librte_pmd_i40e/i40e_ethdev.c +++ b/lib/librte_pmd_i40e/i40e_ethdev.c @@ -98,36 +98,6 @@ #define I40E_PRE_TX_Q_CFG_WAIT_US 10 /* 10 us */ -#define I40E_RSS_OFFLOAD_ALL ( \ - ETH_RSS_NONF_IPV4_UDP | \ - ETH_RSS_NONF_IPV4_TCP | \ - ETH_RSS_NONF_IPV4_SCTP | \ - ETH_RSS_NONF_IPV4_OTHER | \ - ETH_RSS_FRAG_IPV4 | \ - ETH_RSS_NONF_IPV6_UDP | \ - ETH_RSS_NONF_IPV6_TCP | \ - ETH_RSS_NONF_IPV6_SCTP | \ - ETH_RSS_NONF_IPV6_OTHER | \ - ETH_RSS_FRAG_IPV6 | \ - ETH_RSS_L2_PAYLOAD) - -/* All bits of RSS hash enable */ -#define I40E_RSS_HENA_ALL ( \ - (1ULL << I40E_FILTER_PCTYPE_NONF_IPV4_UDP) | \ - (1ULL << I40E_FILTER_PCTYPE_NONF_IPV4_TCP) | \ - (1ULL << I40E_FILTER_PCTYPE_NONF_IPV4_SCTP) | \ - (1ULL << I40E_FILTER_PCTYPE_NONF_IPV4_OTHER) | \ - (1ULL << I40E_FILTER_PCTYPE_FRAG_IPV4) | \ - (1ULL << I40E_FILTER_PCTYPE_NONF_IPV6_UDP) | \ - (1ULL << I40E_FILTER_PCTYPE_NONF_IPV6_TCP) | \ - (1ULL << I40E_FILTER_PCTYPE_NONF_IPV6_SCTP) | \ - (1ULL << I40E_FILTER_PCTYPE_NONF_IPV6_OTHER) | \ - (1ULL << I40E_FILTER_PCTYPE_FRAG_IPV6) | \ - (1ULL << I40E_FILTER_PCTYPE_FCOE_OX) | \ - (1ULL << I40E_FILTER_PCTYPE_FCOE_RX) | \ - (1ULL << I40E_FILTER_PCTYPE_FCOE_OTHER) | \ - (1ULL << I40E_FILTER_PCTYPE_L2_PAYLOAD)) - static int eth_i40e_dev_init(\ __attribute__((unused)) struct eth_driver *eth_drv, struct rte_eth_dev *eth_dev); @@ -3960,7 +3930,7 @@ DONE: } /* Configure hash enable flags for RSS */ -static uint64_t +uint64_t i40e_config_hena(uint64_t flags) { uint64_t hena = 0; @@ -3995,7 +3965,7 @@ i40e_config_hena(uint64_t flags) } /* Parse the hash enable flags */ -static uint64_t +uint64_t i40e_parse_hena(uint64_t flags) { uint64_t rss_hf = 0; diff --git a/lib/librte_pmd_i40e/i40e_ethdev.h b/lib/librte_pmd_i40e/i40e_ethdev.h index 64deef2..c801345 100644 --- a/lib/librte_pmd_i40e/i40e_ethdev.h +++ b/lib/librte_pmd_i40e/i40e_ethdev.h @@ -68,6 +68,36 @@ I40E_FLAG_HEADER_SPLIT_ENABLED | \ I40E_FLAG_FDIR) +#define I40E_RSS_OFFLOAD_ALL ( \ + ETH_RSS_NONF_IPV4_UDP | \ + ETH_RSS_NONF_IPV4_TCP | \ + ETH_RSS_NONF_IPV4_SCTP | \ + ETH_RSS_NONF_IPV4_OTHER | \ + ETH_RSS_FRAG_IPV4 | \ + ETH_RSS_NONF_IPV6_UDP | \ + ETH_RSS_NONF_IPV6_TCP | \ + ETH_RSS_NONF_IPV6_SCTP | \ + ETH_RSS_NONF_IPV6_OTHER | \ + ETH_RSS_FRAG_IPV6 | \ + ETH_RSS_L2_PAYLOAD) + +/* All bits of RSS hash enable */ +#define I40E_RSS_HENA_ALL ( \ + (1ULL << I40E_FILTER_PCTYPE_NONF_IPV4_UDP) | \ + (1ULL << I40E_FILTER_PCTYPE_NONF_IPV4_TCP) | \ + (1ULL << I40E_FILTER_PCTYPE_NONF_IPV4_SCTP) | \ + (1ULL << I40E_FILTER_PCTYPE_NONF_IPV4_OTHER) | \ + (1ULL << I40E_FILTER_PCTYPE_FRAG_IPV4) | \ + (1ULL << I40E_FILTER_PCTYPE_NONF_IPV6_UDP) | \ + (1ULL << I40E_FILTER_PCTYPE_NONF_IPV6_TCP) | \ + (1ULL << I40E_FILTER_PCTYPE_NONF_IPV6_SCTP) | \ + (1ULL << I40E_FILTER_PCTYPE_NONF_IPV6_OTHER) | \ + (1ULL << I40E_FILTER_PCTYPE_FRAG_IPV6) | \ + (1ULL << I40E_FILTER_PCTYPE_FCOE_OX) | \ + (1ULL << I40E_FILTER_PCTYPE_FCOE_RX) | \ + (1ULL << I40E_FILTER_PCTYPE_FCOE_OTHER) | \ + (1ULL << I40E_FILTER_PCTYPE_L2_PAYLOAD)) + struct i40e_adapter; TAILQ_HEAD(i40e_mac_filter_list, i40e_mac_filter); @@ -310,8 +340,10 @@ int i40e_dev_link_update(struct rte_eth_dev *dev, void i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi); void i40e_vsi_queues_unbind_intr(struct i40e_vsi *vsi); int i40e_vsi_vlan_pvid_set(struct i40e_vsi *vsi, - struct i40e_vsi_vlan_pvid_info *info); + struct i40e_vsi_vlan_pvid_info *info); int i40e_vsi_config_vlan_stripping(struct i40e_vsi *vsi, bool on); +uint64_t i40e_config_hena(uint64_t flags); +uint64_t i40e_parse_hena(uint64_t flags); /* I40E_DEV_PRIVATE_TO */ #define I40E_DEV_PRIVATE_TO_PF(adapter) \ -- 1.8.1.4