From patchwork Tue Nov 1 06:03:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cai Huoqing X-Patchwork-Id: 13524 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2762920wru; Mon, 31 Oct 2022 23:07:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7dl7dJvRyWarJvW6h3S0yJOziO1SQWurQBCDtugfo+ktiznAXqaYlJSzuOYDXGGYRhUger X-Received: by 2002:a17:907:3206:b0:780:a882:a9ac with SMTP id xg6-20020a170907320600b00780a882a9acmr16555168ejb.765.1667282838946; Mon, 31 Oct 2022 23:07:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667282838; cv=none; d=google.com; s=arc-20160816; b=gjaEVNn+Sf6Rl5gaoLafV5/tpwRURlWy1bjfSf8cT1t5Ednlk9vNv2rCHXbUJtROQY RsvGFjh4CvH5FrzkRkRTdJm09NFS9bDEbHLGF0puN8Vq74V9uXyBs0oJ+c+hySVvKgYB u+5SdIFQeyklCyKjusdJ7F1k6eNHATTGLGY5dwjv+524VTOUhbaw0tSXFLMdmgdyc4TL bBQu92HlpFDU8AXivpNfhNyS8zMiQisvXep29zZ78DZMtBJpJwBLcZv7CthuG6XGDqo0 a+RXKuFV2ySAokF4GCW7IlraFDXeS/L27QQtNKnyDSInniJV6iLWZX1kWxB62jw/3b2f pVXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=icAV7Lk2okoEvGxaz81uFN6IaGUFlk9fMa1YNalfuA0=; b=GBNjqhXEVioqUyWMbsjUhauBS9LJ6QESCmn0nBQ9gGiLz0p6bA4220bHKg313iDu0z xz7lEiCO4EMoRpN9GWwvHIYv2QGUumsr0ZesL/DYkfjz9IORdW3unWj6PeuRHq/OWn/b rdg7WbO+8sUoHyqeSa3u4iLKLbbkp472EF3pORF6uoYwM4s6x8wC790yEVsph+c6LNpv q+kWlSjv6gao1Bl1yJWWU0YgKMWjT9e/CF+qRRE7xkpC5yv76oj1KfmPrjlTdH5i8577 Gm9aGWM/UzybAXOAS3nOKKMugF6sjAwCMyOf/Jkf0UYzgkSJuVBt3u6QpygLktUXCQw9 S++w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=FKd9fy6j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g24-20020a50d0d8000000b00461727807a4si10316600edf.534.2022.10.31.23.06.55; Mon, 31 Oct 2022 23:07:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=FKd9fy6j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229711AbiKAGER (ORCPT + 99 others); Tue, 1 Nov 2022 02:04:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229452AbiKAGEP (ORCPT ); Tue, 1 Nov 2022 02:04:15 -0400 Received: from out0.migadu.com (out0.migadu.com [IPv6:2001:41d0:2:267::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56AFC13F1C; Mon, 31 Oct 2022 23:04:13 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1667282651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=icAV7Lk2okoEvGxaz81uFN6IaGUFlk9fMa1YNalfuA0=; b=FKd9fy6jBZC1tKJgeDgCGU96ZNwD0C2DlV7uTgoCxo//KWAIJ0dMkjHzjylkfVDlVrZsRh YfDWTQQBrcj3a6IeUaPf49PSMesesxigiVI5tNrdZR/X0hCWPcfl60gOT3dTT0SlFJNk6e V2nadmSekOYqGZMQEYDt9JyfXd9XkmI= From: Cai Huoqing To: kuba@kernel.org Cc: Cai Huoqing , "David S. Miller" , Eric Dumazet , Paolo Abeni , Zhengchao Shao , Alexei Starovoitov , SeongJae Park , Peter Chen , Bin Chen , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v2 1/2] net: hinic: Convert the cmd code from decimal to hex to be more readable Date: Tue, 1 Nov 2022 14:03:38 +0800 Message-Id: <20221101060358.7837-1-cai.huoqing@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,UPPERCASE_50_75 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747755751723522502?= X-GMAIL-MSGID: =?utf-8?q?1748272769841077041?= 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 --- v1->v2: 1.Add net-next prefix. The comments link: https://lore.kernel.org/lkml/20221027110241.0340abdf@kernel.org/ .../net/ethernet/huawei/hinic/hinic_hw_dev.h | 108 +++++++++--------- 1 file changed, 52 insertions(+), 56 deletions(-) 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 */