From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 6202D68FB for ; Mon, 20 Oct 2014 07:32:44 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 19 Oct 2014 22:40:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,749,1406617200"; d="scan'208";a="621656867" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga002.jf.intel.com with ESMTP; 19 Oct 2014 22:40:51 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id s9K5enLb000595; Mon, 20 Oct 2014 13:40: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 s9K5eltu016270; Mon, 20 Oct 2014 13:40:49 +0800 Received: (from wujingji@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s9K5elMt016266; Mon, 20 Oct 2014 13:40:47 +0800 From: Jingjing Wu To: dev@dpdk.org Date: Mon, 20 Oct 2014 13:40:33 +0800 Message-Id: <1413783633-16222-3-git-send-email-jingjing.wu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1413783633-16222-1-git-send-email-jingjing.wu@intel.com> References: <1413502161-31403-1-git-send-email-jingjing.wu@intel.com> <1413783633-16222-1-git-send-email-jingjing.wu@intel.com> Subject: [dpdk-dev] [PATCH v2 2/2] i40e: define filter_ctrl ops in i40e driver 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 05:32:44 -0000 Provides filter_ctrl ops in i40e driver. - i40e_dev_filter_ctrl For kinds of filter, only provides empty functions. Contributors can enrich them based on filter features on fortville. Signed-off-by: Jingjing Wu --- lib/librte_pmd_i40e/i40e_ethdev.c | 63 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c b/lib/librte_pmd_i40e/i40e_ethdev.c index dbf231f..395ca0e 100644 --- a/lib/librte_pmd_i40e/i40e_ethdev.c +++ b/lib/librte_pmd_i40e/i40e_ethdev.c @@ -216,6 +216,16 @@ static int i40e_dev_rss_hash_update(struct rte_eth_dev *dev, struct rte_eth_rss_conf *rss_conf); static int i40e_dev_rss_hash_conf_get(struct rte_eth_dev *dev, struct rte_eth_rss_conf *rss_conf); +static int i40e_hash_filter_ctrl(struct rte_eth_dev *dev, + enum rte_filter_op filter_op, + void *arg); +static int i40e_fdir_filter_ctrl(struct rte_eth_dev *dev, + enum rte_filter_op filter_op, + void *arg); +static int i40e_dev_filter_ctrl(struct rte_eth_dev *dev, + enum rte_filter_type filter_type, + enum rte_filter_op filter_op, + void *arg); /* Default hash key buffer for RSS */ static uint32_t rss_key_default[I40E_PFQF_HKEY_MAX_INDEX + 1]; @@ -267,6 +277,7 @@ static struct eth_dev_ops i40e_eth_dev_ops = { .reta_query = i40e_dev_rss_reta_query, .rss_hash_update = i40e_dev_rss_hash_update, .rss_hash_conf_get = i40e_dev_rss_hash_conf_get, + .filter_ctrl = i40e_dev_filter_ctrl, }; static struct eth_driver rte_i40e_pmd = { @@ -4169,3 +4180,55 @@ i40e_pf_config_mq_rx(struct i40e_pf *pf) return 0; } + +/* Operations for hash function */ +static int +i40e_hash_filter_ctrl(__rte_unused struct rte_eth_dev *dev, + __rte_unused enum rte_filter_op filter_op, + __rte_unused void *arg) +{ + PMD_INIT_FUNC_TRACE(); + return -ENOSYS; +} + +/* Operations for flow director */ +static int +i40e_fdir_filter_ctrl(__rte_unused struct rte_eth_dev *dev, + __rte_unused enum rte_filter_op filter_op, + __rte_unused void *arg) +{ + PMD_INIT_FUNC_TRACE(); + return -ENOSYS; +} + +static int +i40e_dev_filter_ctrl(struct rte_eth_dev *dev, + enum rte_filter_type filter_type, + enum rte_filter_op filter_op, + void *arg) +{ + int ret = 0; + + if (dev == NULL) + return -EINVAL; + + switch (filter_type) { + case RTE_ETH_FILTER_HASH: + /* Hash filter processing */ + /* add empty function here to avoid compile error */ + ret = i40e_hash_filter_ctrl(dev, filter_op, arg); + break; + case RTE_ETH_FILTER_FDIR: + /* FDIR filter processing */ + /* add empty function here to avoid compile error */ + ret = i40e_fdir_filter_ctrl(dev, filter_op, arg); + break; + default: + PMD_DRV_LOG(WARNING, "Filter type (%d) not supported", + filter_type); + ret = -EINVAL; + break; + } + + return ret; +} -- 1.8.1.4