DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/i40e: fix fdir cannot receive rx writeback issue
@ 2020-07-15 22:48 chenmin.sun
  2020-07-15 23:03 ` [dpdk-dev] [PATCH V2] " chenmin.sun
  0 siblings, 1 reply; 6+ messages in thread
From: chenmin.sun @ 2020-07-15 22:48 UTC (permalink / raw)
  To: qi.z.zhang, beilei.xing; +Cc: dev, chenmin.sun

From: Chenmin Sun <chenmin.sun@intel.com>

This patch fixes the fdir connot receive rx writeback packet issue,
by setting the fdir_vsi->nb_used_qps to 1.
Besides this, to make sure fdir programming works fine when the port
is stopped, move the fdir interrupt configure from start/stop to
setup/teardown.

Fixes: cfd662d22e ("net/i40e: fix interrupt throttling setting in PF")

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 15 ++-------------
 drivers/net/i40e/i40e_ethdev.h |  2 ++
 drivers/net/i40e/i40e_fdir.c   | 11 +++++++++++
 3 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 393b5320f..8933a39f2 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2068,7 +2068,7 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)
 	}
 }
 
-static void
+void
 i40e_vsi_enable_queues_intr(struct i40e_vsi *vsi)
 {
 	struct rte_eth_dev *dev = vsi->adapter->eth_dev;
@@ -2095,7 +2095,7 @@ i40e_vsi_enable_queues_intr(struct i40e_vsi *vsi)
 	I40E_WRITE_FLUSH(hw);
 }
 
-static void
+void
 i40e_vsi_disable_queues_intr(struct i40e_vsi *vsi)
 {
 	struct rte_eth_dev *dev = vsi->adapter->eth_dev;
@@ -2317,13 +2317,6 @@ i40e_dev_start(struct rte_eth_dev *dev)
 		i40e_vsi_enable_queues_intr(pf->vmdq[i].vsi);
 	}
 
-	/* enable FDIR MSIX interrupt */
-	if (pf->fdir.fdir_vsi) {
-		i40e_vsi_queues_bind_intr(pf->fdir.fdir_vsi,
-					  I40E_ITR_INDEX_NONE);
-		i40e_vsi_enable_queues_intr(pf->fdir.fdir_vsi);
-	}
-
 	/* Enable all queues which have been configured */
 	for (nb_rxq = 0; nb_rxq < dev->data->nb_rx_queues; nb_rxq++) {
 		ret = i40e_dev_rx_queue_start(dev, nb_rxq);
@@ -2459,10 +2452,6 @@ i40e_dev_stop(struct rte_eth_dev *dev)
 		i40e_vsi_queues_unbind_intr(pf->vmdq[i].vsi);
 	}
 
-	if (pf->fdir.fdir_vsi) {
-		i40e_vsi_queues_unbind_intr(pf->fdir.fdir_vsi);
-		i40e_vsi_disable_queues_intr(pf->fdir.fdir_vsi);
-	}
 	/* Clear all queues and release memory */
 	i40e_dev_clear_queues(dev);
 
diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index 31ca05de9..886c98b15 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -1268,6 +1268,7 @@ void i40e_pf_enable_irq0(struct i40e_hw *hw);
 int i40e_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete);
 void i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx);
 void i40e_vsi_queues_unbind_intr(struct i40e_vsi *vsi);
+void i40e_vsi_disable_queues_intr(struct i40e_vsi *vsi);
 int i40e_vsi_vlan_pvid_set(struct i40e_vsi *vsi,
 			   struct i40e_vsi_vlan_pvid_info *info);
 int i40e_vsi_config_vlan_stripping(struct i40e_vsi *vsi, bool on);
@@ -1277,6 +1278,7 @@ uint64_t i40e_parse_hena(const struct i40e_adapter *adapter, uint64_t flags);
 enum i40e_status_code i40e_fdir_setup_tx_resources(struct i40e_pf *pf);
 enum i40e_status_code i40e_fdir_setup_rx_resources(struct i40e_pf *pf);
 int i40e_fdir_setup(struct i40e_pf *pf);
+void i40e_vsi_enable_queues_intr(struct i40e_vsi *vsi);
 const struct rte_memzone *i40e_memzone_reserve(const char *name,
 					uint32_t len,
 					int socket_id);
diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index 71eb31fb8..60eeccc1a 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -228,6 +228,11 @@ i40e_fdir_setup(struct i40e_pf *pf)
 		goto fail_mem;
 	}
 
+	/* enable FDIR MSIX interrupt */
+	vsi->nb_used_qps = 1;
+	i40e_vsi_queues_bind_intr(vsi, I40E_ITR_INDEX_NONE);
+	i40e_vsi_enable_queues_intr(vsi);
+
 	/* reserve memory for the fdir programming packet */
 	snprintf(z_name, sizeof(z_name), "%s_%s_%d",
 			eth_dev->device->driver->name,
@@ -274,12 +279,18 @@ i40e_fdir_teardown(struct i40e_pf *pf)
 	vsi = pf->fdir.fdir_vsi;
 	if (!vsi)
 		return;
+
+	/* disable FDIR MSIX interrupt */
+	i40e_vsi_queues_unbind_intr(vsi);
+	i40e_vsi_disable_queues_intr(vsi);
+
 	int err = i40e_switch_tx_queue(hw, vsi->base_queue, FALSE);
 	if (err)
 		PMD_DRV_LOG(DEBUG, "Failed to do FDIR TX switch off");
 	err = i40e_switch_rx_queue(hw, vsi->base_queue, FALSE);
 	if (err)
 		PMD_DRV_LOG(DEBUG, "Failed to do FDIR RX switch off");
+
 	i40e_dev_rx_queue_release(pf->fdir.rxq);
 	rte_eth_dma_zone_free(dev, "fdir_rx_ring", pf->fdir.rxq->queue_id);
 	pf->fdir.rxq = NULL;
-- 
2.17.1


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

* [dpdk-dev] [PATCH V2] net/i40e: fix fdir cannot receive rx writeback issue
  2020-07-15 22:48 [dpdk-dev] [PATCH] net/i40e: fix fdir cannot receive rx writeback issue chenmin.sun
@ 2020-07-15 23:03 ` chenmin.sun
  2020-07-16  8:25   ` Xing, Beilei
  2020-07-17 14:57   ` [dpdk-dev] [PATCH v3] " chenmin.sun
  0 siblings, 2 replies; 6+ messages in thread
