[1/2] net: hinic: Convert the cmd code from decimal to hex to be more readable

Message ID 20221026125922.34080-1-cai.huoqing@linux.dev
State New
Headers
Series [1/2] net: hinic: Convert the cmd code from decimal to hex to be more readable |

Commit Message

Cai Huoqing Oct. 26, 2022, 12:59 p.m. UTC
  The print cmd code is in hex, so using hex cmd code intead of
decimal is easy to check the value with print info.

Signed-off-by: Cai Huoqing <cai.huoqing@linux.dev>
---
 .../net/ethernet/huawei/hinic/hinic_hw_dev.h  | 108 +++++++++---------
 1 file changed, 52 insertions(+), 56 deletions(-)
  

Comments

Jakub Kicinski Oct. 27, 2022, 6:02 p.m. UTC | #1
On Wed, 26 Oct 2022 20:59:10 +0800 Cai Huoqing wrote:
> Subject: [PATCH 1/2] net: hinic: Convert the cmd code from decimal to hex to be more readable

Please put [PATCH net-next] or [PATCH -next] in the subject,
to make the patch sorting easier for maintainers.

> The print cmd code is in hex, so using hex cmd code intead of
> decimal is easy to check the value with print info.

> -	HINIC_PORT_CMD_SET_AUTONEG	= 219,
> -
> -	HINIC_PORT_CMD_GET_STD_SFP_INFO = 240,
> -
> -	HINIC_PORT_CMD_SET_LRO_TIMER	= 244,
> -
> -	HINIC_PORT_CMD_SET_VF_MAX_MIN_RATE = 249,
> -
> -	HINIC_PORT_CMD_GET_SFP_ABS	= 251,
> +	HINIC_PORT_CMD_GET_SFP_ABS = 0xFB,

This deletes some entries. Please don't mix changes with mechanical
conversions.
  
Cai Huoqing Oct. 28, 2022, 4:37 a.m. UTC | #2
On 27 10月 22 11:02:41, Jakub Kicinski wrote:
> On Wed, 26 Oct 2022 20:59:10 +0800 Cai Huoqing wrote:
> > Subject: [PATCH 1/2] net: hinic: Convert the cmd code from decimal to hex to be more readable
> 
> Please put [PATCH net-next] or [PATCH -next] in the subject,
> to make the patch sorting easier for maintainers.
> 
> > The print cmd code is in hex, so using hex cmd code intead of
> > decimal is easy to check the value with print info.
> 
> > -	HINIC_PORT_CMD_SET_AUTONEG	= 219,
> > -
> > -	HINIC_PORT_CMD_GET_STD_SFP_INFO = 240,
> > -
> > -	HINIC_PORT_CMD_SET_LRO_TIMER	= 244,
> > -
> > -	HINIC_PORT_CMD_SET_VF_MAX_MIN_RATE = 249,
> > -
> > -	HINIC_PORT_CMD_GET_SFP_ABS	= 251,
> > +	HINIC_PORT_CMD_GET_SFP_ABS = 0xFB,
> 
> This deletes some entries. Please don't mix changes with mechanical
> conversions.
will revert these lines and resend

thanks,
Cai
  
Cai Huoqing Oct. 31, 2022, 2:17 a.m. UTC | #3
On 27 10月 22 11:02:41, Jakub Kicinski wrote:
> On Wed, 26 Oct 2022 20:59:10 +0800 Cai Huoqing wrote:
> > Subject: [PATCH 1/2] net: hinic: Convert the cmd code from decimal to hex to be more readable
> 
> Please put [PATCH net-next] or [PATCH -next] in the subject,
> to make the patch sorting easier for maintainers.
> 
> > The print cmd code is in hex, so using hex cmd code intead of
> > decimal is easy to check the value with print info.
> 
> > -	HINIC_PORT_CMD_SET_AUTONEG	= 219,
> > -
> > -	HINIC_PORT_CMD_GET_STD_SFP_INFO = 240,
> > -
> > -	HINIC_PORT_CMD_SET_LRO_TIMER	= 244,
> > -
> > -	HINIC_PORT_CMD_SET_VF_MAX_MIN_RATE = 249,
> > -
> > -	HINIC_PORT_CMD_GET_SFP_ABS	= 251,
> > +	HINIC_PORT_CMD_GET_SFP_ABS = 0xFB,
> 
> This deletes some entries. Please don't mix changes with mechanical
> conversions.
After checking my patch again, these can be find,

+	HINIC_PORT_CMD_SET_AUTONEG = 0xDB,
+	HINIC_PORT_CMD_GET_STD_SFP_INFO = 0xF0,
+	HINIC_PORT_CMD_SET_LRO_TIMER = 0xF4,
+	HINIC_PORT_CMD_SET_VF_MAX_MIN_RATE = 0xF9,
  
Cai Huoqing Nov. 1, 2022, 2:23 a.m. UTC | #4
On 27 10月 22 11:02:41, Jakub Kicinski wrote:
> On Wed, 26 Oct 2022 20:59:10 +0800 Cai Huoqing wrote:
> > Subject: [PATCH 1/2] net: hinic: Convert the cmd code from decimal to hex to be more readable
> 
> Please put [PATCH net-next] or [PATCH -next] in the subject,
> to make the patch sorting easier for maintainers.
This series is based on net-next, if need to resend, I will add
net-next prefix.

