[1/2] net/ice: code clean

Message ID 1555077139-244831-2-git-send-email-ying.a.wang@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series ice: code clean and promisc mode fix |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

Ying Wang April 12, 2019, 1:52 p.m. UTC
  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(-)
  

Comments

Qi Zhang April 15, 2019, 12:43 p.m. UTC | #1
> -----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
  
Ying Wang April 17, 2019, 12:45 a.m. UTC | #2
> -----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
  

Patch

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)