From: chenmin.sun @ 2020-07-15 23:03 UTC (permalink / raw)
  To: qi.z.zhang, beilei.xing; +Cc: dev, chenmin.sun

From: Chenmin Sun <chenmin.sun@intel.com>

This patch fixes the fdir cannot receive rx writeback packet issue,
by setting the fdir_vsi->nb_used_qps to 1.
Besides this, to make sure fdir programming works fine when the port
is stopped, move the fdir interrupt configure from start/stop to
setup/teardown.

Fixes: cfd662d22e ("net/i40e: fix interrupt throttling setting in PF")

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
---

v2:
* Fix commit message typo
---
 drivers/net/i40e/i40e_ethdev.c | 15 ++-------------
 drivers/net/i40e/i40e_ethdev.h |  2 ++
 drivers/net/i40e/i40e_fdir.c   | 11 +++++++++++
 3 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 393b5320f..8933a39f2 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2068,7 +2068,7 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)
 	}
 }
 
-static void
+void
 i40e_vsi_enable_queues_intr(struct i40e_vsi *vsi)
 {
 	struct rte_eth_dev *dev = vsi->adapter->eth_dev;
@@ -2095,7 +2095,7 @@ i40e_vsi_enable_queues_intr(struct i40e_vsi *vsi)
 	I40E_WRITE_FLUSH(hw);
 }
 
-static void
+void
 i40e_vsi_disable_queues_intr(struct i40e_vsi *vsi)
 {
 	struct rte_eth_dev *dev = vsi->adapter->eth_dev;
@@ -2317,13 +2317,6 @@ i40e_dev_start(struct rte_eth_dev *dev)
 		i40e_vsi_enable_queues_intr(pf->vmdq[i].vsi);
 	}
 
