ice: code clean and promisc mode fix
cover ice: code clean and promisc mode fix
Patch 1/2 modifies the variable type of "status" from "uint16_t" to "int" to follow the standard programming style.
Patch 2/2 adds a return value check to give user a correct prompt.
Wang Ying A (2):
net/ice: code clean
net/ice: fix promiscuous mode
drivers/net/ice/ice_ethdev.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
Signature · 1 line
1.8.3.1
PATCH 1/2 net/ice: code clean
Variable "status" should be difined as "int" instead of "uint_16t". This patch fixes the issue.
--- drivers/net/ice/ice_ethdev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/ice/ice_ethdev.c +4 -4
@@ -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 )
Signature · 1 line
1.8.3.1
Re: [dpdk-dev] [PATCH 1/2] net/ice: code clean
Quoted 9 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Wang Ying A
Sent: Friday, April 12, 2019 9:52 PM
To: Lu, Wenzhuo <[email protected]>; Yang, Qiming <[email protected]>
Cc: [email protected]; Wang, Ying A <[email protected]>; [email protected]
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.
Quoted 3 lines
Variable "status" should be difined as "int" instead of "
uint_16t". This patch fixes the issue.
Some typo
Quoted 14 lines
Fixes c945e4bf9063 ("net/ice: support promiscuous mode")Signed-off-by Wang Ying A <[email protected]>--- drivers/net/ice/ice_ethdev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/net/ice/ice_ethdev.c index renamed from drivers/net/ice/ice_ethdev.c +0
-09d01018..72831bb 100644
drivers/net/ice/ice_ethdev.c static int ice_macaddr_set(struct rte_eth_dev *dev, · line 2756
Quoted 5 lines
drivers/net/ice/ice_ethdev.c +1
-1@@ -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.
Quoted 32 lines
drivers/net/ice/ice_ethdev.c +4
-5pmask =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
Re: [dpdk-dev] [PATCH 1/2] net/ice: code clean
Quoted 21 lines
-----Original Message-----
From: Zhang, Qi Z
Sent: Monday, April 15, 2019 8:44 PM
To: Wang, Ying A <[email protected]>; Lu, Wenzhuo <[email protected]>; Yang, Qiming <[email protected]>
Cc: [email protected]; Wang, Ying A <[email protected]>; [email protected]
Subject: RE: [dpdk-dev] [PATCH 1/2] net/ice: code cleanQuoted 8 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Wang Ying A
Sent: Friday, April 12, 2019 9:52 PM
To: Lu, Wenzhuo <[email protected]>; Yang, Qiming <[email protected]>
Cc: [email protected]; Wang, Ying A <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH 1/2] net/ice: code clean
Quoted 1 line
Better to change title to "fix wrong type", since it's actually a bug fix.
OK, will modify it.
Quoted 6 lines
Quoted 3 lines
Variable "status" should be difined as "int" instead of "
uint_16t". This patch fixes the issue.Some typo
OK, will modify it.
Quoted 9 lines
Quoted 9 lines
Fixes c945e4bf9063 ("net/ice: support promiscuous mode")Signed-off-by Wang Ying A <[email protected]>--- drivers/net/ice/ice_ethdev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Quoted 15 lines
drivers/net/ice/ice_ethdev.c static int ice_macaddr_set(struct rte_eth_dev *dev, · line 2757
Quoted 11 lines
(quoted diff) +0
-0
b/drivers/net/ice/ice_ethdev.cindex 9d01018..72831bb 100644drivers/net/ice/ice_ethdev.c +1
-1@@ -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_statusdirectly here?
Since I saw it will be compared with a enum valueICE_SUCCESSlater.
OK, will change to enum ice_status.
Quoted 36 lines
drivers/net/ice/ice_ethdev.c static int ice_macaddr_set(struct rte_eth_dev *dev, · line 2759
Quoted 3 lines
drivers/net/ice/ice_ethdev.c +0
-0pmask =ICE_PROMISC_UCAST_RX |ICE_PROMISC_UCAST_TX | ICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX; @@ -2769,7
Quoted 32 lines
+2769,7 @@ static int ice_macaddr_set(struct
rte_eth_dev*dev,drivers/net/ice/ice_ethdev.c +0
-0struct 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);drivers/net/ice/ice_ethdev.c +1
-2struct 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);drivers/net/ice/ice_ethdev.c +2
-2struct 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
v2 cover ice: fix wrong type and promisc mode
In reply to Wang Ying APatch 1/2 modifies the variable type of "status" from "uint16_t" to "enum ice_status ". Patch 2/2 adds a return value check to give user a correct prompt.
V2:
* For patch 1/2, change "int" to "enum ice_status"; fix some typo of the commit message and rename the patch title. For patch 2/2, make the commit log concise and clear.
Wang Ying A (2):
net/ice: fix wrong type
net/ice: fix promiscuous mode
drivers/net/ice/ice_ethdev.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
--
1.8.3.1
PATCH v2 1/2 net/ice: fix wrong type
Variable "status" should be defined as "enum ice_status" instead of "uint16_t". This patch fixes the issue.
--- drivers/net/ice/ice_ethdev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/ice/ice_ethdev.c +4 -4
@@ -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 )
Signature · 1 line
1.8.3.1
PATCH v2 2/2 net/ice: fix promiscuous mode
In reply to Wang Ying AWhen device promiscuous mode has already been enabled, should not return error if user re-enable it.
--- drivers/net/ice/ice_ethdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ice/ice_ethdev.c +3 -1
@@ -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); }
Signature · 1 line
1.8.3.1
Re: [dpdk-dev] [PATCH v2 0/2] ice: fix wrong type and promisc mode
In reply to Wang Ying AQuoted 25 lines
-----Original Message-----
From: Wang, Ying A
Sent: Wednesday, April 17, 2019 9:48 AM
To: Lu, Wenzhuo <[email protected]>; Yang, Qiming <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: [email protected]; [email protected]; Wang, Ying A <[email protected]>
Subject: [PATCH v2 0/2] ice: fix wrong type and promisc modePatch 1/2 modifies the variable type of "status" from "
uint16_t" to "enumice_status".
Patch 2/2 adds a return value check to give user a correct prompt.V2:
* For patch 1/2, change "int" to "enumice_status"; fix some typo of the commit message
and rename the patch title. For patch 2/2, make the commit log concise and
clear.Wang Ying A (2):
net/ice: fix wrong type
net/ice: fix promiscuous mode
Quoted 5 lines
drivers/net/ice/ice_ethdev.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)--
1.8.3.1
Zhang, Qi Z
AppliedRe: [dpdk-dev] [PATCH v2 0/2] ice: fix wrong type and promisc mode
Quoted 35 lines
-----Original Message-----
From: Yang, Qiming
Sent: Wednesday, April 17, 2019 11:10 AM
To: Wang, Ying A <[email protected]>; Lu, Wenzhuo <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: [email protected]; [email protected]
Subject: RE: [PATCH v2 0/2] ice: fix wrong type and promisc modeQuoted 23 lines
-----Original Message-----
From: Wang, Ying A
Sent: Wednesday, April 17, 2019 9:48 AM
To: Lu, Wenzhuo <[email protected]>; Yang, Qiming <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: [email protected]; [email protected]; Wang, Ying A <[email protected]>
Subject: [PATCH v2 0/2] ice: fix wrong type and promisc modePatch 1/2 modifies the variable type of "status" from "
uint16_t" to "enumice_status".
Patch 2/2 adds a return value check to give user a correct prompt.V2:
* For patch 1/2, change "int" to "enumice_status"; fix some typo of the commit message
and rename the patch title. For patch 2/2, make the commit log
concise and clear.Wang Ying A (2):
net/ice: fix wrong type
net/ice: fix promiscuous mode
Quoted 7 lines
Quoted 5 lines
drivers/net/ice/ice_ethdev.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)--
1.8.3.1Acked-by Qiming Yang <[email protected]>
Applied to dpdk-next-net-intel.
Thanks
Qi
PATCH 2/2 net/ice: fix promiscuous mode
In reply to Wang Ying AWhen 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".
--- drivers/net/ice/ice_ethdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ice/ice_ethdev.c +3 -1
@@ -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); }
Signature · 1 line
1.8.3.1
Re: [dpdk-dev] [PATCH 2/2] net/ice: fix promiscuous mode
Wang Ying A <[email protected]>:
Quoted 11 lines
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")Signed-off-by Wang Ying A <[email protected]>---