Thanks,
Cai
> 
> > The print cmd code is in hex, so using hex cmd code intead of
> > decimal is easy to check the value with print info.
> 
> > -	HINIC_PORT_CMD_SET_AUTONEG	= 219,
> > -
> > -	HINIC_PORT_CMD_GET_STD_SFP_INFO = 240,
> > -
> > -	HINIC_PORT_CMD_SET_LRO_TIMER	= 244,
> > -
> > -	HINIC_PORT_CMD_SET_VF_MAX_MIN_RATE = 249,
> > -
> > -	HINIC_PORT_CMD_GET_SFP_ABS	= 251,
> > +	HINIC_PORT_CMD_GET_SFP_ABS = 0xFB,
> 
> This deletes some entries. Please don't mix changes with mechanical
> conversions.
  

Patch

diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.h b/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.h
index d2d89b0a5ef0..abffd967a791 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.h
+++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.h
@@ -46,104 +46,100 @@  enum hinic_port_cmd {
 	HINIC_PORT_CMD_VF_REGISTER = 0x0,
 	HINIC_PORT_CMD_VF_UNREGISTER = 0x1,
 
-	HINIC_PORT_CMD_CHANGE_MTU       = 2,
+	HINIC_PORT_CMD_CHANGE_MTU = 0x2,
 
-	HINIC_PORT_CMD_ADD_VLAN         = 3,
-	HINIC_PORT_CMD_DEL_VLAN         = 4,
+	HINIC_PORT_CMD_ADD_VLAN = 0x3,
+	HINIC_PORT_CMD_DEL_VLAN = 0x4,
 
-	HINIC_PORT_CMD_SET_PFC		= 5,
+	HINIC_PORT_CMD_SET_PFC = 0x5,
 
-	HINIC_PORT_CMD_SET_MAC          = 9,
-	HINIC_PORT_CMD_GET_MAC          = 10,
-	HINIC_PORT_CMD_DEL_MAC          = 11,
+	HINIC_PORT_CMD_SET_MAC = 0x9,
+	HINIC_PORT_CMD_GET_MAC = 0xA,
+	HINIC_PORT_CMD_DEL_MAC = 0xB,
 
-	HINIC_PORT_CMD_SET_RX_MODE      = 12,
+	HINIC_PORT_CMD_SET_RX_MODE = 0xC,
 
-	HINIC_PORT_CMD_GET_PAUSE_INFO	= 20,
-	HINIC_PORT_CMD_SET_PAUSE_INFO	= 21,
+	HINIC_PORT_CMD_GET_PAUSE_INFO = 0x14,
+	HINIC_PORT_CMD_SET_PAUSE_INFO = 0x15,
 
-	HINIC_PORT_CMD_GET_LINK_STATE   = 24,
+	HINIC_PORT_CMD_GET_LINK_STATE = 0x18,
 
-	HINIC_PORT_CMD_SET_LRO		= 25,
+	HINIC_PORT_CMD_SET_LRO = 0x19,
 
-	HINIC_PORT_CMD_SET_RX_CSUM	= 26,
+	HINIC_PORT_CMD_SET_RX_CSUM = 0x1A,
 
-	HINIC_PORT_CMD_SET_RX_VLAN_OFFLOAD = 27,
+	HINIC_PORT_CMD_SET_RX_VLAN_OFFLOAD = 0x1B,
 
-	HINIC_PORT_CMD_GET_PORT_STATISTICS = 28,
+	HINIC_PORT_CMD_GET_PORT_STATISTICS = 0x1C,
 
-	HINIC_PORT_CMD_CLEAR_PORT_STATISTICS = 29,
+	HINIC_PORT_CMD_CLEAR_PORT_STATISTICS = 0x1D,
 
-	HINIC_PORT_CMD_GET_VPORT_STAT	= 30,
+	HINIC_PORT_CMD_GET_VPORT_STAT = 0x1E,
 
-	HINIC_PORT_CMD_CLEAN_VPORT_STAT	= 31,
+	HINIC_PORT_CMD_CLEAN_VPORT_STAT	= 0x1F,
 
-	HINIC_PORT_CMD_GET_RSS_TEMPLATE_INDIR_TBL = 37,
+	HINIC_PORT_CMD_GET_RSS_TEMPLATE_INDIR_TBL = 0x25,
 
-	HINIC_PORT_CMD_SET_PORT_STATE   = 41,
+	HINIC_PORT_CMD_SET_PORT_STATE = 0x29,
 
-	HINIC_PORT_CMD_SET_RSS_TEMPLATE_TBL = 43,
+	HINIC_PORT_CMD_SET_RSS_TEMPLATE_TBL = 0x2B,
+	HINIC_PORT_CMD_GET_RSS_TEMPLATE_TBL = 0x2C,
 
-	HINIC_PORT_CMD_GET_RSS_TEMPLATE_TBL = 44,
+	HINIC_PORT_CMD_SET_RSS_HASH_ENGINE = 0x2D,
+	HINIC_PORT_CMD_GET_RSS_HASH_ENGINE = 0x2E,
 
-	HINIC_PORT_CMD_SET_RSS_HASH_ENGINE = 45,
+	HINIC_PORT_CMD_GET_RSS_CTX_TBL = 0x2F,
+	HINIC_PORT_CMD_SET_RSS_CTX_TBL = 0x30,
 
-	HINIC_PORT_CMD_GET_RSS_HASH_ENGINE = 46,
+	HINIC_PORT_CMD_RSS_TEMP_MGR	= 0x31,
 
-	HINIC_PORT_CMD_GET_RSS_CTX_TBL  = 47,
+	HINIC_PORT_CMD_RD_LINE_TBL = 0x39,
 
-	HINIC_PORT_CMD_SET_RSS_CTX_TBL  = 48,
+	HINIC_PORT_CMD_RSS_CFG = 0x42,
 
-	HINIC_PORT_CMD_RSS_TEMP_MGR	= 49,
+	HINIC_PORT_CMD_FWCTXT_INIT = 0x45,
 
-	HINIC_PORT_CMD_RD_LINE_TBL	= 57,
+	HINIC_PORT_CMD_GET_LOOPBACK_MODE = 0x48,
+	HINIC_PORT_CMD_SET_LOOPBACK_MODE = 0x49,
 
-	HINIC_PORT_CMD_RSS_CFG		= 66,
+	HINIC_PORT_CMD_ENABLE_SPOOFCHK = 0x4E,
 
-	HINIC_PORT_CMD_FWCTXT_INIT      = 69,
+	HINIC_PORT_CMD_GET_MGMT_VERSION = 0x58,
 
-	HINIC_PORT_CMD_GET_LOOPBACK_MODE = 72,
-	HINIC_PORT_CMD_SET_LOOPBACK_MODE,
+	HINIC_PORT_CMD_SET_FUNC_STATE = 0x5D,
 
-	HINIC_PORT_CMD_ENABLE_SPOOFCHK = 78,
+	HINIC_PORT_CMD_GET_GLOBAL_QPN = 0x66,
 
-	HINIC_PORT_CMD_GET_MGMT_VERSION = 88,
+	HINIC_PORT_CMD_SET_VF_RATE = 0x69,
 
-	HINIC_PORT_CMD_SET_FUNC_STATE   = 93,
+	HINIC_PORT_CMD_SET_VF_VLAN = 0x6A,
+	HINIC_PORT_CMD_CLR_VF_VLAN = 0x6B,
 
-	HINIC_PORT_CMD_GET_GLOBAL_QPN   = 102,
+	HINIC_PORT_CMD_SET_TSO = 0x70,
 
-	HINIC_PORT_CMD_SET_VF_RATE = 105,
+	HINIC_PORT_CMD_UPDATE_FW = 0x72,
 
-	HINIC_PORT_CMD_SET_VF_VLAN	= 106,
+	HINIC_PORT_CMD_SET_RQ_IQ_MAP = 0x73,
 
-	HINIC_PORT_CMD_CLR_VF_VLAN,
+	HINIC_PORT_CMD_LINK_STATUS_REPORT = 0xA0,
 
-	HINIC_PORT_CMD_SET_TSO          = 112,
+	HINIC_PORT_CMD_UPDATE_MAC = 0xA4,
 
-	HINIC_PORT_CMD_UPDATE_FW	= 114,
+	HINIC_PORT_CMD_GET_CAP = 0xAA,
 
-	HINIC_PORT_CMD_SET_RQ_IQ_MAP	= 115,
+	HINIC_PORT_CMD_GET_LINK_MODE = 0xD9,
 
-	HINIC_PORT_CMD_LINK_STATUS_REPORT = 160,
+	HINIC_PORT_CMD_SET_SPEED = 0xDA,
 
-	HINIC_PORT_CMD_UPDATE_MAC = 164,
+	HINIC_PORT_CMD_SET_AUTONEG = 0xDB,
 
-	HINIC_PORT_CMD_GET_CAP          = 170,
+	HINIC_PORT_CMD_GET_STD_SFP_INFO = 0xF0,
 
-	HINIC_PORT_CMD_GET_LINK_MODE	= 217,
+	HINIC_PORT_CMD_SET_LRO_TIMER = 0xF4,
 
-	HINIC_PORT_CMD_SET_SPEED	= 218,
+	HINIC_PORT_CMD_SET_VF_MAX_MIN_RATE = 0xF9,
 
-	HINIC_PORT_CMD_SET_AUTONEG	= 219,
-
-	HINIC_PORT_CMD_GET_STD_SFP_INFO = 240,
-
-	HINIC_PORT_CMD_SET_LRO_TIMER	= 244,
-
-	HINIC_PORT_CMD_SET_VF_MAX_MIN_RATE = 249,
-
-	HINIC_PORT_CMD_GET_SFP_ABS	= 251,
+	HINIC_PORT_CMD_GET_SFP_ABS = 0xFB,
 };
 
 /* cmd of mgmt CPU message for HILINK module */