-	/* enable FDIR MSIX interrupt */
-	if (pf->fdir.fdir_vsi) {
-		i40e_vsi_queues_bind_intr(pf->fdir.fdir_vsi,
-					  I40E_ITR_INDEX_NONE);
-		i40e_vsi_enable_queues_intr(pf->fdir.fdir_vsi);
-	}
-
 	/* Enable all queues which have been configured */
 	for (nb_rxq = 0; nb_rxq < dev->data->nb_rx_queues; nb_rxq++) {
 		ret = i40e_dev_rx_queue_start(dev, nb_rxq);
@@ -2459,10 +2452,6 @@ i40e_dev_stop(struct rte_eth_dev *dev)
 		i40e_vsi_queues_unbind_intr(pf->vmdq[i].vsi);
 	}
 
-	if (pf->fdir.fdir_vsi) {
-		i40e_vsi_queues_unbind_intr(pf->fdir.fdir_vsi);
-		i40e_vsi_disable_queues_intr(pf->fdir.fdir_vsi);
-	}
 	/* Clear all queues and release memory */
 	i40e_dev_clear_queues(dev);
 
diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index 31ca05de9..886c98b15 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -1268,6 +1268,7 @@ void i40e_pf_enable_irq0(struct i40e_hw *hw);
 int i40e_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete);
 void i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx);
 void i40e_vsi_queues_unbind_intr(struct i40e_vsi *vsi);
+void i40e_vsi_disable_queues_intr(struct i40e_vsi *vsi);
 int i40e_vsi_vlan_pvid_set(struct i40e_vsi *vsi,
 			   struct i40e_vsi_vlan_pvid_info *info);
 int i40e_vsi_config_vlan_stripping(struct i40e_vsi *vsi, bool on);
@@ -1277,6 +1278,7 @@ uint64_t i40e_parse_hena(const struct i40e_adapter *adapter, uint64_t flags);
 enum i40e_status_code i40e_fdir_setup_tx_resources(struct i40e_pf *pf);
 enum i40e_status_code i40e_fdir_setup_rx_resources(struct i40e_pf *pf);
 int i40e_fdir_setup(struct i40e_pf *pf);
+void i40e_vsi_enable_queues_intr(struct i40e_vsi *vsi);
 const struct rte_memzone *i40e_memzone_reserve(const char *name,
 					uint32_t len,
 					int socket_id);
diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index 71eb31fb8..60eeccc1a 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -228,6 +228,11 @@ i40e_fdir_setup(struct i40e_pf *pf)
 		goto fail_mem;
 	}
 
