DPDK patches and discussions
 help / color / mirror / Atom feed
From: Helin Zhang <helin.zhang@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v2 4/6] i40e: support of 'is_command_supported'
Date: Mon, 28 Jul 2014 16:25:53 +0800	[thread overview]
Message-ID: <1406535955-31070-5-git-send-email-helin.zhang@intel.com> (raw)
In-Reply-To: <1406535955-31070-1-git-send-email-helin.zhang@intel.com>

'is_command_supported' is defined for the capability discovery.
Actually it is to check if a command (feature) is supported on
a specific type of NIC port. Now i40e supports below eight
commands. Of cause, more commands can be supported later.
 - RTE_CMD_GET_SYM_HASH_ENABLE_PER_PCTYPE
 - RTE_CMD_SET_SYM_HASH_ENABLE_PER_PCTYPE
 - RTE_CMD_GET_SYM_HASH_ENABLE_PER_PORT
 - RTE_CMD_SET_SYM_HASH_ENABLE_PER_PORT
 - RTE_CMD_GET_FILTER_SWAP
 - RTE_CMD_SET_FILTER_SWAP
 - RTE_CMD_GET_HASH_FUNCTION
 - RTE_CMD_SET_HASH_FUNCTION

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
---
 lib/librte_pmd_i40e/i40e_ethdev.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c b/lib/librte_pmd_i40e/i40e_ethdev.c
index 4403af4..87a4999 100644
--- a/lib/librte_pmd_i40e/i40e_ethdev.c
+++ b/lib/librte_pmd_i40e/i40e_ethdev.c
@@ -204,6 +204,8 @@ 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_dev_is_command_supported(struct rte_eth_dev *dev __rte_unused,
+					 enum rte_eth_command cmd);
 static int i40e_rx_classification_filter_ctl(struct rte_eth_dev *dev,
 					     enum rte_eth_command cmd,
 					     void *args);
@@ -252,6 +254,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,
+	.is_command_supported         = i40e_dev_is_command_supported,
 	.rx_classification_filter_ctl = i40e_rx_classification_filter_ctl,
 };
 
@@ -4292,6 +4295,31 @@ i40e_get_hash_function(struct i40e_hw *hw, enum rte_i40e_hash_function *hf)
 }
 
 static int
+i40e_dev_is_command_supported(struct rte_eth_dev *dev __rte_unused,
+			      enum rte_eth_command cmd)
+{
+	uint32_t i;
+	/* Below commands defined in rte_eth_features.h are for i40e only */
+	static const enum rte_eth_command i40e_commands[] = {
+		RTE_CMD_GET_SYM_HASH_ENABLE_PER_PCTYPE,
+		RTE_CMD_SET_SYM_HASH_ENABLE_PER_PCTYPE,
+		RTE_CMD_GET_SYM_HASH_ENABLE_PER_PORT,
+		RTE_CMD_SET_SYM_HASH_ENABLE_PER_PORT,
+		RTE_CMD_GET_FILTER_SWAP,
+		RTE_CMD_SET_FILTER_SWAP,
+		RTE_CMD_GET_HASH_FUNCTION,
+		RTE_CMD_SET_HASH_FUNCTION,
+	};
+
+	for (i = 0; i < RTE_DIM(i40e_commands); i++) {
+		if (i40e_commands[i] == cmd)
+			return 1;
+	}
+
+	return 0;
+}
+
+static int
 i40e_rx_classification_filter_ctl(struct rte_eth_dev *dev,
 				  enum rte_eth_command cmd,
 				  void *args)
-- 
1.8.1.4

  parent reply	other threads:[~2014-07-28  8:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-28  8:25 [dpdk-dev] [PATCH v2 0/6] Support configuring hash functions Helin Zhang
2014-07-28  8:25 ` [dpdk-dev] [PATCH v2 1/6] ethdev: rename macros of packet classification type Helin Zhang
2014-08-27 16:44   ` Thomas Monjalon
2014-07-28  8:25 ` [dpdk-dev] [PATCH v2 2/6] ethdev: add new ops of 'is_command_supported' and 'rx_classification_filter_ctl' Helin Zhang
2014-07-28  8:25 ` [dpdk-dev] [PATCH v2 3/6] i40e: support of 'rx_classification_filter_ctl' Helin Zhang
2014-07-28  8:25 ` Helin Zhang [this message]
2014-07-28  8:25 ` [dpdk-dev] [PATCH v2 5/6] i40e: Initialize hash function during port initialization Helin Zhang
2014-07-28  8:25 ` [dpdk-dev] [PATCH v2 6/6] app/testpmd: add commands for configuring hash functions Helin Zhang
2014-07-29  2:57 ` [dpdk-dev] [PATCH v2 0/6] Support " Wu, Jingjing
2014-07-31  2:49 ` Zhan, Zhaochen
2014-08-01  5:26   ` Zhang, Helin
2014-08-29 16:11     ` Thomas Monjalon
2014-08-20  7:05 ` Zhang, Helin

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=1406535955-31070-5-git-send-email-helin.zhang@intel.com \
    --to=helin.zhang@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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).