DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v2 0/3] add i40e RSS support in VF
@ 2014-09-19  1:14 Helin Zhang
  2014-09-19  1:14 ` [dpdk-dev] [PATCH v2 1/3] ethdev: improvement for constant usage Helin Zhang
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: Helin Zhang @ 2014-09-19  1:14 UTC (permalink / raw)
  To: dev

As hardware supports RSS in VF, the patches add that support
in driver. In addition, minor improvements are added for
defining macro with constant.

v2 changes:
* Remove support of updating/querying redirection table, as it
  will be implemented in another patches later.
* Remove changes in testpmd, as it is not needed at all for
  supporting RSS in VF.

Helin Zhang (3):
  ethdev: improvement for constant usage
  i40e: extern two functions and relevant macros
  i40evf: support of RSS in VF

 lib/librte_ether/rte_ethdev.h        |  47 ++++++------
 lib/librte_pmd_i40e/i40e_ethdev.c    |   4 +-
 lib/librte_pmd_i40e/i40e_ethdev.h    |  40 +++++++++-
 lib/librte_pmd_i40e/i40e_ethdev_vf.c | 142 +++++++++++++++++++++++++++++++++++
 4 files changed, 207 insertions(+), 26 deletions(-)

-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [dpdk-dev] [PATCH v2 1/3] ethdev: improvement for constant usage
  2014-09-19  1:14 [dpdk-dev] [PATCH v2 0/3] add i40e RSS support in VF Helin Zhang
@ 2014-09-19  1:14 ` Helin Zhang
  2014-09-19  1:14 ` [dpdk-dev] [PATCH v2 2/3] i40e: extern two functions and relevant macros Helin Zhang
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 16+ messages in thread
From: Helin Zhang @ 2014-09-19  1:14 UTC (permalink / raw)
  To: dev

Forced type conversion is not needed to define a macro with
constant. The alternate is to let compiler use the default width,
or specify the width with suffix of 'U', 'UL', 'ULL', etc.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Reviewed-by: Cunming Liang <cunming.liang@intel.com>
Reviewed-by: Jijiang Liu <jijiang.liu@intel.com>
---
 lib/librte_ether/rte_ethdev.h | 47 ++++++++++++++++++++++---------------------
 1 file changed, 24 insertions(+), 23 deletions(-)

diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 50df654..3a0b33b 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -362,30 +362,31 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_L2_PAYLOAD_SHIFT              63
 
 /* for 1G & 10G */
-#define ETH_RSS_IPV4                    ((uint16_t)1 << ETH_RSS_IPV4_SHIFT)
-#define ETH_RSS_IPV4_TCP                ((uint16_t)1 << ETH_RSS_IPV4_TCP_SHIFT)
-#define ETH_RSS_IPV6                    ((uint16_t)1 << ETH_RSS_IPV6_SHIFT)
-#define ETH_RSS_IPV6_EX                 ((uint16_t)1 << ETH_RSS_IPV6_EX_SHIFT)
-#define ETH_RSS_IPV6_TCP                ((uint16_t)1 << ETH_RSS_IPV6_TCP_SHIFT)
-#define ETH_RSS_IPV6_TCP_EX             ((uint16_t)1 << ETH_RSS_IPV6_TCP_EX_SHIFT)
-#define ETH_RSS_IPV4_UDP                ((uint16_t)1 << ETH_RSS_IPV4_UDP_SHIFT)
-#define ETH_RSS_IPV6_UDP                ((uint16_t)1 << ETH_RSS_IPV6_UDP_SHIFT)
-#define ETH_RSS_IPV6_UDP_EX             ((uint16_t)1 << ETH_RSS_IPV6_UDP_EX_SHIFT)
+#define ETH_RSS_IPV4                    (1 << ETH_RSS_IPV4_SHIFT)
+#define ETH_RSS_IPV4_TCP                (1 << ETH_RSS_IPV4_TCP_SHIFT)
+#define ETH_RSS_IPV6                    (1 << ETH_RSS_IPV6_SHIFT)
+#define ETH_RSS_IPV6_EX                 (1 << ETH_RSS_IPV6_EX_SHIFT)
+#define ETH_RSS_IPV6_TCP                (1 << ETH_RSS_IPV6_TCP_SHIFT)
+#define ETH_RSS_IPV6_TCP_EX             (1 << ETH_RSS_IPV6_TCP_EX_SHIFT)
+#define ETH_RSS_IPV4_UDP                (1 << ETH_RSS_IPV4_UDP_SHIFT)
+#define ETH_RSS_IPV6_UDP                (1 << ETH_RSS_IPV6_UDP_SHIFT)
+#define ETH_RSS_IPV6_UDP_EX             (1 << ETH_RSS_IPV6_UDP_EX_SHIFT)
 /* for 40G only */
-#define ETH_RSS_NONF_IPV4_UDP           ((uint64_t)1 << ETH_RSS_NONF_IPV4_UDP_SHIFT)
-#define ETH_RSS_NONF_IPV4_TCP           ((uint64_t)1 << ETH_RSS_NONF_IPV4_TCP_SHIFT)
-#define ETH_RSS_NONF_IPV4_SCTP          ((uint64_t)1 << ETH_RSS_NONF_IPV4_SCTP_SHIFT)
-#define ETH_RSS_NONF_IPV4_OTHER         ((uint64_t)1 << ETH_RSS_NONF_IPV4_OTHER_SHIFT)
-#define ETH_RSS_FRAG_IPV4               ((uint64_t)1 << ETH_RSS_FRAG_IPV4_SHIFT)
-#define ETH_RSS_NONF_IPV6_UDP           ((uint64_t)1 << ETH_RSS_NONF_IPV6_UDP_SHIFT)
-#define ETH_RSS_NONF_IPV6_TCP           ((uint64_t)1 << ETH_RSS_NONF_IPV6_TCP_SHIFT)
-#define ETH_RSS_NONF_IPV6_SCTP          ((uint64_t)1 << ETH_RSS_NONF_IPV6_SCTP_SHIFT)
-#define ETH_RSS_NONF_IPV6_OTHER         ((uint64_t)1 << ETH_RSS_NONF_IPV6_OTHER_SHIFT)
-#define ETH_RSS_FRAG_IPV6               ((uint64_t)1 << ETH_RSS_FRAG_IPV6_SHIFT)
-#define ETH_RSS_FCOE_OX                 ((uint64_t)1 << ETH_RSS_FCOE_OX_SHIFT) /* not used */
-#define ETH_RSS_FCOE_RX                 ((uint64_t)1 << ETH_RSS_FCOE_RX_SHIFT) /* not used */
-#define ETH_RSS_FCOE_OTHER              ((uint64_t)1 << ETH_RSS_FCOE_OTHER_SHIFT) /* not used */
-#define ETH_RSS_L2_PAYLOAD              ((uint64_t)1 << ETH_RSS_L2_PAYLOAD_SHIFT)
+#define ETH_RSS_NONF_IPV4_UDP           (1ULL << ETH_RSS_NONF_IPV4_UDP_SHIFT)
+#define ETH_RSS_NONF_IPV4_TCP           (1ULL << ETH_RSS_NONF_IPV4_TCP_SHIFT)
+#define ETH_RSS_NONF_IPV4_SCTP          (1ULL << ETH_RSS_NONF_IPV4_SCTP_SHIFT)
+#define ETH_RSS_NONF_IPV4_OTHER         (1ULL << ETH_RSS_NONF_IPV4_OTHER_SHIFT)
+#define ETH_RSS_FRAG_IPV4               (1ULL << ETH_RSS_FRAG_IPV4_SHIFT)
+#define ETH_RSS_NONF_IPV6_UDP           (1ULL << ETH_RSS_NONF_IPV6_UDP_SHIFT)
+#define ETH_RSS_NONF_IPV6_TCP           (1ULL << ETH_RSS_NONF_IPV6_TCP_SHIFT)
+#define ETH_RSS_NONF_IPV6_SCTP          (1ULL << ETH_RSS_NONF_IPV6_SCTP_SHIFT)
+#define ETH_RSS_NONF_IPV6_OTHER         (1ULL << ETH_RSS_NONF_IPV6_OTHER_SHIFT)
+#define ETH_RSS_FRAG_IPV6               (1ULL << ETH_RSS_FRAG_IPV6_SHIFT)
+/* FCOE relevant should not be used */
+#define ETH_RSS_FCOE_OX                 (1ULL << ETH_RSS_FCOE_OX_SHIFT)
+#define ETH_RSS_FCOE_RX                 (1ULL << ETH_RSS_FCOE_RX_SHIFT)
+#define ETH_RSS_FCOE_OTHER              (1ULL << ETH_RSS_FCOE_OTHER_SHIFT)
+#define ETH_RSS_L2_PAYLOAD              (1ULL << ETH_RSS_L2_PAYLOAD_SHIFT)
 
 #define ETH_RSS_IP ( \
 		ETH_RSS_IPV4 | \
-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [dpdk-dev] [PATCH v2 2/3] i40e: extern two functions and relevant macros
  2014-09-19  1:14 [dpdk-dev] [PATCH v2 0/3] add i40e RSS support in VF Helin Zhang
  2014-09-19  1:14 ` [dpdk-dev] [PATCH v2 1/3] ethdev: improvement for constant usage Helin Zhang