+	/* enable FDIR MSIX interrupt */
+	vsi->nb_used_qps = 1;
+	i40e_vsi_queues_bind_intr(vsi, I40E_ITR_INDEX_NONE);
+	i40e_vsi_enable_queues_intr(vsi);
+
 	/* reserve memory for the fdir programming packet */
 	snprintf(z_name, sizeof(z_name), "%s_%s_%d",
 			eth_dev->device->driver->name,
@@ -274,12 +279,18 @@ i40e_fdir_teardown(struct i40e_pf *pf)
 	vsi = pf->fdir.fdir_vsi;
 	if (!vsi)
 		return;
+
+	/* disable FDIR MSIX interrupt */
+	i40e_vsi_queues_unbind_intr(vsi);
+	i40e_vsi_disable_queues_intr(vsi);
+
 	int err = i40e_switch_tx_queue(hw, vsi->base_queue, FALSE);
 	if (err)
 		PMD_DRV_LOG(DEBUG, "Failed to do FDIR TX switch off");
 	err = i40e_switch_rx_queue(hw, vsi->base_queue, FALSE);
 	if (err)
 		PMD_DRV_LOG(DEBUG, "Failed to do FDIR RX switch off");
+
 	i40e_dev_rx_queue_release(pf->fdir.rxq);
 	rte_eth_dma_zone_free(dev, "fdir_rx_ring", pf->fdir.rxq->queue_id);
 	pf->fdir.rxq = NULL;
-- 
2.17.1


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

* Re: [dpdk-dev] [PATCH V2] net/i40e: fix fdir cannot receive rx writeback issue
  2020-07-15 23:03 ` [dpdk-dev] [PATCH V2] " chenmin.sun
@ 2020-07-16  8:25   ` Xing, Beilei
  2020-07-17 14:57   ` [dpdk-dev] [PATCH v3] " chenmin.sun
  1 sibling, 0 replies; 6+ messages in thread
From: Xing, Beilei @ 2020-07-16  8:25 UTC (permalink / raw)
  To: Sun, Chenmin, Zhang, Qi Z; +Cc: dev



> -----Original Message-----
> From: Sun, Chenmin <chenmin.sun@intel.com>
> Sent: Thursday, July 16, 2020 7:04 AM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org; Sun, Chenmin <chenmin.sun@intel.com>
> Subject: [PATCH V2] net/i40e: fix fdir cannot receive rx writeback issue
> 
> From: Chenmin Sun <chenmin.sun@intel.com>
> 
> This patch fixes the fdir cannot receive rx writeback packet issue, by setting the
> fdir_vsi->nb_used_qps to 1.

Better to describe what's the root cause but not how to set the detailed value.
The root cause should be FDIR interrupt is not enabled successfully.

> Besides this, to make sure fdir programming works fine when the port is
> stopped, move the fdir interrupt configure from start/stop to setup/teardown.
> 
> Fixes: cfd662d22e ("net/i40e: fix interrupt throttling setting in PF")
> 
> Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
> ---
> 
> v2:
> * Fix commit message typo
> ---
>  drivers/net/i40e/i40e_ethdev.c | 15 ++-------------
> drivers/net/i40e/i40e_ethdev.h |  2 ++
>  drivers/net/i40e/i40e_fdir.c   | 11 +++++++++++
>  3 files changed, 15 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
> index 393b5320f..8933a39f2 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -2068,7 +2068,7 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi,
> uint16_t itr_idx)
>  	}
>  }
> 
> -static void
> +void
>  i40e_vsi_enable_queues_intr(struct i40e_vsi *vsi)  {
>  	struct rte_eth_dev *dev = vsi->adapter->eth_dev; @@ -2095,7 +2095,7
> @@ i40e_vsi_enable_queues_intr(struct i40e_vsi *vsi)
>  	I40E_WRITE_FLUSH(hw);
>  }
> 
> -static void
> +void
>  i40e_vsi_disable_queues_intr(struct i40e_vsi *vsi)  {
>  	struct rte_eth_dev *dev = vsi->adapter->eth_dev; @@ -2317,13
> +2317,6 @@ i40e_dev_start(struct rte_eth_dev *dev)
>  		i40e_vsi_enable_queues_intr(pf->vmdq[i].vsi);
>  	}
> 
> -	/* enable FDIR MSIX interrupt */
> -	if (pf->fdir.fdir_vsi) {
> -		i40e_vsi_queues_bind_intr(pf->fdir.fdir_vsi,
> -					  I40E_ITR_INDEX_NONE);
> -		i40e_vsi_enable_queues_intr(pf->fdir.fdir_vsi);
> -	}
> -
>  	/* Enable all queues which have been configured */
>  	for (nb_rxq = 0; nb_rxq < dev->data->nb_rx_queues; nb_rxq++) {
>  		ret = i40e_dev_rx_queue_start(dev, nb_rxq); @@ -2459,10
> +2452,6 @@ i40e_dev_stop(struct rte_eth_dev *dev)
>  		i40e_vsi_queues_unbind_intr(pf->vmdq[i].vsi);
>  	}
> 
> -	if (pf->fdir.fdir_vsi) {
> -		i40e_vsi_queues_unbind_intr(pf->fdir.fdir_vsi);
> -		i40e_vsi_disable_queues_intr(pf->fdir.fdir_vsi);
> -	}
>  	/* Clear all queues and release memory */
>  	i40e_dev_clear_queues(dev);
> 
> diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
> index 31ca05de9..886c98b15 100644
> --- a/drivers/net/i40e/i40e_ethdev.h
> +++ b/drivers/net/i40e/i40e_ethdev.h
> @@ -1268,6 +1268,7 @@ void i40e_pf_enable_irq0(struct i40e_hw *hw);  int
> i40e_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete);  void
> i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx);  void
> i40e_vsi_queues_unbind_intr(struct i40e_vsi *vsi);
> +void i40e_vsi_disable_queues_intr(struct i40e_vsi *vsi);
>  int i40e_vsi_vlan_pvid_set(struct i40e_vsi *vsi,
>  			   struct i40e_vsi_vlan_pvid_info *info);  int
> i40e_vsi_config_vlan_stripping(struct i40e_vsi *vsi, bool on); @@ -1277,6
> +1278,7 @@ uint64_t i40e_parse_hena(const struct i40e_adapter *adapter,
> uint64_t flags);  enum i40e_status_code i40e_fdir_setup_tx_resources(struct
> i40e_pf *pf);  enum i40e_status_code i40e_fdir_setup_rx_resources(struct
> i40e_pf *pf);  int i40e_fdir_setup(struct i40e_pf *pf);
> +void i40e_vsi_enable_queues_intr(struct i40e_vsi *vsi);
>  const struct rte_memzone *i40e_memzone_reserve(const char *name,
>  					uint32_t len,
>  					int socket_id);
> diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c index
> 71eb31fb8..60eeccc1a 100644
> --- a/drivers/net/i40e/i40e_fdir.c
> +++ b/drivers/net/i40e/i40e_fdir.c
> @@ -228,6 +228,11 @@ i40e_fdir_setup(struct i40e_pf *pf)
>  		goto fail_mem;
>  	}
> 
> +	/* enable FDIR MSIX interrupt */
> +	vsi->nb_used_qps = 1;
> +	i40e_vsi_queues_bind_intr(vsi, I40E_ITR_INDEX_NONE);
> +	i40e_vsi_enable_queues_intr(vsi);
> +
>  	/* reserve memory for the fdir programming packet */
>  	snprintf(z_name, sizeof(z_name), "%s_%s_%d",
>  			eth_dev->device->driver->name,
> @@ -274,12 +279,18 @@ i40e_fdir_teardown(struct i40e_pf *pf)
>  	vsi = pf->fdir.fdir_vsi;
>  	if (!vsi)
>  		return;
> +
> +	/* disable FDIR MSIX interrupt */
> +	i40e_vsi_queues_unbind_intr(vsi);
> +	i40e_vsi_disable_queues_intr(vsi);
> +
>  	int err = i40e_switch_tx_queue(hw, vsi->base_queue, FALSE);
>  	if (err)
>  		PMD_DRV_LOG(DEBUG, "Failed to do FDIR TX switch off");
>  	err = i40e_switch_rx_queue(hw, vsi->base_queue, FALSE);
>  	if (err)
>  		PMD_DRV_LOG(DEBUG, "Failed to do FDIR RX switch off");
> +
>  	i40e_dev_rx_queue_release(pf->fdir.rxq);
>  	rte_eth_dma_zone_free(dev, "fdir_rx_ring", pf->fdir.rxq->queue_id);
>  	pf->fdir.rxq = NULL;
> --
> 2.17.1


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

* Re: [dpdk-dev] [PATCH v3] net/i40e: fix fdir cannot receive rx writeback issue
  2020-07-17 14:57   ` [dpdk-dev] [PATCH v3] " chenmin.sun
@ 2020-07-17 14:48     ` Xing, Beilei
  2020-07-20  9:51       ` Zhang, Qi Z
  0 siblings, 1 reply; 6+ messages in thread
From: Xing, Beilei @ 2020-07-17 14:48 UTC (permalink / raw)
  To: Sun, Chenmin, Zhang, Qi Z; +Cc: dev



> -----Original Message-----
> From: Sun, Chenmin <chenmin.sun@intel.com>
> Sent: Friday, July 17, 2020 10:58 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org; Sun, Chenmin <chenmin.sun@intel.com>
> Subject: [PATCH v3] net/i40e: fix fdir cannot receive rx writeback issue
> 
> From: Chenmin Sun <chenmin.sun@intel.com>
> 
> This patch fixes the fdir cannot receive rx writeback packet issue.
> The root cause is FDIR interrupt is not correctly enabled.
> 
> Beside this, to make sure fdir programming works fine when the port is
> stopped, move the fdir interrupt configure from start/stop to setup/teardown.
> 
> Fixes: cfd662d22e7b ("net/i40e: fix interrupt throttling setting in PF")
> 
> Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>

Acked-by: Beilei Xing <beilei.xing@intel.com>

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

* [dpdk-dev] [PATCH v3] net/i40e: fix fdir cannot receive rx writeback issue
  2020-07-15 23:03 ` [dpdk-dev] [PATCH V2] " chenmin.sun
  2020-07-16  8:25   ` Xing, Beilei
@ 2020-07-17 14:57   ` chenmin.sun
  2020-07-17 14:48     ` Xing, Beilei
  1 sibling, 1 reply; 6+ messages in thread
From: chenmin.sun @ 2020-07-17 14:57 UTC (permalink / raw)
  To: qi.z.zhang, beilei.xing; +Cc: dev, chenmin.sun

From: Chenmin Sun <chenmin.sun@intel.com>

This patch fixes the fdir cannot receive rx writeback packet issue.
The root cause is FDIR interrupt is not correctly enabled.

Beside this, to make sure fdir programming works fine when the port
is stopped, move the fdir interrupt configure from start/stop to
setup/teardown.

Fixes: cfd662d22e7b ("net/i40e: fix interrupt throttling setting in PF")

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
---

v3:
* Refine commit log
v2:
* Fix commit message typo
---
 drivers/net/i40e/i40e_ethdev.c | 15 ++-------------
 drivers/net/i40e/i40e_ethdev.h |  2 ++
 drivers/net/i40e/i40e_fdir.c   | 11 +++++++++++
 3 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 393b5320f..8933a39f2 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2068,7 +2068,7 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)
 	}
 }
 
