From: Jingjing Wu <jingjing.wu@intel.com> To: dev@dpdk.org Subject: [dpdk-dev] [PATCH v2 2/2] i40e: define filter_ctrl ops in i40e driver Date: Mon, 20 Oct 2014 13:40:33 +0800 Message-ID: <1413783633-16222-3-git-send-email-jingjing.wu@intel.com> (raw) In-Reply-To: <1413783633-16222-1-git-send-email-jingjing.wu@intel.com> 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 <jingjing.wu@intel.com> --- 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
next prev parent reply other threads:[~2014-10-20 5:32 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-10-16 23:29 [dpdk-dev] [PATCH] lib/librte_ether: new filter APIs definition Jingjing Wu 2014-10-17 1:16 ` Zhang, Helin 2014-10-17 9:07 ` Thomas Monjalon 2014-10-17 9:17 ` Richardson, Bruce 2014-10-17 16:01 ` Wu, Jingjing 2014-10-20 3:38 ` Wu, Jingjing 2014-10-20 1:09 ` Liu, Jijiang 2014-10-20 5:40 ` [dpdk-dev] [PATCH v2 0/2] " Jingjing Wu 2014-10-20 5:40 ` [dpdk-dev] [PATCH v2 1/2] librte_ether: " Jingjing Wu 2014-10-20 5:40 ` Jingjing Wu [this message] 2014-10-20 22:04 ` [dpdk-dev] [PATCH v2 0/2] " Thomas Monjalon
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1413783633-16222-3-git-send-email-jingjing.wu@intel.com \ --to=jingjing.wu@intel.com \ --cc=dev@dpdk.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
DPDK patches and discussions This inbox may be cloned and mirrored by anyone: git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \ dev@dpdk.org public-inbox-index dev Example config snippet for mirrors. Newsgroup available over NNTP: nntp://inbox.dpdk.org/inbox.dpdk.dev AGPL code for this site: git clone https://public-inbox.org/public-inbox.git