@ 2014-09-19  1:14 ` Helin Zhang
  2014-10-17 20:59   ` Thomas Monjalon
  2014-09-19  1:14 ` [dpdk-dev] [PATCH v2 3/3] i40evf: support of RSS in VF Helin Zhang
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 16+ messages in thread
From: Helin Zhang @ 2014-09-19  1:14 UTC (permalink / raw)
  To: dev

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 <helin.zhang@intel.com>
Reviewed-by: Cunming Liang <cunming.liang@intel.com>
Reviewed-by: Jijiang Liu <jijiang.liu@intel.com>
---
 lib/librte_pmd_i40e/i40e_ethdev.c |  4 ++--
 lib/librte_pmd_i40e/i40e_ethdev.h | 34 +++++++++++++++++++++++++++++++++-
 2 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c b/lib/librte_pmd_i40e/i40e_ethdev.c
index 4e65ca4..f7a40a9 100644
--- a/lib/librte_pmd_i40e/i40e_ethdev.c
+++ b/lib/librte_pmd_i40e/i40e_ethdev.c
@@ -3919,7 +3919,7 @@ DONE:
 }
 
 /* Configure hash enable flags for RSS */
-static uint64_t
+uint64_t
 i40e_config_hena(uint64_t flags)
 {
 	uint64_t hena = 0;
@@ -3954,7 +3954,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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [dpdk-dev] [PATCH v2 3/3] i40evf: support of RSS in VF
  2014-09-19  1:14 [dpdk-dev] [PATCH v2 0/3] add i40e RSS support in VF Helin Zhang
  2014-09-19  1:14 ` [dpdk-dev] [PATCH v2 1/3] ethdev: improvement for constant usage Helin Zhang
  2014-09-19  1:14 ` [dpdk-dev] [PATCH v2 2/3] i40e: extern two functions and relevant macros Helin Zhang
@ 2014-09-19  1:14 ` Helin Zhang
  2014-09-29  1:39 ` [dpdk-dev] [PATCH v2 0/3] add i40e RSS support " Zhan, Zhaochen
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 16+ messages in thread
From: Helin Zhang @ 2014-09-19  1:14 UTC (permalink / raw)
  To: dev

i40e hardware supports RSS in VF, the code changes are to add
this support.

v2 changes:
Updating/querying redirection table has been removed, as it
will be in another patches of supporting different redirection
table sizes soon later.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Reviewed-by: Cunming Liang <cunming.liang@intel.com>
Reviewed-by: Jijiang Liu <jijiang.liu@intel.com>
---
 lib/librte_pmd_i40e/i40e_ethdev.h    |   6 ++
 lib/librte_pmd_i40e/i40e_ethdev_vf.c | 142 +++++++++++++++++++++++++++++++++++
 2 files changed, 148 insertions(+)

diff --git a/lib/librte_pmd_i40e/i40e_ethdev.h b/lib/librte_pmd_i40e/i40e_ethdev.h
index c801345..1d42cd2 100644
--- a/lib/librte_pmd_i40e/i40e_ethdev.h
+++ b/lib/librte_pmd_i40e/i40e_ethdev.h
@@ -283,6 +283,8 @@ struct i40e_vf_tx_queues {
  * Structure to store private data specific for VF instance.
  */
 struct i40e_vf {
+	struct i40e_adapter *adapter; /* The adapter this VF associate to */
+	struct rte_eth_dev_data *dev_data; /* Pointer to the device data */
 	uint16_t num_queue_pairs;
 	uint16_t max_pkt_len; /* Maximum packet length */
 	bool promisc_unicast_enabled;
@@ -393,6 +395,10 @@ i40e_get_vsi_from_adapter(struct i40e_adapter *adapter)
 #define I40E_PF_TO_ADAPTER(pf) \
 	((struct i40e_adapter *)pf->adapter)
 
+/* I40E_VF_TO */
+#define I40E_VF_TO_HW(vf) \
+	(&(((struct i40e_vf *)vf)->adapter->hw))
+
 static inline void
 i40e_init_adminq_parameter(struct i40e_hw *hw)
 {
diff --git a/lib/librte_pmd_i40e/i40e_ethdev_vf.c b/lib/librte_pmd_i40e/i40e_ethdev_vf.c
index d8552ad..840ae65 100644
--- a/lib/librte_pmd_i40e/i40e_ethdev_vf.c
+++ b/lib/librte_pmd_i40e/i40e_ethdev_vf.c
@@ -125,10 +125,19 @@ static void i40evf_dev_allmulticast_disable(struct rte_eth_dev *dev);
 static int i40evf_get_link_status(struct rte_eth_dev *dev,
 				  struct rte_eth_link *link);
 static int i40evf_init_vlan(struct rte_eth_dev *dev);
+static int i40evf_config_rss(struct i40e_vf *vf);
+static int i40evf_dev_rss_hash_update(struct rte_eth_dev *dev,
+				      struct rte_eth_rss_conf *rss_conf);
+static int i40evf_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
+					struct rte_eth_rss_conf *rss_conf);
 static int i40evf_dev_rx_queue_start(struct rte_eth_dev *, uint16_t);
 static int i40evf_dev_rx_queue_stop(struct rte_eth_dev *, uint16_t);
 static int i40evf_dev_tx_queue_start(struct rte_eth_dev *, uint16_t);
 static int i40evf_dev_tx_queue_stop(struct rte_eth_dev *, uint16_t);
+
+/* Default hash key buffer for RSS */
+static uint32_t rss_key_default[I40E_VFQF_HKEY_MAX_INDEX + 1];
+
 static struct eth_dev_ops i40evf_eth_dev_ops = {
 	.dev_configure        = i40evf_dev_configure,
 	.dev_start            = i40evf_dev_start,
@@ -152,6 +161,8 @@ static struct eth_dev_ops i40evf_eth_dev_ops = {
 	.rx_queue_release     = i40e_dev_rx_queue_release,
 	.tx_queue_setup       = i40e_dev_tx_queue_setup,
 	.tx_queue_release     = i40e_dev_tx_queue_release,
+	.rss_hash_update      = i40evf_dev_rss_hash_update,
+	.rss_hash_conf_get    = i40evf_dev_rss_hash_conf_get,
 };
 
 static int
@@ -978,6 +989,8 @@ i40evf_init_vf(struct rte_eth_dev *dev)
 	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 
+	vf->adapter = I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
+	vf->dev_data = dev->data;
 	err = i40evf_set_mac_type(hw);
 	if (err) {
 		PMD_INIT_LOG(ERR, "set_mac_type failed: %d\n", err);
@@ -1334,11 +1347,13 @@ i40evf_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)
 static int
 i40evf_rx_init(struct rte_eth_dev *dev)
 {
+	struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 	uint16_t i;
 	struct i40e_rx_queue **rxq =
 		(struct i40e_rx_queue **)dev->data->rx_queues;
 	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
+	i40evf_config_rss(vf);
 	for (i = 0; i < dev->data->nb_rx_queues; i++) {
 		rxq[i]->qrx_tail = hw->hw_addr + I40E_QRX_TAIL1(i);
 		I40E_PCI_REG_WRITE(rxq[i]->qrx_tail, rxq[i]->nb_rx_desc - 1);
@@ -1573,3 +1588,130 @@ i40evf_dev_close(struct rte_eth_dev *dev)
 	i40evf_reset_vf(hw);
 	i40e_shutdown_adminq(hw);
 }
+
+static int
+i40evf_hw_rss_hash_set(struct i40e_hw *hw, struct rte_eth_rss_conf *rss_conf)
+{
+	uint32_t *hash_key;
+	uint8_t hash_key_len;
+	uint64_t rss_hf, hena;
+
+	hash_key = (uint32_t *)(rss_conf->rss_key);
+	hash_key_len = rss_conf->rss_key_len;
+	if (hash_key != NULL && hash_key_len >=
+		(I40E_VFQF_HKEY_MAX_INDEX + 1) * sizeof(uint32_t)) {
+		uint16_t i;
+
+		for (i = 0; i <= I40E_VFQF_HKEY_MAX_INDEX; i++)
+			I40E_WRITE_REG(hw, I40E_VFQF_HKEY(i), hash_key[i]);
+	}
+
+	rss_hf = rss_conf->rss_hf;
+	hena = (uint64_t)I40E_READ_REG(hw, I40E_VFQF_HENA(0));
+	hena |= ((uint64_t)I40E_READ_REG(hw, I40E_VFQF_HENA(1))) << 32;
+	hena &= ~I40E_RSS_HENA_ALL;
+	hena |= i40e_config_hena(rss_hf);
+	I40E_WRITE_REG(hw, I40E_VFQF_HENA(0), (uint32_t)hena);
+	I40E_WRITE_REG(hw, I40E_VFQF_HENA(1), (uint32_t)(hena >> 32));
+	I40EVF_WRITE_FLUSH(hw);
+
+	return 0;
+}
+
+static void
+i40evf_disable_rss(struct i40e_vf *vf)
+{
+	struct i40e_hw *hw = I40E_VF_TO_HW(vf);
+	uint64_t hena;
+
+	hena = (uint64_t)I40E_READ_REG(hw, I40E_VFQF_HENA(0));
+	hena |= ((uint64_t)I40E_READ_REG(hw, I40E_VFQF_HENA(1))) << 32;
+	hena &= ~I40E_RSS_HENA_ALL;
+	I40E_WRITE_REG(hw, I40E_VFQF_HENA(0), (uint32_t)hena);
+	I40E_WRITE_REG(hw, I40E_VFQF_HENA(1), (uint32_t)(hena >> 32));
+	I40EVF_WRITE_FLUSH(hw);
+}
+
+static int
+i40evf_config_rss(struct i40e_vf *vf)
+{
+	struct i40e_hw *hw = I40E_VF_TO_HW(vf);
+	struct rte_eth_rss_conf rss_conf;
+	uint32_t i, j, lut = 0, nb_q = (I40E_VFQF_HLUT_MAX_INDEX + 1) * 4;
+
+	if (vf->dev_data->dev_conf.rxmode.mq_mode != ETH_MQ_RX_RSS) {
+		i40evf_disable_rss(vf);
+		PMD_DRV_LOG(DEBUG, "RSS not configured\n");
+		return 0;
+	}
+
+	/* Fill out the look up table */
+	for (i = 0, j = 0; i < nb_q; i++, j++) {
+		if (j >= vf->num_queue_pairs)
+			j = 0;
+		lut = (lut << 8) | j;
+		if ((i & 3) == 3)
+			I40E_WRITE_REG(hw, I40E_VFQF_HLUT(i >> 2), lut);
+	}
+
+	rss_conf = vf->dev_data->dev_conf.rx_adv_conf.rss_conf;
+	if ((rss_conf.rss_hf & I40E_RSS_OFFLOAD_ALL) == 0) {
+		i40evf_disable_rss(vf);
+		PMD_DRV_LOG(DEBUG, "No hash flag is set\n");
+		return 0;
+	}
+
+	if (rss_conf.rss_key == NULL || rss_conf.rss_key_len < nb_q) {
+		/* Calculate the default hash key */
+		for (i = 0; i <= I40E_VFQF_HKEY_MAX_INDEX; i++)
+			rss_key_default[i] = (uint32_t)rte_rand();
+		rss_conf.rss_key = (uint8_t *)rss_key_default;
+		rss_conf.rss_key_len = nb_q;
+	}
+
+	return i40evf_hw_rss_hash_set(hw, &rss_conf);
+}
+
+static int
+i40evf_dev_rss_hash_update(struct rte_eth_dev *dev,
+			   struct rte_eth_rss_conf *rss_conf)
+{
+	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	uint64_t rss_hf = rss_conf->rss_hf & I40E_RSS_OFFLOAD_ALL;
+	uint64_t hena;
+
+	hena = (uint64_t)I40E_READ_REG(hw, I40E_VFQF_HENA(0));
+	hena |= ((uint64_t)I40E_READ_REG(hw, I40E_VFQF_HENA(1))) << 32;
+	if (!(hena & I40E_RSS_HENA_ALL)) { /* RSS disabled */
+		if (rss_hf != 0) /* Enable RSS */
+			return -EINVAL;
+		return 0;
+	}
+
+	/* RSS enabled */
+	if (rss_hf == 0) /* Disable RSS */
+		return -EINVAL;
+
+	return i40evf_hw_rss_hash_set(hw, rss_conf);
+}
+
+static int
+i40evf_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
+			     struct rte_eth_rss_conf *rss_conf)
+{
+	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	uint32_t *hash_key = (uint32_t *)(rss_conf->rss_key);
+	uint64_t hena;
+	uint16_t i;
+
+	if (hash_key) {
+		for (i = 0; i <= I40E_VFQF_HKEY_MAX_INDEX; i++)
+			hash_key[i] = I40E_READ_REG(hw, I40E_VFQF_HKEY(i));
+		rss_conf->rss_key_len = i * sizeof(uint32_t);
+	}
+	hena = (uint64_t)I40E_READ_REG(hw, I40E_VFQF_HENA(0));
+	hena |= ((uint64_t)I40E_READ_REG(hw, I40E_VFQF_HENA(1))) << 32;
+	rss_conf->rss_hf = i40e_parse_hena(hena);
+
+	return 0;
+}
-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [dpdk-dev] [PATCH v2 0/3] add i40e RSS support in VF
  2014-09-19  1:14 [dpdk-dev] [PATCH v2 0/3] add i40e RSS support in VF Helin Zhang
                   ` (2 preceding siblings ...)
  2014-09-19  1:14 ` [dpdk-dev] [PATCH v2 3/3] i40evf: support of RSS in VF Helin Zhang
@ 2014-09-29  1:39 ` Zhan, Zhaochen
  2014-10-10  3:10 ` Liang, Cunming
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 16+ messages in thread
From: Zhan, Zhaochen @ 2014-09-29  1:39 UTC (permalink / raw)
  To: Zhang, Helin, dev

Tested-by: Zhaochen Zhan <zhaochen.zhan@intel.com>

This patch has been verified on KVM virtual environment with
4*10G, 2*40G and 1*40G NICs. The VF is generated by SRIOV.
And testpmd should be run on HOST to support testpmd works on VM.
The RSS function works well in the testpmd app in VM environment of KVM.

Please see environment information as the following:
HOST environment:
CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
OS: Linux 3.11.10-301.fc20.x86_64    
GCC: 4.8.3
NIC: 4*10G(1572), 2*40G(1583), 1*40G(1584)

VM environment generated by KVM:
CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
OS: Linux 3.11.10-301.fc20.x86_64
GCC: 4.8.2
NIC: VF generated through SRIOV

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Helin Zhang
> Sent: Friday, September 19, 2014 9:15 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v2 0/3] add i40e RSS support in VF
> 
> As hardware supports RSS in VF, the patches add that support
> in driver. In addition, minor improvements are added for
> defining macro with constant.
> 
> v2 changes:
> * Remove support of updating/querying redirection table, as it
>   will be implemented in another patches later.
> * Remove changes in testpmd, as it is not needed at all for
>   supporting RSS in VF.
> 
> Helin Zhang (3):
>   ethdev: improvement for constant usage
>   i40e: extern two functions and relevant macros
>   i40evf: support of RSS in VF
> 
>  lib/librte_ether/rte_ethdev.h        |  47 ++++++------
>  lib/librte_pmd_i40e/i40e_ethdev.c    |   4 +-
>  lib/librte_pmd_i40e/i40e_ethdev.h    |  40 +++++++++-
>  lib/librte_pmd_i40e/i40e_ethdev_vf.c | 142
> +++++++++++++++++++++++++++++++++++
>  4 files changed, 207 insertions(+), 26 deletions(-)
> 
> --
> 1.8.1.4

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [dpdk-dev] [PATCH v2 0/3] add i40e RSS support in VF
  2014-09-19  1:14 [dpdk-dev] [PATCH v2 0/3] add i40e RSS support in VF Helin Zhang
                   ` (3 preceding siblings ...)
  2014-09-29  1:39 ` [dpdk-dev] [PATCH v2 0/3] add i40e RSS support " Zhan, Zhaochen
@ 2014-10-10  3:10 ` Liang, Cunming
  2014-10-11  7:57 ` Zhang, Helin
  2014-10-20  2:58 ` [dpdk-dev] [PATCH v3 " Helin Zhang
  6 siblings, 0 replies; 16+ messages in thread
From: Liang, Cunming @ 2014-10-10  3:10 UTC (permalink / raw)
  To: dev

Acked-by: Cunming, Liang <cunming.liang@intel.com>

> -----Original Message-----
> From: Zhang, Helin
> Sent: Friday, September 19, 2014 9:15 AM
> To: dev@dpdk.org
> Cc: Zhang, Helin
> Subject: [PATCH v2 0/3] add i40e RSS support in VF
> 
> As hardware supports RSS in VF, the patches add that support
> in driver. In addition, minor improvements are added for
> defining macro with constant.
> 
> v2 changes:
> * Remove support of updating/querying redirection table, as it
>   will be implemented in another patches later.
> * Remove changes in testpmd, as it is not needed at all for
>   supporting RSS in VF.
> 
> Helin Zhang (3):
>   ethdev: improvement for constant usage
>   i40e: extern two functions and relevant macros
>   i40evf: support of RSS in VF
> 
>  lib/librte_ether/rte_ethdev.h        |  47 ++++++------
>  lib/librte_pmd_i40e/i40e_ethdev.c    |   4 +-
>  lib/librte_pmd_i40e/i40e_ethdev.h    |  40 +++++++++-
>  lib/librte_pmd_i40e/i40e_ethdev_vf.c | 142
> +++++++++++++++++++++++++++++++++++
>  4 files changed, 207 insertions(+), 26 deletions(-)
> 
> --
> 1.8.1.4

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [dpdk-dev] [PATCH v2 0/3] add i40e RSS support in VF
  2014-09-19  1:14 [dpdk-dev] [PATCH v2 0/3] add i40e RSS support in VF Helin Zhang
                   ` (4 preceding siblings ...)
  2014-10-10  3:10 ` Liang, Cunming
@ 2014-10-11  7:57 ` Zhang, Helin
  2014-10-20  2:58 ` [dpdk-dev] [PATCH v3 " Helin Zhang
  6 siblings, 0 replies; 16+ messages in thread
From: Zhang, Helin @ 2014-10-11  7:57 UTC (permalink / raw)
  To: dev

Hi guys

Any update or comments on merging this patch? Thanks!

Regards,
Helin

> -----Original Message-----
> From: Zhang, Helin
> Sent: Friday, September 19, 2014 9:15 AM
> To: dev@dpdk.org
> Cc: Zhang, Helin
> Subject: [PATCH v2 0/3] add i40e RSS support in VF
> 
> As hardware supports RSS in VF, the patches add that support in driver. In
> addition, minor improvements are added for defining macro with constant.
> 
> v2 changes:
> * Remove support of updating/querying redirection table, as it
>   will be implemented in another patches later.
> * Remove changes in testpmd, as it is not needed at all for
>   supporting RSS in VF.
> 
> Helin Zhang (3):
>   ethdev: improvement for constant usage
>   i40e: extern two functions and relevant macros
>   i40evf: support of RSS in VF
> 
>  lib/librte_ether/rte_ethdev.h        |  47 ++++++------
>  lib/librte_pmd_i40e/i40e_ethdev.c    |   4 +-
>  lib/librte_pmd_i40e/i40e_ethdev.h    |  40 +++++++++-
>  lib/librte_pmd_i40e/i40e_ethdev_vf.c | 142
> +++++++++++++++++++++++++++++++++++
>  4 files changed, 207 insertions(+), 26 deletions(-)
> 
> --
> 1.8.1.4

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [dpdk-dev] [PATCH v2 2/3] i40e: extern two functions and relevant macros
  2014-09-19  1:14 ` [dpdk-dev] [PATCH v2 2/3] i40e: extern two functions and relevant macros Helin Zhang
@ 2014-10-17 20:59   ` Thomas Monjalon
  2014-10-20  1:11     ` Zhang, Helin
  0 siblings, 1 reply; 16+ messages in thread
From: Thomas Monjalon @ 2014-10-17 20:59 UTC (permalink / raw)
  To: Helin Zhang; +Cc: dev

2014-09-19 09:14, Helin Zhang:
> 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 <helin.zhang@intel.com>
> Reviewed-by: Cunming Liang <cunming.liang@intel.com>
> Reviewed-by: Jijiang Liu <jijiang.liu@intel.com>
[...]
> +#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))

You've added the constants in the .h file but you forgot to remove them from
the .c file.

-- 
Thomas

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [dpdk-dev] [PATCH v2 2/3] i40e: extern two functions and relevant macros
  2014-10-17 20:59   ` Thomas Monjalon
@ 2014-10-20  1:11     ` Zhang, Helin
  0 siblings, 0 replies; 16+ messages in thread
From: Zhang, Helin @ 2014-10-20  1:11 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

Hi Thomas

> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Saturday, October 18, 2014 4:59 AM
> To: Zhang, Helin
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2 2/3] i40e: extern two functions and relevant
> macros
> 
> 2014-09-19 09:14, Helin Zhang:
> > 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 <helin.zhang@intel.com>
> > Reviewed-by: Cunming Liang <cunming.liang@intel.com>
> > Reviewed-by: Jijiang Liu <jijiang.liu@intel.com>
> [...]
> > +#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))
> 
> You've added the constants in the .h file but you forgot to remove them from
> the .c file.
Ohh, yes, you are right! Thank you for the good catch! And sorry for the inconvenience!


> 
> --
> Thomas

Regards,
Helin

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [dpdk-dev] [PATCH v3 0/3] add i40e RSS support in VF
  2014-09-19  1:14 [dpdk-dev] [PATCH v2 0/3] add i40e RSS support in VF Helin Zhang
                   ` (5 preceding siblings ...)
  2014-10-11  7:57 ` Zhang, Helin
@ 2014-10-20  2:58 ` Helin Zhang
  2014-10-20  2:58   ` [dpdk-dev] [PATCH v3 1/3] ethdev: improvement for constant usage Helin Zhang
                     ` (4 more replies)
  6 siblings, 5 replies; 16+ messages in thread
From: Helin Zhang @ 2014-10-20  2:58 UTC (permalink / raw)
  To: dev

As hardware supports RSS in VF, the patches add that support
in driver. In addition, minor improvements are added for
defining macro with constant.

v2 changes:
* Removed support of updating/querying redirection table, as it
  will be implemented in another patches later.
* Removed changes in testpmd, as it is not needed at all for
  supporting RSS in VF.

v3 changes:
* Removed macros in i40e_ethdev.c, as they have already been
  moved to i40e_ethdev.h.


Helin Zhang (3):
  ethdev: improvement for constant usage
  i40e: extern two functions and relevant macros
  i40evf: support of RSS in VF

 lib/librte_ether/rte_ethdev.h        |  47 ++++++------
 lib/librte_pmd_i40e/i40e_ethdev.c    |  34 +--------
 lib/librte_pmd_i40e/i40e_ethdev.h    |  40 +++++++++-
 lib/librte_pmd_i40e/i40e_ethdev_vf.c | 142 +++++++++++++++++++++++++++++++++++
 4 files changed, 207 insertions(+), 56 deletions(-)

-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [dpdk-dev] [PATCH v3 1/3] ethdev: improvement for constant usage
  2014-10-20  2:58 ` [dpdk-dev] [PATCH v3 " Helin Zhang
@ 2014-10-20  2:58   ` Helin Zhang
  2014-10-20  2:58   ` [dpdk-dev] [PATCH v3 2/3] i40e: extern two functions and relevant macros Helin Zhang
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 16+ messages in thread
From: Helin Zhang @ 2014-10-20  2:58 UTC (permalink / raw)
  To: dev

Forced type conversion is not needed to define a macro with
constant. The alternate is to let compiler use the default width,
or specify the width with suffix of 'U', 'UL', 'ULL', etc.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
---
 lib/librte_ether/rte_ethdev.h | 47 ++++++++++++++++++++++---------------------
 1 file changed, 24 insertions(+), 23 deletions(-)

diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 13be711..cf0d48c 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -362,30 +362,31 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_L2_PAYLOAD_SHIFT              63
 
 /* for 1G & 10G */
-#define ETH_RSS_IPV4                    ((uint16_t)1 << ETH_RSS_IPV4_SHIFT)
-#define ETH_RSS_IPV4_TCP                ((uint16_t)1 << ETH_RSS_IPV4_TCP_SHIFT)
-#define ETH_RSS_IPV6                    ((uint16_t)1 << ETH_RSS_IPV6_SHIFT)
-#define ETH_RSS_IPV6_EX                 ((uint16_t)1 << ETH_RSS_IPV6_EX_SHIFT)
-#define ETH_RSS_IPV6_TCP                ((uint16_t)1 << ETH_RSS_IPV6_TCP_SHIFT)
-#define ETH_RSS_IPV6_TCP_EX             ((uint16_t)1 << ETH_RSS_IPV6_TCP_EX_SHIFT)
-#define ETH_RSS_IPV4_UDP                ((uint16_t)1 << ETH_RSS_IPV4_UDP_SHIFT)
-#define ETH_RSS_IPV6_UDP                ((uint16_t)1 << ETH_RSS_IPV6_UDP_SHIFT)
-#define ETH_RSS_IPV6_UDP_EX             ((uint16_t)1 << ETH_RSS_IPV6_UDP_EX_SHIFT)
+#define ETH_RSS_IPV4                    (1 << ETH_RSS_IPV4_SHIFT)
+#define ETH_RSS_IPV4_TCP                (1 << ETH_RSS_IPV4_TCP_SHIFT)
+#define ETH_RSS_IPV6                    (1 << ETH_RSS_IPV6_SHIFT)
+#define ETH_RSS_IPV6_EX                 (1 << ETH_RSS_IPV6_EX_SHIFT)
+#define ETH_RSS_IPV6_TCP                (1 << ETH_RSS_IPV6_TCP_SHIFT)
+#define ETH_RSS_IPV6_TCP_EX             (1 << ETH_RSS_IPV6_TCP_EX_SHIFT)
+#define ETH_RSS_IPV4_UDP                (1 << ETH_RSS_IPV4_UDP_SHIFT)
+#define ETH_RSS_IPV6_UDP                (1 << ETH_RSS_IPV6_UDP_SHIFT)
+#define ETH_RSS_IPV6_UDP_EX             (1 << ETH_RSS_IPV6_UDP_EX_SHIFT)
 /* for 40G only */
-#define ETH_RSS_NONF_IPV4_UDP           ((uint64_t)1 << ETH_RSS_NONF_IPV4_UDP_SHIFT)
-#define ETH_RSS_NONF_IPV4_TCP           ((uint64_t)1 << ETH_RSS_NONF_IPV4_TCP_SHIFT)
-#define ETH_RSS_NONF_IPV4_SCTP          ((uint64_t)1 << ETH_RSS_NONF_IPV4_SCTP_SHIFT)
-#define ETH_RSS_NONF_IPV4_OTHER         ((uint64_t)1 << ETH_RSS_NONF_IPV4_OTHER_SHIFT)
-#define ETH_RSS_FRAG_IPV4               ((uint64_t)1 << ETH_RSS_FRAG_IPV4_SHIFT)
-#define ETH_RSS_NONF_IPV6_UDP           ((uint64_t)1 << ETH_RSS_NONF_IPV6_UDP_SHIFT)
-#define ETH_RSS_NONF_IPV6_TCP           ((uint64_t)1 << ETH_RSS_NONF_IPV6_TCP_SHIFT)
-#define ETH_RSS_NONF_IPV6_SCTP          ((uint64_t)1 << ETH_RSS_NONF_IPV6_SCTP_SHIFT)
-#define ETH_RSS_NONF_IPV6_OTHER         ((uint64_t)1 << ETH_RSS_NONF_IPV6_OTHER_SHIFT)
-#define ETH_RSS_FRAG_IPV6               ((uint64_t)1 << ETH_RSS_FRAG_IPV6_SHIFT)
-#define ETH_RSS_FCOE_OX                 ((uint64_t)1 << ETH_RSS_FCOE_OX_SHIFT) /* not used */
-#define ETH_RSS_FCOE_RX                 ((uint64_t)1 << ETH_RSS_FCOE_RX_SHIFT) /* not used */
-#define ETH_RSS_FCOE_OTHER              ((uint64_t)1 << ETH_RSS_FCOE_OTHER_SHIFT) /* not used */
-#define ETH_RSS_L2_PAYLOAD              ((uint64_t)1 << ETH_RSS_L2_PAYLOAD_SHIFT)
+#define ETH_RSS_NONF_IPV4_UDP           (1ULL << ETH_RSS_NONF_IPV4_UDP_SHIFT)
+#define ETH_RSS_NONF_IPV4_TCP           (1ULL << ETH_RSS_NONF_IPV4_TCP_SHIFT)
+#define ETH_RSS_NONF_IPV4_SCTP          (1ULL << ETH_RSS_NONF_IPV4_SCTP_SHIFT)
+#define ETH_RSS_NONF_IPV4_OTHER         (1ULL << ETH_RSS_NONF_IPV4_OTHER_SHIFT)
+#define ETH_RSS_FRAG_IPV4               (1ULL << ETH_RSS_FRAG_IPV4_SHIFT)
+#define ETH_RSS_NONF_IPV6_UDP           (1ULL << ETH_RSS_NONF_IPV6_UDP_SHIFT)
+#define ETH_RSS_NONF_IPV6_TCP           (1ULL << ETH_RSS_NONF_IPV6_TCP_SHIFT)
+#define ETH_RSS_NONF_IPV6_SCTP          (1ULL << ETH_RSS_NONF_IPV6_SCTP_SHIFT)
+#define ETH_RSS_NONF_IPV6_OTHER         (1ULL << ETH_RSS_NONF_IPV6_OTHER_SHIFT)
+#define ETH_RSS_FRAG_IPV6               (1ULL << ETH_RSS_FRAG_IPV6_SHIFT)
+/* FCOE relevant should not be used */
+#define ETH_RSS_FCOE_OX                 (1ULL << ETH_RSS_FCOE_OX_SHIFT)
+#define ETH_RSS_FCOE_RX                 (1ULL << ETH_RSS_FCOE_RX_SHIFT)
+#define ETH_RSS_FCOE_OTHER              (1ULL << ETH_RSS_FCOE_OTHER_SHIFT)
+#define ETH_RSS_L2_PAYLOAD              (1ULL << ETH_RSS_L2_PAYLOAD_SHIFT)
 
 #define ETH_RSS_IP ( \
 		ETH_RSS_IPV4 | \
-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [dpdk-dev] [PATCH v3 2/3] i40e: extern two functions and relevant macros
  2014-10-20  2:58 ` [dpdk-dev] [PATCH v3 " Helin Zhang
  2014-10-20  2:58   ` [dpdk-dev] [PATCH v3 1/3] ethdev: improvement for constant usage Helin Zhang
@ 2014-10-20  2:58   ` Helin Zhang
  2014-10-20  2:58   ` [dpdk-dev] [PATCH v3 3/3] i40evf: support of RSS in VF Helin Zhang
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 16+ messages in thread
From: Helin Zhang @ 2014-10-20  2:58 UTC (permalink / raw)
  To: dev

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 <helin.zhang@intel.com>
---
 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

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [dpdk-dev] [PATCH v3 3/3] i40evf: support of RSS in VF
  2014-10-20  2:58 ` [dpdk-dev] [PATCH v3 " Helin Zhang
  2014-10-20  2:58   ` [dpdk-dev] [PATCH v3 1/3] ethdev: improvement for constant usage Helin Zhang
  2014-10-20  2:58   ` [dpdk-dev] [PATCH v3 2/3] i40e: extern two functions and relevant macros Helin Zhang
@ 2014-10-20  2:58   ` Helin Zhang
  2014-10-20  6:50   ` [dpdk-dev] [PATCH v3 0/3] add i40e RSS support " Liu, Jijiang
  2014-10-20  8:43   ` Liang, Cunming
  4 siblings, 0 replies; 16+ messages in thread
From: Helin Zhang @ 2014-10-20  2:58 UTC (permalink / raw)
  To: dev

i40e hardware supports RSS in VF, the code changes are to add
this support.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
---
 lib/librte_pmd_i40e/i40e_ethdev.h    |   6 ++
 lib/librte_pmd_i40e/i40e_ethdev_vf.c | 142 +++++++++++++++++++++++++++++++++++
 2 files changed, 148 insertions(+)

v2 changes:
* Updating/querying redirection table has been removed, as it
  will be in another patches of supporting different redirection
  table sizes soon later.


diff --git a/lib/librte_pmd_i40e/i40e_ethdev.h b/lib/librte_pmd_i40e/i40e_ethdev.h
index c801345..1d42cd2 100644
--- a/lib/librte_pmd_i40e/i40e_ethdev.h
+++ b/lib/librte_pmd_i40e/i40e_ethdev.h
@@ -283,6 +283,8 @@ struct i40e_vf_tx_queues {
  * Structure to store private data specific for VF instance.
  */
 struct i40e_vf {
+	struct i40e_adapter *adapter; /* The adapter this VF associate to */
+	struct rte_eth_dev_data *dev_data; /* Pointer to the device data */
 	uint16_t num_queue_pairs;
 	uint16_t max_pkt_len; /* Maximum packet length */
 	bool promisc_unicast_enabled;
@@ -393,6 +395,10 @@ i40e_get_vsi_from_adapter(struct i40e_adapter *adapter)
 #define I40E_PF_TO_ADAPTER(pf) \
 	((struct i40e_adapter *)pf->adapter)
 
+/* I40E_VF_TO */
+#define I40E_VF_TO_HW(vf) \
+	(&(((struct i40e_vf *)vf)->adapter->hw))
+
 static inline void
 i40e_init_adminq_parameter(struct i40e_hw *hw)
 {
diff --git a/lib/librte_pmd_i40e/i40e_ethdev_vf.c b/lib/librte_pmd_i40e/i40e_ethdev_vf.c
index f7a932d..fa838e6 100644
--- a/lib/librte_pmd_i40e/i40e_ethdev_vf.c
+++ b/lib/librte_pmd_i40e/i40e_ethdev_vf.c
@@ -126,10 +126,19 @@ static void i40evf_dev_allmulticast_disable(struct rte_eth_dev *dev);
 static int i40evf_get_link_status(struct rte_eth_dev *dev,
 				  struct rte_eth_link *link);
 static int i40evf_init_vlan(struct rte_eth_dev *dev);
+static int i40evf_config_rss(struct i40e_vf *vf);
+static int i40evf_dev_rss_hash_update(struct rte_eth_dev *dev,
+				      struct rte_eth_rss_conf *rss_conf);
+static int i40evf_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
+					struct rte_eth_rss_conf *rss_conf);
 static int i40evf_dev_rx_queue_start(struct rte_eth_dev *, uint16_t);
 static int i40evf_dev_rx_queue_stop(struct rte_eth_dev *, uint16_t);
 static int i40evf_dev_tx_queue_start(struct rte_eth_dev *, uint16_t);
 static int i40evf_dev_tx_queue_stop(struct rte_eth_dev *, uint16_t);
+
+/* Default hash key buffer for RSS */
+static uint32_t rss_key_default[I40E_VFQF_HKEY_MAX_INDEX + 1];
+
 static struct eth_dev_ops i40evf_eth_dev_ops = {
 	.dev_configure        = i40evf_dev_configure,
 	.dev_start            = i40evf_dev_start,
@@ -153,6 +162,8 @@ static struct eth_dev_ops i40evf_eth_dev_ops = {
 	.rx_queue_release     = i40e_dev_rx_queue_release,
 	.tx_queue_setup       = i40e_dev_tx_queue_setup,
 	.tx_queue_release     = i40e_dev_tx_queue_release,
+	.rss_hash_update      = i40evf_dev_rss_hash_update,
+	.rss_hash_conf_get    = i40evf_dev_rss_hash_conf_get,
 };
 
 static int
@@ -972,6 +983,8 @@ i40evf_init_vf(struct rte_eth_dev *dev)
 	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 
+	vf->adapter = I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
+	vf->dev_data = dev->data;
 	err = i40evf_set_mac_type(hw);
 	if (err) {
 		PMD_INIT_LOG(ERR, "set_mac_type failed: %d", err);
@@ -1328,11 +1341,13 @@ i40evf_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)
 static int
 i40evf_rx_init(struct rte_eth_dev *dev)
 {
+	struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 	uint16_t i;
 	struct i40e_rx_queue **rxq =
 		(struct i40e_rx_queue **)dev->data->rx_queues;
 	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
+	i40evf_config_rss(vf);
 	for (i = 0; i < dev->data->nb_rx_queues; i++) {
 		rxq[i]->qrx_tail = hw->hw_addr + I40E_QRX_TAIL1(i);
 		I40E_PCI_REG_WRITE(rxq[i]->qrx_tail, rxq[i]->nb_rx_desc - 1);
@@ -1567,3 +1582,130 @@ i40evf_dev_close(struct rte_eth_dev *dev)
 	i40evf_reset_vf(hw);
 	i40e_shutdown_adminq(hw);
 }
+
+static int
+i40evf_hw_rss_hash_set(struct i40e_hw *hw, struct rte_eth_rss_conf *rss_conf)
+{
+	uint32_t *hash_key;
+	uint8_t hash_key_len;
+	uint64_t rss_hf, hena;
+
+	hash_key = (uint32_t *)(rss_conf->rss_key);
+	hash_key_len = rss_conf->rss_key_len;
+	if (hash_key != NULL && hash_key_len >=
+		(I40E_VFQF_HKEY_MAX_INDEX + 1) * sizeof(uint32_t)) {
+		uint16_t i;
+
+		for (i = 0; i <= I40E_VFQF_HKEY_MAX_INDEX; i++)
+			I40E_WRITE_REG(hw, I40E_VFQF_HKEY(i), hash_key[i]);
+	}
+
+	rss_hf = rss_conf->rss_hf;
+	hena = (uint64_t)I40E_READ_REG(hw, I40E_VFQF_HENA(0));
+	hena |= ((uint64_t)I40E_READ_REG(hw, I40E_VFQF_HENA(1))) << 32;
+	hena &= ~I40E_RSS_HENA_ALL;
+	hena |= i40e_config_hena(rss_hf);
+	I40E_WRITE_REG(hw, I40E_VFQF_HENA(0), (uint32_t)hena);
+	I40E_WRITE_REG(hw, I40E_VFQF_HENA(1), (uint32_t)(hena >> 32));
+	I40EVF_WRITE_FLUSH(hw);
+
+	return 0;
+}
+
+static void
+i40evf_disable_rss(struct i40e_vf *vf)
+{
+	struct i40e_hw *hw = I40E_VF_TO_HW(vf);
+	uint64_t hena;
+
+	hena = (uint64_t)I40E_READ_REG(hw, I40E_VFQF_HENA(0));
+	hena |= ((uint64_t)I40E_READ_REG(hw, I40E_VFQF_HENA(1))) << 32;
+	hena &= ~I40E_RSS_HENA_ALL;
+	I40E_WRITE_REG(hw, I40E_VFQF_HENA(0), (uint32_t)hena);
+	I40E_WRITE_REG(hw, I40E_VFQF_HENA(1), (uint32_t)(hena >> 32));
+	I40EVF_WRITE_FLUSH(hw);
+}
+
+static int
+i40evf_config_rss(struct i40e_vf *vf)
+{
+	struct i40e_hw *hw = I40E_VF_TO_HW(vf);
+	struct rte_eth_rss_conf rss_conf;
+	uint32_t i, j, lut = 0, nb_q = (I40E_VFQF_HLUT_MAX_INDEX + 1) * 4;
+
+	if (vf->dev_data->dev_conf.rxmode.mq_mode != ETH_MQ_RX_RSS) {
+		i40evf_disable_rss(vf);
+		PMD_DRV_LOG(DEBUG, "RSS not configured\n");
+		return 0;
+	}
+
+	/* Fill out the look up table */
+	for (i = 0, j = 0; i < nb_q; i++, j++) {
+		if (j >= vf->num_queue_pairs)
+			j = 0;
+		lut = (lut << 8) | j;
+		if ((i & 3) == 3)
+			I40E_WRITE_REG(hw, I40E_VFQF_HLUT(i >> 2), lut);
+	}
+
+	rss_conf = vf->dev_data->dev_conf.rx_adv_conf.rss_conf;
+	if ((rss_conf.rss_hf & I40E_RSS_OFFLOAD_ALL) == 0) {
+		i40evf_disable_rss(vf);
+		PMD_DRV_LOG(DEBUG, "No hash flag is set\n");
+		return 0;
+	}
+
+	if (rss_conf.rss_key == NULL || rss_conf.rss_key_len < nb_q) {
+		/* Calculate the default hash key */
+		for (i = 0; i <= I40E_VFQF_HKEY_MAX_INDEX; i++)
+			rss_key_default[i] = (uint32_t)rte_rand();
+		rss_conf.rss_key = (uint8_t *)rss_key_default;
+		rss_conf.rss_key_len = nb_q;
+	}
+
+	return i40evf_hw_rss_hash_set(hw, &rss_conf);
+}
+
+static int
+i40evf_dev_rss_hash_update(struct rte_eth_dev *dev,
+			   struct rte_eth_rss_conf *rss_conf)
+{
+	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	uint64_t rss_hf = rss_conf->rss_hf & I40E_RSS_OFFLOAD_ALL;
+	uint64_t hena;
+
+	hena = (uint64_t)I40E_READ_REG(hw, I40E_VFQF_HENA(0));
+	hena |= ((uint64_t)I40E_READ_REG(hw, I40E_VFQF_HENA(1))) << 32;
+	if (!(hena & I40E_RSS_HENA_ALL)) { /* RSS disabled */
+		if (rss_hf != 0) /* Enable RSS */
+			return -EINVAL;
+		return 0;
+	}
+
+	/* RSS enabled */
+	if (rss_hf == 0) /* Disable RSS */
+		return -EINVAL;
+
+	return i40evf_hw_rss_hash_set(hw, rss_conf);
+}
+
+static int
+i40evf_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
+			     struct rte_eth_rss_conf *rss_conf)
+{
+	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	uint32_t *hash_key = (uint32_t *)(rss_conf->rss_key);
+	uint64_t hena;
+	uint16_t i;
+
+	if (hash_key) {
+		for (i = 0; i <= I40E_VFQF_HKEY_MAX_INDEX; i++)
+			hash_key[i] = I40E_READ_REG(hw, I40E_VFQF_HKEY(i));
+		rss_conf->rss_key_len = i * sizeof(uint32_t);
+	}
+	hena = (uint64_t)I40E_READ_REG(hw, I40E_VFQF_HENA(0));
+	hena |= ((uint64_t)I40E_READ_REG(hw, I40E_VFQF_HENA(1))) << 32;
+	rss_conf->rss_hf = i40e_parse_hena(hena);
+
+	return 0;
+}
-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [dpdk-dev] [PATCH v3 0/3] add i40e RSS support in VF
  2014-10-20  2:58 ` [dpdk-dev] [PATCH v3 " Helin Zhang
                     ` (2 preceding siblings ...)
  2014-10-20  2:58   ` [dpdk-dev] [PATCH v3 3/3] i40evf: support of RSS in VF Helin Zhang
@ 2014-10-20  6:50   ` Liu, Jijiang
  2014-10-20 21:57     ` Thomas Monjalon
  2014-10-20  8:43   ` Liang, Cunming
  4 siblings, 1 reply; 16+ messages in thread
From: Liu, Jijiang @ 2014-10-20  6:50 UTC (permalink / raw)
  To: Zhang, Helin, dev

Acked-by: Jijiang Liu <jijiang.liu@intel.com>

> -----Original Message-----
> From: Zhang, Helin
> Sent: Monday, October 20, 2014 10:58 AM
> To: dev@dpdk.org
> Cc: Cao, Waterman; Zhang, Helin
> Subject: [PATCH v3 0/3] add i40e RSS support in VF
> 
> As hardware supports RSS in VF, the patches add that support in driver. In
> addition, minor improvements are added for defining macro with constant.
> 
> v2 changes:
> * Removed support of updating/querying redirection table, as it
>   will be implemented in another patches later.
> * Removed changes in testpmd, as it is not needed at all for
>   supporting RSS in VF.
> 
> v3 changes:
> * Removed macros in i40e_ethdev.c, as they have already been
>   moved to i40e_ethdev.h.
> 
> 
> Helin Zhang (3):
>   ethdev: improvement for constant usage
>   i40e: extern two functions and relevant macros
>   i40evf: support of RSS in VF
> 
>  lib/librte_ether/rte_ethdev.h        |  47 ++++++------
>  lib/librte_pmd_i40e/i40e_ethdev.c    |  34 +--------
>  lib/librte_pmd_i40e/i40e_ethdev.h    |  40 +++++++++-
>  lib/librte_pmd_i40e/i40e_ethdev_vf.c | 142
> +++++++++++++++++++++++++++++++++++
>  4 files changed, 207 insertions(+), 56 deletions(-)
> 
> --
> 1.8.1.4

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [dpdk-dev] [PATCH v3 0/3] add i40e RSS support in VF
  2014-10-20  2:58 ` [dpdk-dev] [PATCH v3 " Helin Zhang
                     ` (3 preceding siblings ...)
  2014-10-20  6:50   ` [dpdk-dev] [PATCH v3 0/3] add i40e RSS support " Liu, Jijiang
@ 2014-10-20  8:43   ` Liang, Cunming
  4 siblings, 0 replies; 16+ messages in thread
From: Liang, Cunming @ 2014-10-20  8:43 UTC (permalink / raw)
  To: Zhang, Helin, dev

Acked-by: Cunming Liang <cunming.liang@intel.com>

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Helin Zhang
> Sent: Monday, October 20, 2014 10:58 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v3 0/3] add i40e RSS support in VF
> 
> As hardware supports RSS in VF, the patches add that support
> in driver. In addition, minor improvements are added for
> defining macro with constant.
> 
> v2 changes:
> * Removed support of updating/querying redirection table, as it
>   will be implemented in another patches later.
> * Removed changes in testpmd, as it is not needed at all for
>   supporting RSS in VF.
> 
> v3 changes:
> * Removed macros in i40e_ethdev.c, as they have already been
>   moved to i40e_ethdev.h.
> 
> 
> Helin Zhang (3):
>   ethdev: improvement for constant usage
>   i40e: extern two functions and relevant macros
>   i40evf: support of RSS in VF
> 
>  lib/librte_ether/rte_ethdev.h        |  47 ++++++------
>  lib/librte_pmd_i40e/i40e_ethdev.c    |  34 +--------
>  lib/librte_pmd_i40e/i40e_ethdev.h    |  40 +++++++++-
>  lib/librte_pmd_i40e/i40e_ethdev_vf.c | 142
> +++++++++++++++++++++++++++++++++++
>  4 files changed, 207 insertions(+), 56 deletions(-)
> 
> --
> 1.8.1.4

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [dpdk-dev] [PATCH v3 0/3] add i40e RSS support in VF
  2014-10-20  6:50   ` [dpdk-dev] [PATCH v3 0/3] add i40e RSS support " Liu, Jijiang
@ 2014-10-20 21:57     ` Thomas Monjalon
  0 siblings, 0 replies; 16+ messages in thread
From: Thomas Monjalon @ 2014-10-20 21:57 UTC (permalink / raw)
  To: Zhang, Helin; +Cc: dev

> > As hardware supports RSS in VF, the patches add that support in driver. In
> > addition, minor improvements are added for defining macro with constant.
> > 
> > v2 changes:
> > * Removed support of updating/querying redirection table, as it
> >   will be implemented in another patches later.
> > * Removed changes in testpmd, as it is not needed at all for
> >   supporting RSS in VF.
> > 
> > v3 changes:
> > * Removed macros in i40e_ethdev.c, as they have already been
> >   moved to i40e_ethdev.h.
> > 
> > 
> > Helin Zhang (3):
> >   ethdev: improvement for constant usage
> >   i40e: extern two functions and relevant macros
> >   i40evf: support of RSS in VF
> 
> Acked-by: Jijiang Liu <jijiang.liu@intel.com>
> Acked-by: Cunming Liang <cunming.liang@intel.com>

Applied

Thanks
-- 
Thomas

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2014-10-20 21:49 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-19  1:14 [dpdk-dev] [PATCH v2 0/3] add i40e RSS support in VF Helin Zhang
2014-09-19  1:14 ` [dpdk-dev] [PATCH v2 1/3] ethdev: improvement for constant usage Helin Zhang
2014-09-19  1:14 ` [dpdk-dev] [PATCH v2 2/3] i40e: extern two functions and relevant macros Helin Zhang
2014-10-17 20:59   ` Thomas Monjalon
2014-10-20  1:11     ` Zhang, Helin
2014-09-19  1:14 ` [dpdk-dev] [PATCH v2 3/3] i40evf: support of RSS in VF Helin Zhang
2014-09-29  1:39 ` [dpdk-dev] [PATCH v2 0/3] add i40e RSS support " Zhan, Zhaochen
2014-10-10  3:10 ` Liang, Cunming
2014-10-11  7:57 ` Zhang, Helin
2014-10-20  2:58 ` [dpdk-dev] [PATCH v3 " Helin Zhang
2014-10-20  2:58   ` [dpdk-dev] [PATCH v3 1/3] ethdev: improvement for constant usage Helin Zhang
2014-10-20  2:58   ` [dpdk-dev] [PATCH v3 2/3] i40e: extern two functions and relevant macros Helin Zhang
2014-10-20  2:58   ` [dpdk-dev] [PATCH v3 3/3] i40evf: support of RSS in VF Helin Zhang
2014-10-20  6:50   ` [dpdk-dev] [PATCH v3 0/3] add i40e RSS support " Liu, Jijiang
2014-10-20 21:57     ` Thomas Monjalon
2014-10-20  8:43   ` Liang, Cunming

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