-static void
+void
 i40e_vsi_enable_queues_intr(struct i40e_vsi *vsi)
 {
 	struct rte_eth_dev *dev = vsi->adapter->eth_dev;
@@ -2095,7 +2095,7 @@ i40e_vsi_enable_queues_intr(struct i40e_vsi *vsi)
 	I40E_WRITE_FLUSH(hw);
 }
 
-static void
+void
 i40e_vsi_disable_queues_intr(struct i40e_vsi *vsi)
 {
 	struct rte_eth_dev *dev = vsi->adapter->eth_dev;
@@ -2317,13 +2317,6 @@ i40e_dev_start(struct rte_eth_dev *dev)
 		i40e_vsi_enable_queues_intr(pf->vmdq[i].vsi);
 	}
 
-	/* enable FDIR MSIX interrupt */
-	if (pf->fdir.fdir_vsi) {
-		i40e_vsi_queues_bind_intr(pf->fdir.fdir_vsi,
-					  I40E_ITR_INDEX_NONE);
-		i40e_vsi_enable_queues_intr(pf->fdir.fdir_vsi);
-	}
-
 	/* Enable all queues which have been configured */
 	for (nb_rxq = 0; nb_rxq < dev->data->nb_rx_queues; nb_rxq++) {
 		ret = i40e_dev_rx_queue_start(dev, nb_rxq);
@@ -2459,10 +2452,6 @@ i40e_dev_stop(struct rte_eth_dev *dev)
 		i40e_vsi_queues_unbind_intr(pf->vmdq[i].vsi);
 	}
 
