patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 1/2] net/ice: code clean
       [not found] <1555077139-244831-1-git-send-email-ying.a.wang@intel.com>
@ 2019-04-12 13:52 ` Wang Ying A
  2019-04-15 12:43   ` [dpdk-stable] [dpdk-dev] " Zhang, Qi Z
       [not found]   ` <1555465672-288172-1-git-send-email-ying.a.wang@intel.com>
  2019-04-12 13:52 ` [dpdk-stable] [PATCH " Wang Ying A
  1 sibling, 2 replies; 7+ messages in thread
From: Wang Ying A @ 2019-04-12 13:52 UTC (permalink / raw)
  To: wenzhuo.lu, qiming.yang; +Cc: dev, Wang Ying A, stable

Variable "status" should be difined as "int" instead of "uint_16t".
This patch fixes the issue.

Fixes: c945e4bf9063 ("net/ice: support promiscuous mode")
Cc: stable@dpdk.org

Signed-off-by: Wang Ying A <ying.a.wang@intel.com>
---
 drivers/net/ice/ice_ethdev.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 9d01018..72831bb 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2753,7 +2753,7 @@ static int ice_macaddr_set(struct rte_eth_dev *dev,
 	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct ice_vsi *vsi = pf->main_vsi;
 	uint8_t pmask;
-	uint16_t status;
+	int status;
 
 	pmask = ICE_PROMISC_UCAST_RX | ICE_PROMISC_UCAST_TX |
 		ICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX;
@@ -2769,7 +2769,7 @@ static int ice_macaddr_set(struct rte_eth_dev *dev,
 	struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
 	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct ice_vsi *vsi = pf->main_vsi;
-	uint16_t status;
+	int status;
 	uint8_t pmask;
 
 	pmask = ICE_PROMISC_UCAST_RX | ICE_PROMISC_UCAST_TX |
@@ -2787,7 +2787,7 @@ static int ice_macaddr_set(struct rte_eth_dev *dev,
 	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct ice_vsi *vsi = pf->main_vsi;
 	uint8_t pmask;
-	uint16_t status;
+	int status;
 
 	pmask = ICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX;
 
@@ -2802,7 +2802,7 @@ static int ice_macaddr_set(struct rte_eth_dev *dev,
 	struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
 	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct ice_vsi *vsi = pf->main_vsi;
-	uint16_t status;
+	int status;
 	uint8_t pmask;
 
 	if (dev->data->promiscuous == 1)
-- 
1.8.3.1


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

* [dpdk-stable] [PATCH 2/2] net/ice: fix promiscuous mode
       [not found] <1555077139-244831-1-git-send-email-ying.a.wang@intel.com>
  2019-04-12 13:52 ` [dpdk-stable] [PATCH 1/2] net/ice: code clean Wang Ying A
@ 2019-04-12 13:52 ` Wang Ying A
  2019-04-15 21:40   ` [dpdk-stable] [dpdk-dev] " Rami Rosen
  1 sibling, 1 reply; 7+ messages in thread
From: Wang Ying A @ 2019-04-12 13:52 UTC (permalink / raw)
  To: wenzhuo.lu, qiming.yang; +Cc: dev, Wang Ying A, stable

When device promiscuous mode has already been enabled,
if user re-enables the promisc mode, he/she should be
prompted with "Promisc has already been enabled"
rather than "Failed to enable promisc".

Fixes: c945e4bf9063 ("net/ice: support promiscuous mode")
Cc: stable@dpdk.org

Signed-off-by: Wang Ying A <ying.a.wang@intel.com>
---
 drivers/net/ice/ice_ethdev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 72831bb..cb82a6f 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2759,7 +2759,9 @@ static int ice_macaddr_set(struct rte_eth_dev *dev,
 		ICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX;
 
 	status = ice_set_vsi_promisc(hw, vsi->idx, pmask, 0);
-	if (status != ICE_SUCCESS)
+	if (status == ICE_ERR_ALREADY_EXISTS)
+		PMD_DRV_LOG(DEBUG, "Promisc mode has already been enabled");
+	else if (status != ICE_SUCCESS)
 		PMD_DRV_LOG(ERR, "Failed to enable promisc, err=%d", status);
 }
 
-- 
1.8.3.1


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

* Re: [dpdk-stable] [dpdk-dev] [PATCH 1/2] net/ice: code clean
  2019-04-12 13:52 ` [dpdk-stable] [PATCH 1/2] net/ice: code clean Wang Ying A
@ 2019-04-15 12:43   ` Zhang, Qi Z
  2019-04-17  0:45     ` Wang, Ying A
       [not found]   ` <1555465672-288172-1-git-send-email-ying.a.wang@intel.com>
  1 sibling, 1 reply; 7+ messages in thread
From: Zhang, Qi Z @ 2019-04-15 12:43 UTC (permalink / raw)
  To: Wang, Ying A, Lu, Wenzhuo, Yang, Qiming; +Cc: dev, Wang, Ying A, stable



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wang Ying A
> Sent: Friday, April 12, 2019 9:52 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Yang, Qiming
> <qiming.yang@intel.com>
> Cc: dev@dpdk.org; Wang, Ying A <ying.a.wang@intel.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH 1/2] net/ice: code clean

Better to change title to "fix wrong type", since it's actually a bug fix.
> 
> Variable "status" should be difined as "int" instead of "uint_16t".
> This patch fixes the issue.

Some typo

> 
> Fixes: c945e4bf9063 ("net/ice: support promiscuous mode")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Wang Ying A <ying.a.wang@intel.com>
> ---
>  drivers/net/ice/ice_ethdev.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index
> 9d01018..72831bb 100644
> --- a/drivers/net/ice/ice_ethdev.c
> +++ b/drivers/net/ice/ice_ethdev.c
> @@ -2753,7 +2753,7 @@ static int ice_macaddr_set(struct rte_eth_dev *dev,
>  	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
>  	struct ice_vsi *vsi = pf->main_vsi;
>  	uint8_t pmask;
> -	uint16_t status;
> +	int status;

Can we use enum ice_status directly here?
Since I saw it will be compared with a enum value ICE_SUCCESS later.

> 
>  	pmask = ICE_PROMISC_UCAST_RX | ICE_PROMISC_UCAST_TX |
>  		ICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX; @@ -2769,7
> +2769,7 @@ static int ice_macaddr_set(struct rte_eth_dev *dev,
>  	struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
>  	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
>  	struct ice_vsi *vsi = pf->main_vsi;
> -	uint16_t status;
> +	int status;
>  	uint8_t pmask;
> 
>  	pmask = ICE_PROMISC_UCAST_RX | ICE_PROMISC_UCAST_TX | @@
> -2787,7 +2787,7 @@ static int ice_macaddr_set(struct rte_eth_dev *dev,
>  	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
>  	struct ice_vsi *vsi = pf->main_vsi;
>  	uint8_t pmask;
> -	uint16_t status;
> +	int status;
> 
>  	pmask = ICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX;
> 
> @@ -2802,7 +2802,7 @@ static int ice_macaddr_set(struct rte_eth_dev *dev,
>  	struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
>  	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
>  	struct ice_vsi *vsi = pf->main_vsi;
> -	uint16_t status;
> +	int status;
>  	uint8_t pmask;
> 
>  	if (dev->data->promiscuous == 1)
> --
> 1.8.3.1


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

* Re: [dpdk-stable] [dpdk-dev] [PATCH 2/2] net/ice: fix promiscuous mode
  2019-04-12 13:52 ` [dpdk-stable] [PATCH " Wang Ying A
@ 2019-04-15 21:40   ` Rami Rosen
  0 siblings, 0 replies; 7+ messages in thread
From: Rami Rosen @ 2019-04-15 21:40 UTC (permalink / raw)
  To: Wang Ying A; +Cc: wenzhuo.lu, qiming.yang, dev, stable

Wang Ying A ‏<ying.a.wang@intel.com>:

> When device promiscuous mode has already been enabled,
> if user re-enables the promisc mode, he/she should be
> prompted with "Promisc has already been enabled"
> rather than "Failed to enable promisc".
>
> Fixes: c945e4bf9063 ("net/ice: support promiscuous mode")
> Cc: stable@dpdk.org
>
> Signed-off-by: Wang Ying A <ying.a.wang@intel.com>
> ---
>

Reviewed-by: Rami Rosen <ramirose@gmail.com>

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

* Re: [dpdk-stable] [dpdk-dev] [PATCH 1/2] net/ice: code clean
  2019-04-15 12:43   ` [dpdk-stable] [dpdk-dev] " Zhang, Qi Z
@ 2019-04-17  0:45     ` Wang, Ying A
  0 siblings, 0 replies; 7+ messages in thread
From: Wang, Ying A @ 2019-04-17  0:45 UTC (permalink / raw)
  To: Zhang, Qi Z, Lu, Wenzhuo, Yang, Qiming; +Cc: dev, stable



> -----Original Message-----
> From: Zhang, Qi Z
> Sent: Monday, April 15, 2019 8:44 PM
> To: Wang, Ying A <ying.a.wang@intel.com>; Lu, Wenzhuo
> <wenzhuo.lu@intel.com>; Yang, Qiming <qiming.yang@intel.com>
> Cc: dev@dpdk.org; Wang, Ying A <ying.a.wang@intel.com>; stable@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH 1/2] net/ice: code clean
> 
> 
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wang Ying A
> > Sent: Friday, April 12, 2019 9:52 PM
> > To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Yang, Qiming
> > <qiming.yang@intel.com>
> > Cc: dev@dpdk.org; Wang, Ying A <ying.a.wang@intel.com>;
> > stable@dpdk.org
> > Subject: [dpdk-dev] [PATCH 1/2] net/ice: code clean
> 
> Better to change title to "fix wrong type", since it's actually a bug fix.

OK, will modify it.

> >
> > Variable "status" should be difined as "int" instead of "uint_16t".
> > This patch fixes the issue.
> 
> Some typo
> 
OK, will modify it.

> >
> > Fixes: c945e4bf9063 ("net/ice: support promiscuous mode")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Wang Ying A <ying.a.wang@intel.com>
> > ---
> >  drivers/net/ice/ice_ethdev.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/net/ice/ice_ethdev.c
> > b/drivers/net/ice/ice_ethdev.c index 9d01018..72831bb 100644
> > --- a/drivers/net/ice/ice_ethdev.c
> > +++ b/drivers/net/ice/ice_ethdev.c
> > @@ -2753,7 +2753,7 @@ static int ice_macaddr_set(struct rte_eth_dev *dev,
> >  	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data-
> >dev_private);
> >  	struct ice_vsi *vsi = pf->main_vsi;
> >  	uint8_t pmask;
> > -	uint16_t status;
> > +	int status;
> 
> Can we use enum ice_status directly here?
> Since I saw it will be compared with a enum value ICE_SUCCESS later.
> 

OK, will change to enum ice_status.

> >
> >  	pmask = ICE_PROMISC_UCAST_RX | ICE_PROMISC_UCAST_TX |
> >  		ICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX; @@ -
> 2769,7
> > +2769,7 @@ static int ice_macaddr_set(struct rte_eth_dev *dev,
> >  	struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
> >  	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data-
> >dev_private);
> >  	struct ice_vsi *vsi = pf->main_vsi;
> > -	uint16_t status;
> > +	int status;
> >  	uint8_t pmask;
> >
> >  	pmask = ICE_PROMISC_UCAST_RX | ICE_PROMISC_UCAST_TX | @@
> > -2787,7 +2787,7 @@ static int ice_macaddr_set(struct rte_eth_dev *dev,
> >  	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data-
> >dev_private);
> >  	struct ice_vsi *vsi = pf->main_vsi;
> >  	uint8_t pmask;
> > -	uint16_t status;
> > +	int status;
> >
> >  	pmask = ICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX;
> >
> > @@ -2802,7 +2802,7 @@ static int ice_macaddr_set(struct rte_eth_dev *dev,
> >  	struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
> >  	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data-
> >dev_private);
> >  	struct ice_vsi *vsi = pf->main_vsi;
> > -	uint16_t status;
> > +	int status;
> >  	uint8_t pmask;
> >
> >  	if (dev->data->promiscuous == 1)
> > --
> > 1.8.3.1


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

* [dpdk-stable] [PATCH v2 1/2] net/ice: fix wrong type
       [not found]   ` <1555465672-288172-1-git-send-email-ying.a.wang@intel.com>
@ 2019-04-17  1:47     ` Wang Ying A
  2019-04-17  1:47     ` [dpdk-stable] [PATCH v2 2/2] net/ice: fix promiscuous mode Wang Ying A
  1 sibling, 0 replies; 7+ messages in thread
From: Wang Ying A @ 2019-04-17  1:47 UTC (permalink / raw)
  To: wenzhuo.lu, qiming.yang, qi.z.zhang; +Cc: dev, ramirose, Wang Ying A, stable

Variable "status" should be defined as "enum ice_status"
instead of "uint16_t". This patch fixes the issue.

Fixes: c945e4bf9063 ("net/ice: support promiscuous mode")
Cc: stable@dpdk.org

Signed-off-by: Wang Ying A <ying.a.wang@intel.com>
---
 drivers/net/ice/ice_ethdev.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 0946b19..3263337 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2757,7 +2757,7 @@ static int ice_macaddr_set(struct rte_eth_dev *dev,
 	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct ice_vsi *vsi = pf->main_vsi;
 	uint8_t pmask;
-	uint16_t status;
+	enum ice_status status;
 
 	pmask = ICE_PROMISC_UCAST_RX | ICE_PROMISC_UCAST_TX |
 		ICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX;
@@ -2773,7 +2773,7 @@ static int ice_macaddr_set(struct rte_eth_dev *dev,
 	struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
 	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct ice_vsi *vsi = pf->main_vsi;
-	uint16_t status;
+	enum ice_status status;
 	uint8_t pmask;
 
 	pmask = ICE_PROMISC_UCAST_RX | ICE_PROMISC_UCAST_TX |
@@ -2791,7 +2791,7 @@ static int ice_macaddr_set(struct rte_eth_dev *dev,
 	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct ice_vsi *vsi = pf->main_vsi;
 	uint8_t pmask;
-	uint16_t status;
+	enum ice_status status;
 
 	pmask = ICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX;
 
@@ -2806,7 +2806,7 @@ static int ice_macaddr_set(struct rte_eth_dev *dev,
 	struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
 	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct ice_vsi *vsi = pf->main_vsi;
-	uint16_t status;
+	enum ice_status status;
 	uint8_t pmask;
 
 	if (dev->data->promiscuous == 1)
-- 
1.8.3.1


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

* [dpdk-stable] [PATCH v2 2/2] net/ice: fix promiscuous mode
       [not found]   ` <1555465672-288172-1-git-send-email-ying.a.wang@intel.com>
  2019-04-17  1:47     ` [dpdk-stable] [PATCH v2 1/2] net/ice: fix wrong type Wang Ying A
@ 2019-04-17  1:47     ` Wang Ying A
  1 sibling, 0 replies; 7+ messages in thread
From: Wang Ying A @ 2019-04-17  1:47 UTC (permalink / raw)
  To: wenzhuo.lu, qiming.yang, qi.z.zhang; +Cc: dev, ramirose, Wang Ying A, stable

When device promiscuous mode has already been enabled,
should not return error if user re-enable it.

Fixes: c945e4bf9063 ("net/ice: support promiscuous mode")
Cc: stable@dpdk.org

Signed-off-by: Wang Ying A <ying.a.wang@intel.com>
---
 drivers/net/ice/ice_ethdev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 3263337..8811057 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2763,7 +2763,9 @@ static int ice_macaddr_set(struct rte_eth_dev *dev,
 		ICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX;
 
 	status = ice_set_vsi_promisc(hw, vsi->idx, pmask, 0);
-	if (status != ICE_SUCCESS)
+	if (status == ICE_ERR_ALREADY_EXISTS)
+		PMD_DRV_LOG(DEBUG, "Promisc mode has already been enabled");
+	else if (status != ICE_SUCCESS)
 		PMD_DRV_LOG(ERR, "Failed to enable promisc, err=%d", status);
 }
 
-- 
1.8.3.1


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

end of thread, other threads:[~2019-04-17  2:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1555077139-244831-1-git-send-email-ying.a.wang@intel.com>
2019-04-12 13:52 ` [dpdk-stable] [PATCH 1/2] net/ice: code clean Wang Ying A
2019-04-15 12:43   ` [dpdk-stable] [dpdk-dev] " Zhang, Qi Z
2019-04-17  0:45     ` Wang, Ying A
     [not found]   ` <1555465672-288172-1-git-send-email-ying.a.wang@intel.com>
2019-04-17  1:47     ` [dpdk-stable] [PATCH v2 1/2] net/ice: fix wrong type Wang Ying A
2019-04-17  1:47     ` [dpdk-stable] [PATCH v2 2/2] net/ice: fix promiscuous mode Wang Ying A
2019-04-12 13:52 ` [dpdk-stable] [PATCH " Wang Ying A
2019-04-15 21:40   ` [dpdk-stable] [dpdk-dev] " Rami Rosen

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