DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ice: enable VLAN filter offloads support
@ 2019-01-28  7:53 Wei Zhao
  2019-02-13  3:30 ` [dpdk-dev] [PATCH v2] " Wei Zhao
  2019-02-13  3:49 ` Wei Zhao
  0 siblings, 2 replies; 6+ messages in thread
From: Wei Zhao @ 2019-01-28  7:53 UTC (permalink / raw)
  To: dev; +Cc: stable, qi.z.zhang, Wei Zhao

There is need to check whether dev_conf.rxmode.offloads is
set when start ice device, if one of the vlan related bits
is set, for example DEV_RX_OFFLOAD_VLAN_FILTER and so on,
sevice start process to enable this offloads request.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
---
 drivers/net/ice/ice_ethdev.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index b145d9c..94bdad3 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -1711,7 +1711,7 @@ ice_dev_start(struct rte_eth_dev *dev)
 	struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
 	uint16_t nb_rxq = 0;
 	uint16_t nb_txq, i;
-	int ret;
+	int mask, ret;
 
 	/* program Tx queues' context in hardware */
 	for (nb_txq = 0; nb_txq < data->nb_tx_queues; nb_txq++) {
@@ -1739,6 +1739,14 @@ ice_dev_start(struct rte_eth_dev *dev)
 
 	ice_set_rx_function(dev);
 
+	mask = ETH_VLAN_STRIP_MASK | ETH_VLAN_FILTER_MASK |
+			ETH_VLAN_EXTEND_MASK;
+	ret = ice_vlan_offload_set(dev, mask);
+	if (ret) {
+		PMD_INIT_LOG(ERR, "Unable to set VLAN offload");
+		goto rx_err;
+	}
+
 	/* enable Rx interrput and mapping Rx queue to interrupt vector */
 	if (ice_rxq_intr_setup(dev))
 		return -EIO;
-- 
2.7.5

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

* [dpdk-dev] [PATCH v2] net/ice: enable VLAN filter offloads support
  2019-01-28  7:53 [dpdk-dev] [PATCH] net/ice: enable VLAN filter offloads support Wei Zhao
@ 2019-02-13  3:30 ` Wei Zhao
  2019-02-13  4:05   ` Zhao1, Wei
  2019-02-13  3:49 ` Wei Zhao
  1 sibling, 1 reply; 6+ messages in thread
From: Wei Zhao @ 2019-02-13  3:30 UTC (permalink / raw)
  To: dev; +Cc: stable, qi.z.zhang, Wei Zhao

There is need to check whether dev_conf.rxmode.offloads is
set when start ice device, if one of the vlan related bits
is set, for example DEV_RX_OFFLOAD_VLAN_FILTER and so on,
sevice start process to enable this offloads request.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>

---

v2:
-rework patch for compile error.
---
 drivers/net/avf/avf_ethdev.c |  2 +-
 drivers/net/ice/ice_ethdev.c | 10 +++++++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/net/avf/avf_ethdev.c b/drivers/net/avf/avf_ethdev.c
index 13eec1b..797f505 100644
--- a/drivers/net/avf/avf_ethdev.c
+++ b/drivers/net/avf/avf_ethdev.c
@@ -1159,7 +1159,7 @@ avf_enable_irq0(struct avf_hw *hw)
 	AVF_WRITE_REG(hw, AVFINT_ICR0_ENA1, AVFINT_ICR0_ENA1_ADMINQ_MASK);
 
 	AVF_WRITE_REG(hw, AVFINT_DYN_CTL01, AVFINT_DYN_CTL01_INTENA_MASK |
-					    AVFINT_DYN_CTL01_ITR_INDX_MASK);
+		AVFINT_DYN_CTL01_CLEARPBA_MASK | AVFINT_DYN_CTL01_ITR_INDX_MASK);
 
 	AVF_WRITE_FLUSH(hw);
 }
diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 6ab66fa..5753d79 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -1720,7 +1720,7 @@ ice_dev_start(struct rte_eth_dev *dev)
 	struct ice_vsi *vsi = pf->main_vsi;
 	uint16_t nb_rxq = 0;
 	uint16_t nb_txq, i;
-	int ret;
+	int mask, ret;
 
 	/* program Tx queues' context in hardware */
 	for (nb_txq = 0; nb_txq < data->nb_tx_queues; nb_txq++) {
@@ -1748,6 +1748,14 @@ ice_dev_start(struct rte_eth_dev *dev)
 
 	ice_set_rx_function(dev);
 
+	mask = ETH_VLAN_STRIP_MASK | ETH_VLAN_FILTER_MASK |
+			ETH_VLAN_EXTEND_MASK;
+	ret = ice_vlan_offload_set(dev, mask);
+	if (ret) {
+		PMD_INIT_LOG(ERR, "Unable to set VLAN offload");
+		goto rx_err;
+	}
+
 	/* enable Rx interrput and mapping Rx queue to interrupt vector */
 	if (ice_rxq_intr_setup(dev))
 		return -EIO;
-- 
2.7.5

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

* [dpdk-dev] [PATCH v2] net/ice: enable VLAN filter offloads support
  2019-01-28  7:53 [dpdk-dev] [PATCH] net/ice: enable VLAN filter offloads support Wei Zhao
  2019-02-13  3:30 ` [dpdk-dev] [PATCH v2] " Wei Zhao
@ 2019-02-13  3:49 ` Wei Zhao
  2019-02-13 18:43   ` Stillwell Jr, Paul M
  2019-02-18 12:39   ` Zhang, Qi Z
  1 sibling, 2 replies; 6+ messages in thread
From: Wei Zhao @ 2019-02-13  3:49 UTC (permalink / raw)
  To: dev; +Cc: stable, qi.z.zhang, Wei Zhao

There is need to check whether dev_conf.rxmode.offloads is
set when start ice device, if one of the vlan related bits
is set, for example DEV_RX_OFFLOAD_VLAN_FILTER and so on,
sevice start process to enable this offloads request.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>

---

v2:
-rework patch for compile error.
---
 drivers/net/ice/ice_ethdev.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 6b0113b..a23c63a 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -1714,7 +1714,7 @@ ice_dev_start(struct rte_eth_dev *dev)
 	struct ice_vsi *vsi = pf->main_vsi;
 	uint16_t nb_rxq = 0;
 	uint16_t nb_txq, i;
-	int ret;
+	int mask, ret;
 
 	/* program Tx queues' context in hardware */
 	for (nb_txq = 0; nb_txq < data->nb_tx_queues; nb_txq++) {
@@ -1742,6 +1742,14 @@ ice_dev_start(struct rte_eth_dev *dev)
 
 	ice_set_rx_function(dev);
 
+	mask = ETH_VLAN_STRIP_MASK | ETH_VLAN_FILTER_MASK |
+			ETH_VLAN_EXTEND_MASK;
+	ret = ice_vlan_offload_set(dev, mask);
+	if (ret) {
+		PMD_INIT_LOG(ERR, "Unable to set VLAN offload");
+		goto rx_err;
+	}
+
 	/* enable Rx interrput and mapping Rx queue to interrupt vector */
 	if (ice_rxq_intr_setup(dev))
 		return -EIO;
-- 
2.7.5

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

* Re: [dpdk-dev] [PATCH v2] net/ice: enable VLAN filter offloads support
  2019-02-13  3:30 ` [dpdk-dev] [PATCH v2] " Wei Zhao
@ 2019-02-13  4:05   ` Zhao1, Wei
  0 siblings, 0 replies; 6+ messages in thread
From: Zhao1, Wei @ 2019-02-13  4:05 UTC (permalink / raw)
  To: dev; +Cc: stable, Zhang, Qi Z

Error patch, please ignore it.

> -----Original Message-----
> From: Zhao1, Wei
> Sent: Wednesday, February 13, 2019 11:30 AM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Zhao1, Wei
> <wei.zhao1@intel.com>
> Subject: [PATCH v2] net/ice: enable VLAN filter offloads support
> 
> There is need to check whether dev_conf.rxmode.offloads is set when start
> ice device, if one of the vlan related bits is set, for example
> DEV_RX_OFFLOAD_VLAN_FILTER and so on, sevice start process to enable
> this offloads request.
> 
> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> 
> ---
> 
> v2:
> -rework patch for compile error.
> ---
>  drivers/net/avf/avf_ethdev.c |  2 +-
>  drivers/net/ice/ice_ethdev.c | 10 +++++++++-
>  2 files changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/avf/avf_ethdev.c b/drivers/net/avf/avf_ethdev.c
> index 13eec1b..797f505 100644
> --- a/drivers/net/avf/avf_ethdev.c
> +++ b/drivers/net/avf/avf_ethdev.c
> @@ -1159,7 +1159,7 @@ avf_enable_irq0(struct avf_hw *hw)
>  	AVF_WRITE_REG(hw, AVFINT_ICR0_ENA1,
> AVFINT_ICR0_ENA1_ADMINQ_MASK);
> 
>  	AVF_WRITE_REG(hw, AVFINT_DYN_CTL01,
> AVFINT_DYN_CTL01_INTENA_MASK |
> -
> AVFINT_DYN_CTL01_ITR_INDX_MASK);
> +		AVFINT_DYN_CTL01_CLEARPBA_MASK |
> AVFINT_DYN_CTL01_ITR_INDX_MASK);
> 
>  	AVF_WRITE_FLUSH(hw);
>  }
> diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
> index 6ab66fa..5753d79 100644
> --- a/drivers/net/ice/ice_ethdev.c
> +++ b/drivers/net/ice/ice_ethdev.c
> @@ -1720,7 +1720,7 @@ ice_dev_start(struct rte_eth_dev *dev)
>  	struct ice_vsi *vsi = pf->main_vsi;
>  	uint16_t nb_rxq = 0;
>  	uint16_t nb_txq, i;
> -	int ret;
> +	int mask, ret;
> 
>  	/* program Tx queues' context in hardware */
>  	for (nb_txq = 0; nb_txq < data->nb_tx_queues; nb_txq++) { @@ -
> 1748,6 +1748,14 @@ ice_dev_start(struct rte_eth_dev *dev)
> 
>  	ice_set_rx_function(dev);
> 
> +	mask = ETH_VLAN_STRIP_MASK | ETH_VLAN_FILTER_MASK |
> +			ETH_VLAN_EXTEND_MASK;
> +	ret = ice_vlan_offload_set(dev, mask);
> +	if (ret) {
> +		PMD_INIT_LOG(ERR, "Unable to set VLAN offload");
> +		goto rx_err;
> +	}
> +
>  	/* enable Rx interrput and mapping Rx queue to interrupt vector */
>  	if (ice_rxq_intr_setup(dev))
>  		return -EIO;
> --
> 2.7.5

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

* Re: [dpdk-dev] [PATCH v2] net/ice: enable VLAN filter offloads support
  2019-02-13  3:49 ` Wei Zhao
@ 2019-02-13 18:43   ` Stillwell Jr, Paul M
  2019-02-18 12:39   ` Zhang, Qi Z
  1 sibling, 0 replies; 6+ messages in thread
From: Stillwell Jr, Paul M @ 2019-02-13 18:43 UTC (permalink / raw)
  To: Zhao1, Wei, dev; +Cc: stable, Zhang, Qi Z, Zhao1, Wei

Your patch description says we should be checking dev_conf.rxmode.offloads should be checked to enable VLAN, but I don't see the patch checking for that. What am I missing?

Paul

-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wei Zhao
Sent: Tuesday, February 12, 2019 7:50 PM
To: dev@dpdk.org
Cc: stable@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Zhao1, Wei <wei.zhao1@intel.com>
Subject: [dpdk-dev] [PATCH v2] net/ice: enable VLAN filter offloads support

There is need to check whether dev_conf.rxmode.offloads is set when start ice device, if one of the vlan related bits is set, for example DEV_RX_OFFLOAD_VLAN_FILTER and so on, sevice start process to enable this offloads request.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>

---

v2:
-rework patch for compile error.
---
 drivers/net/ice/ice_ethdev.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 6b0113b..a23c63a 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -1714,7 +1714,7 @@ ice_dev_start(struct rte_eth_dev *dev)
 	struct ice_vsi *vsi = pf->main_vsi;
 	uint16_t nb_rxq = 0;
 	uint16_t nb_txq, i;
-	int ret;
+	int mask, ret;
 
 	/* program Tx queues' context in hardware */
 	for (nb_txq = 0; nb_txq < data->nb_tx_queues; nb_txq++) { @@ -1742,6 +1742,14 @@ ice_dev_start(struct rte_eth_dev *dev)
 
 	ice_set_rx_function(dev);
 
+	mask = ETH_VLAN_STRIP_MASK | ETH_VLAN_FILTER_MASK |
+			ETH_VLAN_EXTEND_MASK;
+	ret = ice_vlan_offload_set(dev, mask);
+	if (ret) {
+		PMD_INIT_LOG(ERR, "Unable to set VLAN offload");
+		goto rx_err;
+	}
+
 	/* enable Rx interrput and mapping Rx queue to interrupt vector */
 	if (ice_rxq_intr_setup(dev))
 		return -EIO;
--
2.7.5

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

* Re: [dpdk-dev] [PATCH v2] net/ice: enable VLAN filter offloads support
  2019-02-13  3:49 ` Wei Zhao
  2019-02-13 18:43   ` Stillwell Jr, Paul M
@ 2019-02-18 12:39   ` Zhang, Qi Z
  1 sibling, 0 replies; 6+ messages in thread
From: Zhang, Qi Z @ 2019-02-18 12:39 UTC (permalink / raw)
  To: Zhao1, Wei, dev; +Cc: stable



> -----Original Message-----
> From: Zhao1, Wei
> Sent: Wednesday, February 13, 2019 11:50 AM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Zhao1, Wei
> <wei.zhao1@intel.com>
> Subject: [PATCH v2] net/ice: enable VLAN filter offloads support

I think this is a fix, since vlan filter is already be promised by ice_dev_info_get.

So add below fix line.
Fixes: 690175ee51bf ("net/ice: support getting device information")
> 
> There is need to check whether dev_conf.rxmode.offloads is set when start ice
> device, if one of the vlan related bits is set, for example
> DEV_RX_OFFLOAD_VLAN_FILTER and so on, sevice start process to enable this
> offloads request.

Some typo, reword to

  VLAN filter is required to be configured during dev_start according to dev_conf.rxmod.offloads
setting, so ice_vlan_offload_set is called to handle this.
> 
> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel with above changes.

Thanks
Qi

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

end of thread, other threads:[~2019-02-18 12:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-28  7:53 [dpdk-dev] [PATCH] net/ice: enable VLAN filter offloads support Wei Zhao
2019-02-13  3:30 ` [dpdk-dev] [PATCH v2] " Wei Zhao
2019-02-13  4:05   ` Zhao1, Wei
2019-02-13  3:49 ` Wei Zhao
2019-02-13 18:43   ` Stillwell Jr, Paul M
2019-02-18 12:39   ` 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).