-	if (pf->fdir.fdir_vsi) {
-		i40e_vsi_queues_unbind_intr(pf->fdir.fdir_vsi);
-		i40e_vsi_disable_queues_intr(pf->fdir.fdir_vsi);
-	}
 	/* Clear all queues and release memory */
 	i40e_dev_clear_queues(dev);
 
diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index 31ca05de9..886c98b15 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -1268,6 +1268,7 @@ void i40e_pf_enable_irq0(struct i40e_hw *hw);
 int i40e_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete);
 void i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx);
 void i40e_vsi_queues_unbind_intr(struct i40e_vsi *vsi);
+void i40e_vsi_disable_queues_intr(struct i40e_vsi *vsi);
 int i40e_vsi_vlan_pvid_set(struct i40e_vsi *vsi,
 			   struct i40e_vsi_vlan_pvid_info *info);
 int i40e_vsi_config_vlan_stripping(struct i40e_vsi *vsi, bool on);
@@ -1277,6 +1278,7 @@ uint64_t i40e_parse_hena(const struct i40e_adapter *adapter, uint64_t flags);
 enum i40e_status_code i40e_fdir_setup_tx_resources(struct i40e_pf *pf);
 enum i40e_status_code i40e_fdir_setup_rx_resources(struct i40e_pf *pf);
 int i40e_fdir_setup(struct i40e_pf *pf);
+void i40e_vsi_enable_queues_intr(struct i40e_vsi *vsi);
 const struct rte_memzone *i40e_memzone_reserve(const char *name,
 					uint32_t len,
 					int socket_id);
diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index 71eb31fb8..60eeccc1a 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -228,6 +228,11 @@ i40e_fdir_setup(struct i40e_pf *pf)
 		goto fail_mem;
 	}
 
+	/* enable FDIR MSIX interrupt */
+	vsi->nb_used_qps = 1;
+	i40e_vsi_queues_bind_intr(vsi, I40E_ITR_INDEX_NONE);
+	i40e_vsi_enable_queues_intr(vsi);
+
 	/* reserve memory for the fdir programming packet */
 	snprintf(z_name, sizeof(z_name), "%s_%s_%d",
 			eth_dev->device->driver->name,
@@ -274,12 +279,18 @@ i40e_fdir_teardown(struct i40e_pf *pf)
 	vsi = pf->fdir.fdir_vsi;
 	if (!vsi)
 		return;
+
+	/* disable FDIR MSIX interrupt */
+	i40e_vsi_queues_unbind_intr(vsi);
+	i40e_vsi_disable_queues_intr(vsi);
+
 	int err = i40e_switch_tx_queue(hw, vsi->base_queue, FALSE);
 	if (err)
 		PMD_DRV_LOG(DEBUG, "Failed to do FDIR TX switch off");
 	err = i40e_switch_rx_queue(hw, vsi->base_queue, FALSE);
 	if (err)
 		PMD_DRV_LOG(DEBUG, "Failed to do FDIR RX switch off");
+
 	i40e_dev_rx_queue_release(pf->fdir.rxq);
 	rte_eth_dma_zone_free(dev, "fdir_rx_ring", pf->fdir.rxq->queue_id);
 	pf->fdir.rxq = NULL;
-- 
2.17.1


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

* Re: [dpdk-dev] [PATCH v3] net/i40e: fix fdir cannot receive rx writeback issue
  2020-07-17 14:48     ` Xing, Beilei
@ 2020-07-20  9:51       ` Zhang, Qi Z
  0 siblings, 0 replies; 6+ messages in thread
From: Zhang, Qi Z @ 2020-07-20  9:51 UTC (permalink / raw)
  To: Xing, Beilei, Sun, Chenmin; +Cc: dev



> -----Original Message-----
> From: Xing, Beilei <beilei.xing@intel.com>
> Sent: Friday, July 17, 2020 10:48 PM
> To: Sun, Chenmin <chenmin.sun@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org
> Subject: RE: [PATCH v3] net/i40e: fix fdir cannot receive rx writeback issue
> 
> 
> 
> > -----Original Message-----
> > From: Sun, Chenmin <chenmin.sun@intel.com>
> > Sent: Friday, July 17, 2020 10:58 PM
> > To: Zhang, Qi Z <qi.z.zhang@intel.com>; Xing, Beilei
> > <beilei.xing@intel.com>
> > Cc: dev@dpdk.org; Sun, Chenmin <chenmin.sun@intel.com>
> > Subject: [PATCH v3] net/i40e: fix fdir cannot receive rx writeback
> > issue
> >
> > From: Chenmin Sun <chenmin.sun@intel.com>
> >
> > This patch fixes the fdir cannot receive rx writeback packet issue.
> > The root cause is FDIR interrupt is not correctly enabled.
> >
> > Beside this, to make sure fdir programming works fine when the port is
> > stopped, move the fdir interrupt configure from start/stop to
> setup/teardown.
> >
> > Fixes: cfd662d22e7b ("net/i40e: fix interrupt throttling setting in
> > PF")
> >
> > Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
> 
> Acked-by: Beilei Xing <beilei.xing@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi


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

end of thread, other threads:[~2020-07-20  9:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-15 22:48 [dpdk-dev] [PATCH] net/i40e: fix fdir cannot receive rx writeback issue chenmin.sun
2020-07-15 23:03 ` [dpdk-dev] [PATCH V2] " chenmin.sun
2020-07-16  8:25   ` Xing, Beilei
2020-07-17 14:57   ` [dpdk-dev] [PATCH v3] " chenmin.sun
2020-07-17 14:48     ` Xing, Beilei
2020-07-20  9:51       ` Zhang, Qi Z

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).