Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ethtool for openSUSE:Factory checked in at 2023-09-21 22:13:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ethtool (Old) and /work/SRC/openSUSE:Factory/.ethtool.new.1770 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ethtool" Thu Sep 21 22:13:28 2023 rev:80 rq:1112395 version:6.5 Changes: -------- --- /work/SRC/openSUSE:Factory/ethtool/ethtool.changes 2023-05-10 16:17:17.726538487 +0200 +++ /work/SRC/openSUSE:Factory/.ethtool.new.1770/ethtool.changes 2023-09-21 22:13:59.793154899 +0200 @@ -1,0 +2,23 @@ +Tue Sep 12 20:50:21 UTC 2023 - Michal Kubecek <mkube...@suse.cz> + +- update to upstream release 6.5 + * Feature: register dump for hns3 driver (-d) + * Fix: fix fallback to ioctl for sset (-s) + * Fix: fix empty slot search in rmgr (-N) + +------------------------------------------------------------------- +Sun Jul 1 22:25:36 UTC 2023 - Michal Kubecek <mkube...@suse.cz> + +- update to upstream release 6.4 + * Feature: get/set Tx push buffer length (-G) + * Feature: sff-8636 and cmis: report LOL / LOS / Tx Fault (-m) + * Fix: fix duplex setting parser (-s) + * Misc: check and require C11 language standard + * Misc: clean up obsolete pre-build checks + +------------------------------------------------------------------- +Sat Jul 1 22:01:19 UTC 2023 - Michal Kubecek <mkube...@suse.cz> + +- make ethtool-bash-completion noarch + +------------------------------------------------------------------- Old: ---- ethtool-6.3.tar.sign ethtool-6.3.tar.xz New: ---- ethtool-6.5.tar.sign ethtool-6.5.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ethtool.spec ++++++ --- /var/tmp/diff_new_pack.svs30T/_old 2023-09-21 22:14:00.985198161 +0200 +++ /var/tmp/diff_new_pack.svs30T/_new 2023-09-21 22:14:00.985198161 +0200 @@ -17,7 +17,7 @@ Name: ethtool -Version: 6.3 +Version: 6.5 Release: 0 Summary: Utility for examining and tuning Ethernet-based network interfaces License: GPL-2.0-only @@ -47,6 +47,7 @@ %else Supplements: packageand(%{name}:bash-completion) %endif +BuildArch: noarch %description bash-completion bash command line completion support for ethtool. @@ -56,9 +57,6 @@ %build export CFLAGS="%optflags -Wall -Wextra -Wstrict-prototypes -Wformat-security -Wpointer-arith" -%if 0%{?suse_version} < 1500 -CFLAGS="$CFLAGS -std=c11" -%endif %configure make %{?_smp_mflags} ++++++ ethtool-6.3.tar.xz -> ethtool-6.5.tar.xz ++++++ ++++ 2003 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ethtool-6.3/Makefile.am new/ethtool-6.5/Makefile.am --- old/ethtool-6.3/Makefile.am 2023-04-19 00:31:46.000000000 +0200 +++ new/ethtool-6.5/Makefile.am 2023-09-11 22:14:13.000000000 +0200 @@ -19,7 +19,7 @@ smsc911x.c at76c50x-usb.c sfc.c stmmac.c \ sff-common.c sff-common.h sfpid.c sfpdiag.c \ ixgbevf.c tse.c vmxnet3.c qsfp.c qsfp.h fjes.c lan78xx.c \ - igc.c cmis.c cmis.h bnxt.c cpsw.c lan743x.c + igc.c cmis.c cmis.h bnxt.c cpsw.c lan743x.c hns3.c endif if ENABLE_BASH_COMPLETION diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ethtool-6.3/NEWS new/ethtool-6.5/NEWS --- old/ethtool-6.3/NEWS 2023-05-08 22:50:07.000000000 +0200 +++ new/ethtool-6.5/NEWS 2023-09-12 22:27:56.000000000 +0200 @@ -1,3 +1,15 @@ +Version 6.5 - September 12, 2023 + * Feature: register dump for hns3 driver (-d) + * Fix: fix fallback to ioctl for sset (-s) + * Fix: fix empty slot search in rmgr (-N) + +Version 6.4 - July 1, 2023 + * Feature: get/set Tx push buffer length (-G) + * Feature: sff-8636 and cmis: report LOL / LOS / Tx Fault (-m) + * Fix: fix duplex setting parser (-s) + * Misc: check and require C11 language standard + * Misc: clean up obsolete pre-build checks + Version 6.3 - May 8, 2023 * Feature: PLCA support (--[gs]et-plca-cfg, --get-plca-status) * Feature: MAC Merge layer support (--show-mm, --set-mm) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ethtool-6.3/cmis.c new/ethtool-6.5/cmis.c --- old/ethtool-6.3/cmis.c 2022-12-08 13:20:15.000000000 +0100 +++ new/ethtool-6.5/cmis.c 2023-06-14 20:46:26.000000000 +0200 @@ -139,6 +139,44 @@ printf("\t%-41s : Rev. %d.%d\n", "Revision compliance", major, minor); } +static void +cmis_show_signals_one(const struct cmis_memory_map *map, const char *name, + int off, int ioff, unsigned int imask) +{ + unsigned int v; + int i; + + if (!map->page_01h) + return; + + v = 0; + for (i = 0; i < CMIS_MAX_BANKS && map->upper_memory[i][0x11]; i++) + v |= map->upper_memory[i][0x11][off] << (i * 8); + + if (map->page_01h[ioff] & imask) + sff_show_lane_status(name, i * 8, "Yes", "No", v); +} + +static void cmis_show_signals(const struct cmis_memory_map *map) +{ + cmis_show_signals_one(map, "Rx loss of signal", CMIS_RX_LOS_OFFSET, + CMIS_DIAG_FLAGS_RX_OFFSET, CMIS_DIAG_FL_RX_LOS); + cmis_show_signals_one(map, "Tx loss of signal", CMIS_TX_LOS_OFFSET, + CMIS_DIAG_FLAGS_TX_OFFSET, CMIS_DIAG_FL_TX_LOS); + + cmis_show_signals_one(map, "Rx loss of lock", CMIS_RX_LOL_OFFSET, + CMIS_DIAG_FLAGS_RX_OFFSET, CMIS_DIAG_FL_RX_LOL); + cmis_show_signals_one(map, "Tx loss of lock", CMIS_TX_LOL_OFFSET, + CMIS_DIAG_FLAGS_TX_OFFSET, CMIS_DIAG_FL_TX_LOL); + + cmis_show_signals_one(map, "Tx fault", CMIS_TX_FAIL_OFFSET, + CMIS_DIAG_FLAGS_TX_OFFSET, CMIS_DIAG_FL_TX_FAIL); + + cmis_show_signals_one(map, "Tx adaptive eq fault", + CMIS_TX_EQ_FAIL_OFFSET, CMIS_DIAG_FLAGS_TX_OFFSET, + CMIS_DIAG_FL_TX_ADAPTIVE_EQ_FAIL); +} + /** * Print information about the device's power consumption. * Relevant documents: @@ -857,6 +895,7 @@ cmis_show_link_len(map); cmis_show_vendor_info(map); cmis_show_rev_compliance(map); + cmis_show_signals(map); cmis_show_mod_state(map); cmis_show_mod_fault_cause(map); cmis_show_mod_lvl_controls(map); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ethtool-6.3/cmis.h new/ethtool-6.5/cmis.h --- old/ethtool-6.3/cmis.h 2021-12-02 22:59:33.000000000 +0100 +++ new/ethtool-6.5/cmis.h 2023-06-14 20:46:26.000000000 +0200 @@ -158,6 +158,17 @@ #define CMIS_DIAG_TYPE_OFFSET 0x97 #define CMIS_RX_PWR_TYPE_MASK 0x10 +/* Supported Flags Advertisement (Page 1) */ +#define CMIS_DIAG_FLAGS_TX_OFFSET 0x9d +#define CMIS_DIAG_FL_TX_ADAPTIVE_EQ_FAIL (1 << 3) +#define CMIS_DIAG_FL_TX_LOL (1 << 2) +#define CMIS_DIAG_FL_TX_LOS (1 << 1) +#define CMIS_DIAG_FL_TX_FAIL (1 << 0) + +#define CMIS_DIAG_FLAGS_RX_OFFSET 0x9e +#define CMIS_DIAG_FL_RX_LOL (1 << 2) +#define CMIS_DIAG_FL_RX_LOS (1 << 1) + /* Supported Monitors Advertisement (Page 1) */ #define CMIS_DIAG_CHAN_ADVER_OFFSET 0xA0 #define CMIS_TX_BIAS_MON_MASK 0x01 @@ -207,6 +218,10 @@ */ /* Media Lane-Specific Flags (Page 0x11) */ +#define CMIS_TX_FAIL_OFFSET 0x87 +#define CMIS_TX_LOS_OFFSET 0x88 +#define CMIS_TX_LOL_OFFSET 0x89 +#define CMIS_TX_EQ_FAIL_OFFSET 0x8a #define CMIS_TX_PWR_AW_HALARM_OFFSET 0x8B #define CMIS_TX_PWR_AW_LALARM_OFFSET 0x8C #define CMIS_TX_PWR_AW_HWARN_OFFSET 0x8D @@ -215,6 +230,8 @@ #define CMIS_TX_BIAS_AW_LALARM_OFFSET 0x90 #define CMIS_TX_BIAS_AW_HWARN_OFFSET 0x91 #define CMIS_TX_BIAS_AW_LWARN_OFFSET 0x92 +#define CMIS_RX_LOS_OFFSET 0x93 +#define CMIS_RX_LOL_OFFSET 0x94 #define CMIS_RX_PWR_AW_HALARM_OFFSET 0x95 #define CMIS_RX_PWR_AW_LALARM_OFFSET 0x96 #define CMIS_RX_PWR_AW_HWARN_OFFSET 0x97 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ethtool-6.3/configure.ac new/ethtool-6.5/configure.ac --- old/ethtool-6.3/configure.ac 2023-05-08 22:36:18.000000000 +0200 +++ new/ethtool-6.5/configure.ac 2023-09-12 22:21:56.000000000 +0200 @@ -1,6 +1,7 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(ethtool, 6.3, net...@vger.kernel.org) +AC_INIT(ethtool, 6.5, net...@vger.kernel.org) AC_PREREQ(2.52) +AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([ethtool.c]) AM_INIT_AUTOMAKE([gnu subdir-objects]) AC_CONFIG_HEADERS([ethtool-config.h]) @@ -13,22 +14,25 @@ AM_PROG_CC_C_O PKG_PROG_PKG_CONFIG +AC_DEFUN([AX_CHECK_STDC], + [AX_CHECK_COMPILE_FLAG([-std=gnu11], + [AX_APPEND_FLAG([-std=gnu11])], + [AX_CHECK_COMPILE_FLAG([-std=c11], + [AX_APPEND_FLAG([-std=c11])], + [AC_MSG_ERROR([$PACKAGE requires a C11 compiler])]) + ]) + ]) +AX_CHECK_STDC + dnl Checks for libraries. dnl Checks for header files. dnl Checks for typedefs, structures, and compiler characteristics. -AC_MSG_CHECKING([whether <linux/types.h> defines big-endian types]) -AC_TRY_COMPILE([#include <linux/types.h>], - [__be16 foo;__be32 bar;], - [AC_MSG_RESULT(yes) - AC_DEFINE([HAVE_BE_TYPES], [1], - [Define to 1 if <linux/types.h> defines big-endian types])], - [AC_MSG_RESULT(no)]) dnl Checks for library functions. AC_HEADER_STDC -AC_CHECK_FUNCS(socket strtol) +AC_CHECK_FUNCS(socket) dnl Check for options AC_ARG_ENABLE(pretty-dump, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ethtool-6.3/ethtool-config.h.in new/ethtool-6.5/ethtool-config.h.in --- old/ethtool-6.3/ethtool-config.h.in 2023-05-08 22:55:20.000000000 +0200 +++ new/ethtool-6.5/ethtool-config.h.in 2023-09-12 22:40:47.000000000 +0200 @@ -6,15 +6,9 @@ /* Define this to enable register, EEPROM and SFP pretty dumps. */ #undef ETHTOOL_ENABLE_PRETTY_DUMP -/* Define to 1 if <linux/types.h> defines big-endian types */ -#undef HAVE_BE_TYPES - /* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET -/* Define to 1 if you have the `strtol' function. */ -#undef HAVE_STRTOL - /* Name of package */ #undef PACKAGE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ethtool-6.3/ethtool.8 new/ethtool-6.5/ethtool.8 --- old/ethtool-6.3/ethtool.8 2023-05-08 22:55:21.000000000 +0200 +++ new/ethtool-6.5/ethtool.8 2023-09-12 22:40:48.000000000 +0200 @@ -117,7 +117,7 @@ . hy \\n(HY .. . -.TH ETHTOOL 8 "May 2023" "Ethtool version 6.3" +.TH ETHTOOL 8 "September 2023" "Ethtool version 6.5" .SH NAME ethtool \- query or control network driver and hardware settings . @@ -205,6 +205,7 @@ .BN cqe\-size .BN tx\-push .BN rx\-push +.BN tx\-push\-buf\-len .HP .B ethtool \-i|\-\-driver .I devname @@ -636,6 +637,10 @@ .TP .BI rx\-push \ on|off Specifies whether RX push should be enabled. +.TP +.BI tx\-push\-buf\-len \ N +Specifies the maximum number of bytes of a transmitted packet a driver can push +directly to the underlying device .RE .TP .B \-i \-\-driver diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ethtool-6.3/ethtool.8.in new/ethtool-6.5/ethtool.8.in --- old/ethtool-6.3/ethtool.8.in 2023-05-08 22:36:42.000000000 +0200 +++ new/ethtool-6.5/ethtool.8.in 2023-09-12 22:21:41.000000000 +0200 @@ -117,7 +117,7 @@ . hy \\n(HY .. . -.TH ETHTOOL 8 "May 2023" "Ethtool version @VERSION@" +.TH ETHTOOL 8 "September 2023" "Ethtool version @VERSION@" .SH NAME ethtool \- query or control network driver and hardware settings . @@ -205,6 +205,7 @@ .BN cqe\-size .BN tx\-push .BN rx\-push +.BN tx\-push\-buf\-len .HP .B ethtool \-i|\-\-driver .I devname @@ -636,6 +637,10 @@ .TP .BI rx\-push \ on|off Specifies whether RX push should be enabled. +.TP +.BI tx\-push\-buf\-len \ N +Specifies the maximum number of bytes of a transmitted packet a driver can push +directly to the underlying device .RE .TP .B \-i \-\-driver diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ethtool-6.3/ethtool.c new/ethtool-6.5/ethtool.c --- old/ethtool-6.3/ethtool.c 2023-05-08 22:35:40.000000000 +0200 +++ new/ethtool-6.5/ethtool.c 2023-09-11 22:14:13.000000000 +0200 @@ -58,10 +58,6 @@ #define MAX_ADDR_LEN 32 #endif -#ifndef NETLINK_GENERIC -#define NETLINK_GENERIC 16 -#endif - #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) static void exit_bad_args(void) __attribute__((noreturn)); @@ -1165,6 +1161,7 @@ { "lan743x", lan743x_dump_regs }, { "fsl_enetc", fsl_enetc_dump_regs }, { "fsl_enetc_vf", fsl_enetc_dump_regs }, + { "hns3", hns3_dump_regs }, }; #endif @@ -5754,6 +5751,7 @@ " [ cqe-size N ]\n" " [ tx-push on|off ]\n" " [ rx-push on|off ]\n" + " [ tx-push-buf-len N]\n" }, { .opts = "-k|--show-features|--show-offload", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ethtool-6.3/ethtool.spec new/ethtool-6.5/ethtool.spec --- old/ethtool-6.3/ethtool.spec 2023-05-08 22:55:22.000000000 +0200 +++ new/ethtool-6.5/ethtool.spec 2023-09-12 22:40:49.000000000 +0200 @@ -1,5 +1,5 @@ Name : ethtool -Version : 6.3 +Version : 6.5 Release : 1 Group : Utilities diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ethtool-6.3/hns3.c new/ethtool-6.5/hns3.c --- old/ethtool-6.3/hns3.c 1970-01-01 01:00:00.000000000 +0100 +++ new/ethtool-6.5/hns3.c 2023-09-11 22:14:13.000000000 +0200 @@ -0,0 +1,829 @@ +/* Copyright (c) 2023 Huawei Corporation */ +#include <stdio.h> +#include <stdlib.h> +#include <errno.h> +#include "internal.h" + +/* distinguish drive register data of earlier versions */ +#define HNS3_REG_MAGIC_NUMBER 0x686e733372656773 /* hns3regs */ +#define HNS3_REG_RSV_NAME "reserved" +#define HNS3_REG_UNKNOW_NAME "unknown" +#define HNS3_REG_UNKNOW_VALUE_LEN 4 + +struct hns3_reg_tlv { + u16 tag; + u16 len; +}; + +struct hns3_reg_header { + u64 magic_number; + u8 is_vf; + u8 rsv[7]; +}; + +struct hns3_reg_info { + const char *name; + u16 value_len; +}; + +struct hns3_regs_group { + const char *group_name; + const struct hns3_reg_info *regs; + u16 regs_count; +}; + +enum hns3_reg_tag { + HNS3_TAG_CMDQ = 0, + HNS3_TAG_COMMON, + HNS3_TAG_RING, + HNS3_TAG_TQP_INTR, + HNS3_TAG_QUERY_32_BIT, + HNS3_TAG_QUERY_64_BIT, + HNS3_TAG_DFX_BIOS_COMMON, + HNS3_TAG_DFX_SSU_0, + HNS3_TAG_DFX_SSU_1, + HNS3_TAG_DFX_IGU_EGU, + HNS3_TAG_DFX_RPU_0, + HNS3_TAG_DFX_RPU_1, + HNS3_TAG_DFX_NCSI, + HNS3_TAG_DFX_RTC, + HNS3_TAG_DFX_PPP, + HNS3_TAG_DFX_RCB, + HNS3_TAG_DFX_TQP, + HNS3_TAG_DFX_SSU_2, + HNS3_TAG_DFX_RPU_TNL, + HNS3_TAG_MAX, +}; + +const bool hns3_reg_is_repeat_tag_array[] = { + [HNS3_TAG_RING] = true, + [HNS3_TAG_TQP_INTR] = true, + [HNS3_TAG_DFX_RPU_TNL] = true, +}; + +const struct hns3_reg_info pf_cmdq_regs[] = { + {"comm_nic_csq_baseaddr_l", 4}, + {"comm_nic_csq_baseaddr_h", 4}, + {"comm_nic_csq_depth", 4}, + {"comm_nic_csq_tail", 4}, + {"comm_nic_csq_head", 4}, + {"comm_nic_crq_baseaddr_l", 4}, + {"comm_nic_crq_baseaddr_h", 4}, + {"comm_nic_crq_depth", 4}, + {"comm_nic_crq_tail", 4}, + {"comm_nic_crq_head", 4}, + {"comm_vector0_cmdq_src", 4}, + {"comm_cmdq_intr_sts", 4}, + {"comm_cmdq_intr_en", 4}, + {"comm_cmdq_intr_gen", 4}, +}; + +const struct hns3_reg_info pf_common_regs[] = { + {"misc_vector_base", 4}, + {"pf_other_int", 4}, + {"misc_reset_sts", 4}, + {"misc_vector_int_sts", 4}, + {"global_reset", 4}, + {"fun_rst_ing", 4}, + {"gro_en", 4}, +}; + +const struct hns3_reg_info pf_ring_regs[] = { + {"ring_rx_addr_l", 4}, + {"ring_rx_addr_h", 4}, + {"ring_rx_bd_num", 4}, + {"ring_rx_bd_length", 4}, + {"ring_rx_merge_en", 4}, + {"ring_rx_tail", 4}, + {"ring_rx_head", 4}, + {"ring_rx_fbd_num", 4}, + {"ring_rx_offset", 4}, + {"ring_rx_fbd_offset", 4}, + {"ring_rx_stash", 4}, + {"ring_rx_bd_err", 4}, + {"ring_tx_addr_l", 4}, + {"ring_tx_addr_h", 4}, + {"ring_tx_bd_num", 4}, + {"ring_tx_priority", 4}, + {"ring_tx_tc", 4}, + {"ring_tx_merge_en", 4}, + {"ring_tx_tail", 4}, + {"ring_tx_head", 4}, + {"ring_tx_fbd_num", 4}, + {"ring_tx_offset", 4}, + {"ring_tx_ebd_num", 4}, + {"ring_tx_ebd_offset", 4}, + {"ring_tx_bd_err", 4}, + {"ring_en", 4}, +}; + +const struct hns3_reg_info pf_tqp_intr_regs[] = { + {"tqp_intr_ctrl", 4}, + {"tqp_intr_gl0", 4}, + {"tqp_intr_gl1", 4}, + {"tqp_intr_gl2", 4}, + {"tqp_intr_rl", 4}, +}; + +const struct hns3_reg_info query_32_bit_regs[] = { + {"ssu_common_err_int", 4}, + {"ssu_port_based_err_int", 4}, + {"ssu_fifo_overflow_int", 4}, + {"ssu_ets_tcg_int", 4}, + {"ssu_bp_status_0", 4}, + {"ssu_bp_status_1", 4}, + {"ssu_bp_status_2", 4}, + {"ssu_bp_status_3", 4}, + {"ssu_bp_status_4", 4}, + {"ssu_bp_status_5", 4}, + {"ssu_mac_tx_pfc_ind", 4}, + {"ssu_mac_rx_pfc_ind", 4}, + {"ssu_rx_oq_drop_pkt_cnt", 4}, + {"ssu_tx_oq_drop_pkt_cnt", 4}, +}; + +const struct hns3_reg_info query_64_bit_regs[] = { + {"ppp_get_rx_pkt_cnt", 8}, + {"ppp_get_tx_pkt_cnt", 8}, + {"ppp_send_uc_prt2host_pkt_cnt", 8}, + {"ppp_send_uc_prt2prt_pkt_cnt", 8}, + {"ppp_send_uc_host2host_pkt_cnt", 8}, + {"ppp_send_uc_host2prt_pkt_cnt", 8}, + {"ppp_send_mc_from_prt_cnt", 8}, +}; + +const struct hns3_reg_info dfx_bios_common_regs[] = { + {HNS3_REG_RSV_NAME, 4}, + {"bp_cpu_state", 4}, + {"dfx_msix_info_nic_0", 4}, + {"dfx_msix_info_nic_1", 4}, + {"dfx_msix_info_nic_2", 4}, + {"dfx_msix_info_nic_3", 4}, + {"dfx_msix_info_roc_0", 4}, + {"dfx_msix_info_roc_1", 4}, + {"dfx_msix_info_roc_2", 4}, + {"dfx_msix_info_roc_3", 4}, + {HNS3_REG_RSV_NAME, 8}, +}; + +const struct hns3_reg_info dfx_ssu_0_regs[] = { + {HNS3_REG_RSV_NAME, 4}, + {"ssu_ets_port_status", 4}, + {"ssu_ets_tcg_status", 4}, + {HNS3_REG_RSV_NAME, 4}, + {HNS3_REG_RSV_NAME, 4}, + {"ssu_bp_status_0", 4}, + {"ssu_bp_status_1", 4}, + {"ssu_bp_status_2", 4}, + {"ssu_bp_status_3", 4}, + {"ssu_bp_status_4", 4}, + {"ssu_bp_status_5", 4}, + {"ssu_mac_tx_pfc_ind", 4}, + {"mac_ssu_rx_pfc_ind", 4}, + {"btmp_ageing_st_b0", 4}, + {"btmp_ageing_st_b1", 4}, + {"btmp_ageing_st_b2", 4}, + {HNS3_REG_RSV_NAME, 8}, + {"full_drop_num", 4}, + {"part_drop_num", 4}, + {"ppp_key_drop_num", 4}, + {"ppp_rlt_drop_num", 4}, + {"lo_pri_unicast_rlt_drop_num", 4}, + {"hi_pri_multicast_rlt_drop_num", 4}, + {"lo_pri_multicast_rlt_drop_num", 4}, + {"ncsi_packet_curr_buffer_cnt", 4}, + {HNS3_REG_RSV_NAME, 12}, + {"ssu_mb_rd_rlt_drop_cnt", 4}, + {"ssu_ppp_mac_key_num", 8}, + {"ssu_ppp_host_key_num", 8}, + {"ppp_ssu_mac_rlt_num", 8}, + {"ppp_ssu_host_rlt_num", 8}, + {"ncsi_rx_packet_in_cnt", 8}, + {"ncsi_tx_packet_out_cnt", 8}, + {"ssu_key_drop_num", 4}, + {"mb_uncopy_num", 4}, + {"rx_oq_drop_pkt_cnt", 4}, + {"tx_oq_drop_pkt_cnt", 4}, + {"bank_unbalance_drop_cnt", 4}, + {"bank_unbalance_rx_drop_cnt", 4}, + {"nic_l2_err_drop_pkt_cnt", 4}, + {"roc_l2_err_drop_pkt_cnt", 4}, + {"nic_l2_err_drop_pkt_cnt_rx", 4}, + {"roc_l2_err_drop_pkt_cnt_rx", 4}, + {"rx_oq_glb_drop_pkt_cnt", 4}, + {HNS3_REG_RSV_NAME, 4}, + {"lo_pri_unicast_cur_cnt", 4}, + {"hi_pri_multicast_cur_cnt", 4}, + {"lo_pri_multicast_cur_cnt", 4}, + {HNS3_REG_RSV_NAME, 12}, +}; + +const struct hns3_reg_info dfx_ssu_1_regs[] = { + {"prt_id", 4}, + {"packet_tc_curr_buffer_cnt_0", 4}, + {"packet_tc_curr_buffer_cnt_1", 4}, + {"packet_tc_curr_buffer_cnt_2", 4}, + {"packet_tc_curr_buffer_cnt_3", 4}, + {"packet_tc_curr_buffer_cnt_4", 4}, + {"packet_tc_curr_buffer_cnt_5", 4}, + {"packet_tc_curr_buffer_cnt_6", 4}, + {"packet_tc_curr_buffer_cnt_7", 4}, + {"packet_curr_buffer_cnt", 4}, + {HNS3_REG_RSV_NAME, 8}, + {"rx_packet_in_cnt", 8}, + {"rx_packet_out_cnt", 8}, + {"tx_packet_in_cnt", 8}, + {"tx_packet_out_cnt", 8}, + {"roc_rx_packet_in_cnt", 8}, + {"roc_tx_packet_out_cnt", 8}, + {"rx_packet_tc_in_cnt_0", 8}, + {"rx_packet_tc_in_cnt_1", 8}, + {"rx_packet_tc_in_cnt_2", 8}, + {"rx_packet_tc_in_cnt_3", 8}, + {"rx_packet_tc_in_cnt_4", 8}, + {"rx_packet_tc_in_cnt_5", 8}, + {"rx_packet_tc_in_cnt_6", 8}, + {"rx_packet_tc_in_cnt_7", 8}, + {"rx_packet_tc_out_cnt_0", 8}, + {"rx_packet_tc_out_cnt_1", 8}, + {"rx_packet_tc_out_cnt_2", 8}, + {"rx_packet_tc_out_cnt_3", 8}, + {"rx_packet_tc_out_cnt_4", 8}, + {"rx_packet_tc_out_cnt_5", 8}, + {"rx_packet_tc_out_cnt_6", 8}, + {"rx_packet_tc_out_cnt_7", 8}, + {"tx_packet_tc_in_cnt_0", 8}, + {"tx_packet_tc_in_cnt_1", 8}, + {"tx_packet_tc_in_cnt_2", 8}, + {"tx_packet_tc_in_cnt_3", 8}, + {"tx_packet_tc_in_cnt_4", 8}, + {"tx_packet_tc_in_cnt_5", 8}, + {"tx_packet_tc_in_cnt_6", 8}, + {"tx_packet_tc_in_cnt_7", 8}, + {"tx_packet_tc_out_cnt_0", 8}, + {"tx_packet_tc_out_cnt_1", 8}, + {"tx_packet_tc_out_cnt_2", 8}, + {"tx_packet_tc_out_cnt_3", 8}, + {"tx_packet_tc_out_cnt_4", 8}, + {"tx_packet_tc_out_cnt_5", 8}, + {"tx_packet_tc_out_cnt_6", 8}, + {"tx_packet_tc_out_cnt_7", 8}, + {HNS3_REG_RSV_NAME, 8}, +}; + +const struct hns3_reg_info dfx_igu_egu_regs[] = { + {"prt_id", 4}, + {"igu_rx_err_pkt", 4}, + {"igu_rx_no_sof_pkt", 4}, + {"egu_tx_1588_short_pkt", 4}, + {"egu_tx_1588_pkt", 4}, + {"egu_tx_err_pkt", 4}, + {"igu_rx_out_l2_pkt", 4}, + {"igu_rx_out_l3_pkt", 4}, + {"igu_rx_out_l4_pkt", 4}, + {"igu_rx_in_l2_pkt", 4}, + {"igu_rx_in_l3_pkt", 4}, + {"igu_rx_in_l4_pkt", 4}, + {"igu_rx_el3e_pkt", 4}, + {"igu_rx_el4e_pkt", 4}, + {"igu_rx_l3e_pkt", 4}, + {"igu_rx_l4e_pkt", 4}, + {"igu_rx_rocee_pkt", 4}, + {"igu_rx_out_udp0_pkt", 4}, + {"igu_rx_in_udp0_pkt", 4}, + {"mul_car_drop_pkt_cnt", 8}, + {"bro_car_drop_pkt_cnt", 8}, + {HNS3_REG_RSV_NAME, 4}, + {"igu_rx_oversize_pkt", 8}, + {"igu_rx_undersize_pkt", 8}, + {"igu_rx_out_all_pkt", 8}, + {"igu_tx_out_all_pkt", 8}, + {"igu_rx_uni_pkt", 8}, + {"igu_rx_multi_pkt", 8}, + {"igu_rx_broad_pkt", 8}, + {"egu_tx_out_all_pkt", 8}, + {"egu_tx_uni_pkt", 8}, + {"egu_tx_multi_pkt", 8}, + {"egu_tx_broad_pkt", 8}, + {"igu_tx_key_num", 8}, + {"igu_rx_non_tun_pkt", 8}, + {"igu_rx_tun_pkt", 8}, + {HNS3_REG_RSV_NAME, 8}, +}; + +const struct hns3_reg_info dfx_rpu_0_regs[] = { + {HNS3_REG_RSV_NAME, 4}, + {"fsm_dfx_st0", 4}, + {"fsm_dfx_st1", 4}, + {"rpu_rx_pkt_drop_cnt", 4}, + {"buf_wait_timeout", 4}, + {"buf_wait_timeout_qid", 4}, +}; + +const struct hns3_reg_info dfx_rpu_1_regs[] = { + {HNS3_REG_RSV_NAME, 4}, + {"fifo_dfx_st0", 4}, + {"fifo_dfx_st1", 4}, + {"fifo_dfx_st2", 4}, + {"fifo_dfx_st3", 4}, + {"fifo_dfx_st4", 4}, + {"fifo_dfx_st5", 4}, + {HNS3_REG_RSV_NAME, 20}, +}; + +const struct hns3_reg_info dfx_ncsi_regs[] = { + {HNS3_REG_RSV_NAME, 4}, + {"ncsi_egu_tx_fifo_sts", 4}, + {"ncsi_pause_status", 4}, + {"ncsi_rx_ctrl_dmac_err_cnt", 4}, + {"ncsi_rx_ctrl_smac_err_cnt", 4}, + {"ncsi_rx_ctrl_cks_err_cnt", 4}, + {"ncsi_rx_ctrl_pkt_cnt", 4}, + {"ncsi_rx_pt_dmac_err_cnt", 4}, + {"ncsi_rx_pt_smac_err_cnt", 4}, + {"ncsi_rx_pt_pkt_cnt", 4}, + {"ncsi_rx_fcs_err_cnt", 4}, + {"ncsi_tx_ctrl_dmac_err_cnt", 4}, + {"ncsi_tx_ctrl_smac_err_cnt", 4}, + {"ncsi_tx_ctrl_pkt_cnt", 4}, + {"ncsi_tx_pt_dmac_err_cnt", 4}, + {"ncsi_tx_pt_smac_err_cnt", 4}, + {"ncsi_tx_pt_pkt_cnt", 4}, + {"ncsi_tx_pt_pkt_trun_cnt", 4}, + {"ncsi_tx_pt_pkt_err_cnt", 4}, + {"ncsi_tx_ctrl_pkt_err_cnt", 4}, + {"ncsi_rx_ctrl_pkt_trun_cnt", 4}, + {"ncsi_rx_ctrl_pkt_cflit_cnt", 4}, + {HNS3_REG_RSV_NAME, 8}, + {"ncsi_mac_rx_octets_ok", 4}, + {"ncsi_mac_rx_octets_bad", 4}, + {"ncsi_mac_rx_uc_pkts", 4}, + {"ncsi_mac_rx_mc_pkts", 4}, + {"ncsi_mac_rx_bc_pkts", 4}, + {"ncsi_mac_rx_pkts_64octets", 4}, + {"ncsi_mac_rx_pkts_65to127octets", 4}, + {"ncsi_mac_rx_pkts_128to255octets", 4}, + {"ncsi_mac_rx_pkts_256to511octets", 4}, + {"ncsi_mac_rx_pkts_512to1023octets", 4}, + {"ncsi_mac_rx_pkts_1024to1518octets", 4}, + {"ncsi_mac_rx_pkts_1519tomaxoctets", 4}, + {"ncsi_mac_rx_fcs_errors", 4}, + {"ncsi_mac_rx_long_errors", 4}, + {"ncsi_mac_rx_jabber_errors", 4}, + {"ncsi_mac_rx_runt_err_cnt", 4}, + {"ncsi_mac_rx_short_err_cnt", 4}, + {"ncsi_mac_rx_filt_pkt_cnt", 4}, + {"ncsi_mac_rx_octets_total_filt", 4}, + {"ncsi_mac_tx_octets_ok", 4}, + {"ncsi_mac_tx_octets_bad", 4}, + {"ncsi_mac_tx_uc_pkts", 4}, + {"ncsi_mac_tx_mc_pkts", 4}, + {"ncsi_mac_tx_bc_pkts", 4}, + {"ncsi_mac_tx_pkts_64octets", 4}, + {"ncsi_mac_tx_pkts_65to127octets", 4}, + {"ncsi_mac_tx_pkts_128to255octets", 4}, + {"ncsi_mac_tx_pkts_256to511octets", 4}, + {"ncsi_mac_tx_pkts_512to1023octets", 4}, + {"ncsi_mac_tx_pkts_1024to1518octets", 4}, + {"ncsi_mac_tx_pkts_1519tomaxoctets", 4}, + {"ncsi_mac_tx_underrun", 4}, + {"ncsi_mac_tx_crc_error", 4}, + {"ncsi_mac_tx_pause_frames", 4}, + {"ncsi_mac_rx_pad_pkts", 4}, + {"ncsi_mac_rx_pause_frames", 4}, +}; + +const struct hns3_reg_info dfx_rtc_regs[] = { + {HNS3_REG_RSV_NAME, 4}, + {"lge_igu_afifo_dfx_0", 4}, + {"lge_igu_afifo_dfx_1", 4}, + {"lge_igu_afifo_dfx_2", 4}, + {"lge_igu_afifo_dfx_3", 4}, + {"lge_igu_afifo_dfx_4", 4}, + {"lge_igu_afifo_dfx_5", 4}, + {"lge_igu_afifo_dfx_6", 4}, + {"lge_igu_afifo_dfx_7", 4}, + {"lge_egu_afifo_dfx_0", 4}, + {"lge_egu_afifo_dfx_1", 4}, + {"lge_egu_afifo_dfx_2", 4}, + {"lge_egu_afifo_dfx_3", 4}, + {"lge_egu_afifo_dfx_4", 4}, + {"lge_egu_afifo_dfx_5", 4}, + {"lge_egu_afifo_dfx_6", 4}, + {"lge_egu_afifo_dfx_7", 4}, + {"cge_igu_afifo_dfx_0", 4}, + {"cge_igu_afifo_dfx_1", 4}, + {"cge_egu_afifo_dfx_0", 4}, + {"cge_egu_afifo_dfx_1", 4}, + {HNS3_REG_RSV_NAME, 12}, +}; + +const struct hns3_reg_info dfx_ppp_regs[] = { + {HNS3_REG_RSV_NAME, 4}, + {"drop_from_prt_pkt_cnt", 4}, + {"drop_from_host_pkt_cnt", 4}, + {"drop_tx_vlan_proc_cnt", 4}, + {"drop_mng_cnt", 4}, + {"drop_fd_cnt", 4}, + {"drop_no_dst_cnt", 4}, + {"drop_mc_mbid_full_cnt", 4}, + {"drop_sc_filtered", 4}, + {"ppp_mc_drop_pkt_cnt", 4}, + {"drop_pt_cnt", 4}, + {"drop_mac_anti_spoof_cnt", 4}, + {"drop_ig_vfv_cnt", 4}, + {"drop_ig_prtv_cnt", 4}, + {"drop_cnm_pfc_pause_cnt", 4}, + {"drop_torus_tc_cnt", 4}, + {"drop_torus_lpbk_cnt", 4}, + {"ppp_hfs_sts", 4}, + {"ppp_mc_rslt_sts", 4}, + {"ppp_p3u_sts", 4}, + {HNS3_REG_RSV_NAME, 4}, + {"ppp_umv_sts_0", 4}, + {"ppp_umv_sts_1", 4}, + {"ppp_vfv_sts", 4}, + {"ppp_gro_key_cnt", 4}, + {"ppp_gro_info_cnt", 4}, + {"ppp_gro_drop_cnt", 4}, + {"ppp_gro_out_cnt", 4}, + {"ppp_gro_key_match_data_cnt", 4}, + {"ppp_gro_key_match_tcam_cnt", 4}, + {"ppp_gro_info_match_cnt", 4}, + {"ppp_gro_free_entry_cnt", 4}, + {"ppp_gro_inner_dfx_signal", 4}, + {HNS3_REG_RSV_NAME, 12}, + {"get_rx_pkt_cnt", 8}, + {"get_tx_pkt_cnt", 8}, + {"send_uc_prt2host_pkt_cnt", 8}, + {"send_uc_prt2prt_pkt_cnt", 8}, + {"send_uc_host2host_pkt_cnt", 8}, + {"send_uc_host2prt_pkt_cnt", 8}, + {"send_mc_from_prt_cnt", 8}, + {"send_mc_from_host_cnt", 8}, + {"ssu_mc_rd_cnt", 8}, + {"ssu_mc_drop_cnt", 8}, + {"ssu_mc_rd_pkt_cnt", 8}, + {"ppp_mc_2host_pkt_cnt", 8}, + {"ppp_mc_2prt_pkt_cnt", 8}, + {"ntsnos_pkt_cnt", 8}, + {"ntup_pkt_cnt", 8}, + {"ntlcl_pkt_cnt", 8}, + {"nttgt_pkt_cnt", 8}, + {"rtns_pkt_cnt", 8}, + {"rtlpbk_pkt_cnt", 8}, + {"nr_pkt_cnt", 8}, + {"rr_pkt_cnt", 8}, + {"mng_tbl_hit_cnt", 8}, + {"fd_tbl_hit_cnt", 8}, + {"fd_lkup_cnt", 8}, + {"bc_hit_cnt", 8}, + {"um_tbl_uc_hit_cnt", 8}, + {"um_tbl_mc_hit_cnt", 8}, + {"um_tbl_snq_hit_cnt", 8}, + {HNS3_REG_RSV_NAME, 8}, + {"fwd_bonding_hit_cnt", 8}, + {"promis_tbl_hit_cnt", 8}, + {"get_tunl_pkt_cnt", 8}, + {"get_bmc_pkt_cnt", 8}, + {"send_uc_prt2bmc_pkt_cnt", 8}, + {"send_uc_host2bmc_pkt_cnt", 8}, + {"send_uc_bmc2host_pkt_cnt", 8}, + {"send_uc_bmc2prt_pkt_cnt", 8}, + {"ppp_mc_2bmc_pkt_cnt", 8}, + {HNS3_REG_RSV_NAME, 24}, + {"rx_default_host_hit_cnt", 8}, + {"lan_pair_cnt", 8}, + {"um_tbl_mc_hit_pkt_cnt", 8}, + {"mta_tbl_hit_pkt_cnt", 8}, + {"promis_tbl_hit_pkt_cnt", 8}, + {HNS3_REG_RSV_NAME, 16}, +}; + +const struct hns3_reg_info dfx_rcb_regs[] = { + {HNS3_REG_RSV_NAME, 4}, + {"fsm_dfx_st0", 4}, + {"fsm_dfx_st1", 4}, + {"fsm_dfx_st2", 4}, + {"fifo_dfx_st0", 4}, + {"fifo_dfx_st1", 4}, + {"fifo_dfx_st2", 4}, + {"fifo_dfx_st3", 4}, + {"fifo_dfx_st4", 4}, + {"fifo_dfx_st5", 4}, + {"fifo_dfx_st6", 4}, + {"fifo_dfx_st7", 4}, + {"fifo_dfx_st8", 4}, + {"fifo_dfx_st9", 4}, + {"fifo_dfx_st10", 4}, + {"fifo_dfx_st11", 4}, + {"q_credit_vld_0", 4}, + {"q_credit_vld_1", 4}, + {"q_credit_vld_2", 4}, + {"q_credit_vld_3", 4}, + {"q_credit_vld_4", 4}, + {"q_credit_vld_5", 4}, + {"q_credit_vld_6", 4}, + {"q_credit_vld_7", 4}, + {"q_credit_vld_8", 4}, + {"q_credit_vld_9", 4}, + {"q_credit_vld_10", 4}, + {"q_credit_vld_11", 4}, + {"q_credit_vld_12", 4}, + {"q_credit_vld_13", 4}, + {"q_credit_vld_14", 4}, + {"q_credit_vld_15", 4}, + {"q_credit_vld_16", 4}, + {"q_credit_vld_17", 4}, + {"q_credit_vld_18", 4}, + {"q_credit_vld_19", 4}, + {"q_credit_vld_20", 4}, + {"q_credit_vld_21", 4}, + {"q_credit_vld_22", 4}, + {"q_credit_vld_23", 4}, + {"q_credit_vld_24", 4}, + {"q_credit_vld_25", 4}, + {"q_credit_vld_26", 4}, + {"q_credit_vld_27", 4}, + {"q_credit_vld_28", 4}, + {"q_credit_vld_29", 4}, + {"q_credit_vld_30", 4}, + {"q_credit_vld_31", 4}, + {"gro_bd_serr_cnt", 4}, + {"gro_context_serr_cnt", 4}, + {"rx_stash_cfg_serr_cnt", 4}, + {"rcb_tx_mem_serr_cnt", 4}, + {"gro_bd_merr_cnt", 4}, + {"gro_context_merr_cnt", 4}, + {"rx_stash_cfg_merr_cnt", 4}, + {"rcb_tx_mem_merr_cnt", 4}, + {HNS3_REG_RSV_NAME, 16}, +}; + +const struct hns3_reg_info dfx_tqp_regs[] = { + {"q_num", 4}, + {"rcb_cfg_rx_ring_tail", 4}, + {"rcb_cfg_rx_ring_head", 4}, + {"rcb_cfg_rx_ring_fbdnum", 4}, + {"rcb_cfg_rx_ring_offset", 4}, + {"rcb_cfg_rx_ring_fbdoffset", 4}, + {"rcb_cfg_rx_ring_pktnum_record", 4}, + {"rcb_cfg_tx_ring_tail", 4}, + {"rcb_cfg_tx_ring_head", 4}, + {"rcb_cfg_tx_ring_fbdnum", 4}, + {"rcb_cfg_tx_ring_offset", 4}, + {"rcb_cfg_tx_ring_ebdnum", 4}, +}; + +const struct hns3_reg_info dfx_ssu_2_regs[] = { + {"oq_index", 4}, + {"queue_cnt", 4}, + {HNS3_REG_RSV_NAME, 16}, +}; + +const struct hns3_reg_info vf_cmdq_regs[] = { + {"comm_nic_csq_baseaddr_l", 4}, + {"comm_nic_csq_baseaddr_h", 4}, + {"comm_nic_csq_depth", 4}, + {"comm_nic_csq_tail", 4}, + {"comm_nic_csq_head", 4}, + {"comm_nic_crq_baseaddr_l", 4}, + {"comm_nic_crq_baseaddr_h", 4}, + {"comm_nic_crq_depth", 4}, + {"comm_nic_crq_tail", 4}, + {"comm_nic_crq_head", 4}, + {"comm_vector0_cmdq_src", 4}, + {"comm_vector0_cmdq_state", 4}, + {"comm_cmdq_intr_en", 4}, + {"comm_cmdq_intr_gen", 4}, +}; + +const struct hns3_reg_info vf_common_regs[] = { + {"misc_vector_base", 4}, + {"rst_ing", 4}, + {"gro_en", 4}, +}; + +const struct hns3_reg_info vf_ring_regs[] = { + {"ring_rx_addr_l", 4}, + {"ring_rx_addr_h", 4}, + {"ring_rx_bd_num", 4}, + {"ring_rx_bd_length", 4}, + {"ring_rx_merge_en", 4}, + {"ring_rx_tail", 4}, + {"ring_rx_head", 4}, + {"ring_rx_fbd_num", 4}, + {"ring_rx_offset", 4}, + {"ring_rx_fbd_offset", 4}, + {"ring_rx_stash", 4}, + {"ring_rx_bd_err", 4}, + {"ring_tx_addr_l", 4}, + {"ring_tx_addr_h", 4}, + {"ring_tx_bd_num", 4}, + {"ring_tx_priority", 4}, + {"ring_tx_tc", 4}, + {"ring_tx_merge_en", 4}, + {"ring_tx_tail", 4}, + {"ring_tx_head", 4}, + {"ring_tx_fbd_num", 4}, + {"ring_tx_offset", 4}, + {"ring_tx_ebd_num", 4}, + {"ring_tx_ebd_offset", 4}, + {"ring_tx_bd_err", 4}, + {"ring_en", 4}, +}; + +const struct hns3_reg_info vf_tqp_intr_regs[] = { + {"tqp_intr_ctrl", 4}, + {"tqp_intr_gl0", 4}, + {"tqp_intr_gl1", 4}, + {"tqp_intr_gl2", 4}, + {"tqp_intr_rl", 4}, +}; + +const struct hns3_regs_group pf_regs_groups[] = { + [HNS3_TAG_CMDQ] = {"cmdq_regs", pf_cmdq_regs, ARRAY_SIZE(pf_cmdq_regs)}, + [HNS3_TAG_COMMON] = {"common_regs", pf_common_regs, + ARRAY_SIZE(pf_common_regs)}, + [HNS3_TAG_RING] = {"ring_regs", pf_ring_regs, ARRAY_SIZE(pf_ring_regs)}, + [HNS3_TAG_TQP_INTR] = {"tqp_intr_regs", pf_tqp_intr_regs, + ARRAY_SIZE(pf_tqp_intr_regs)}, + [HNS3_TAG_QUERY_32_BIT] = {"dfx_32_regs", query_32_bit_regs, + ARRAY_SIZE(query_32_bit_regs)}, + [HNS3_TAG_QUERY_64_BIT] = {"dfx_64_regs", query_64_bit_regs, + ARRAY_SIZE(query_64_bit_regs)}, + [HNS3_TAG_DFX_BIOS_COMMON] = {"dfx_bios_common_regs", + dfx_bios_common_regs, + ARRAY_SIZE(dfx_bios_common_regs)}, + [HNS3_TAG_DFX_SSU_0] = {"dfx_ssu_0_regs", dfx_ssu_0_regs, + ARRAY_SIZE(dfx_ssu_0_regs)}, + [HNS3_TAG_DFX_SSU_1] = {"dfx_ssu_1_regs", dfx_ssu_1_regs, + ARRAY_SIZE(dfx_ssu_1_regs)}, + [HNS3_TAG_DFX_IGU_EGU] = {"dfx_igu_egu_regs", dfx_igu_egu_regs, + ARRAY_SIZE(dfx_igu_egu_regs)}, + [HNS3_TAG_DFX_RPU_0] = {"dfx_rpu_0_regs", dfx_rpu_0_regs, + ARRAY_SIZE(dfx_rpu_0_regs)}, + [HNS3_TAG_DFX_RPU_1] = {"dfx_rpu_1_regs", dfx_rpu_1_regs, + ARRAY_SIZE(dfx_rpu_1_regs)}, + [HNS3_TAG_DFX_NCSI] = {"dfx_ncsi_regs", dfx_ncsi_regs, + ARRAY_SIZE(dfx_ncsi_regs)}, + [HNS3_TAG_DFX_RTC] = {"dfx_rtc_regs", dfx_rtc_regs, + ARRAY_SIZE(dfx_rtc_regs)}, + [HNS3_TAG_DFX_PPP] = {"dfx_ppp_regs", dfx_ppp_regs, + ARRAY_SIZE(dfx_ppp_regs)}, + [HNS3_TAG_DFX_RCB] = {"dfx_rcb_regs", dfx_rcb_regs, + ARRAY_SIZE(dfx_rcb_regs)}, + [HNS3_TAG_DFX_TQP] = {"dfx_tqp_regs", dfx_tqp_regs, + ARRAY_SIZE(dfx_tqp_regs)}, + [HNS3_TAG_DFX_SSU_2] = {"dfx_ssu_2_regs", dfx_ssu_2_regs, + ARRAY_SIZE(dfx_ssu_2_regs)}, + [HNS3_TAG_DFX_RPU_TNL] = {"dfx_rpu_tnl", dfx_rpu_0_regs, + ARRAY_SIZE(dfx_rpu_0_regs)}, +}; + +const struct hns3_regs_group vf_regs_groups[] = { + [HNS3_TAG_CMDQ] = {"cmdq_regs", vf_cmdq_regs, ARRAY_SIZE(vf_cmdq_regs)}, + [HNS3_TAG_COMMON] = {"common_regs", vf_common_regs, + ARRAY_SIZE(vf_common_regs)}, + [HNS3_TAG_RING] = {"ring_regs", vf_ring_regs, ARRAY_SIZE(vf_ring_regs)}, + [HNS3_TAG_TQP_INTR] = {"tqp_intr_regs", vf_tqp_intr_regs, + ARRAY_SIZE(vf_tqp_intr_regs)}, +}; + +static void hns3_dump_reg_hex(const char *regs_name, const u8 *regs_data, + u16 value_len, u32 name_max_len) +{ + if (strcmp(regs_name, HNS3_REG_RSV_NAME) == 0) + return; + + fprintf(stdout, " %-*s : ", name_max_len, regs_name); + if (value_len == 4) /* 4 bytes register */ + fprintf(stdout, "0x%08x\n", *(u32 *)regs_data); + if (value_len == 8) /* 8 bytes register */ + fprintf(stdout, "0x%016llx\n", *(u64 *)regs_data); +} + +static u32 hns3_get_group_regs_name_max_len(const struct hns3_regs_group *group) +{ + const struct hns3_reg_info *reg; + u32 max_len = 0; + u16 i; + + for (i = 0; i < group->regs_count; i++) { + reg = &group->regs[i]; + max_len = strlen(reg->name) > max_len ? + strlen(reg->name) : max_len; + } + + return max_len; +} + +static const char *hns3_get_group_name(const struct hns3_regs_group *group, + u32 tag) +{ + static u32 pre_tag = HNS3_TAG_MAX; + static char group_name[256]; + static u32 index; + + if (!hns3_reg_is_repeat_tag_array[tag]) + return group->group_name; + + if (tag != pre_tag) + index = 0; + + pre_tag = tag; + sprintf(group_name, "%s_%u", group->group_name, index++); + return group_name; +} + +static void hns3_dump_reg_group(const struct hns3_regs_group *group, u32 tag, + u32 expected_len, const u8 *regs_data) +{ + u32 name_max_len = hns3_get_group_regs_name_max_len(group); + const struct hns3_reg_info *reg; + u32 dump_offset = 0; + u16 i; + + fprintf(stdout, "[%s]\n", hns3_get_group_name(group, tag)); + for (i = 0; i < group->regs_count && dump_offset < expected_len; i++) { + reg = &group->regs[i]; + hns3_dump_reg_hex(reg->name, regs_data + dump_offset, + reg->value_len, name_max_len); + dump_offset += reg->value_len; + } + + /* the driver may add new register. + * In this case, the register name is unknown. + * The register can be parsed as unknown:value format. + */ + while (dump_offset < expected_len) { + hns3_dump_reg_hex(HNS3_REG_UNKNOW_NAME, regs_data + dump_offset, + HNS3_REG_UNKNOW_VALUE_LEN, name_max_len); + dump_offset += HNS3_REG_UNKNOW_VALUE_LEN; + } +} + +static void hns3_dump_as_groups(const struct hns3_regs_group *groups, + const u8 *regs_data, u32 regs_len) +{ + u32 tlv_size = sizeof(struct hns3_reg_tlv); + const struct hns3_reg_tlv *tlv; + u32 dump_offset = 0; + + while (dump_offset < regs_len) { + tlv = (const struct hns3_reg_tlv *)(regs_data + dump_offset); + hns3_dump_reg_group(&groups[tlv->tag], tlv->tag, + tlv->len - tlv_size, + regs_data + dump_offset + tlv_size); + dump_offset += tlv->len; + } +} + +static bool hns3_dump_validate(const u8 *regs_data, u32 regs_len) +{ + u32 tlv_size = sizeof(struct hns3_reg_tlv); + const struct hns3_reg_tlv *tlv; + u32 dump_offset = 0; + + while (dump_offset < regs_len) { + tlv = (const struct hns3_reg_tlv *)(regs_data + dump_offset); + + /* register value length is 4 bytes or 8 bytes */ + if ((tlv->len - tlv_size) % 4) + return false; + + if (tlv->tag >= HNS3_TAG_MAX) + return false; + + dump_offset += tlv->len; + } + + return dump_offset == regs_len; +} + +int hns3_dump_regs(struct ethtool_drvinfo *info __maybe_unused, + struct ethtool_regs *regs) +{ + const struct hns3_regs_group *groups = pf_regs_groups; + u32 header_len = sizeof(struct hns3_reg_header); + const struct hns3_reg_header *header; + + /* must contain header and register data */ + if (regs->len <= header_len) + return -ENODATA; + + header = (struct hns3_reg_header *)regs->data; + if (header->magic_number != HNS3_REG_MAGIC_NUMBER) + return -EOPNOTSUPP; + + if (!hns3_dump_validate(regs->data + header_len, + regs->len - header_len)) + return -EINVAL; + + if (header->is_vf) + groups = vf_regs_groups; + + hns3_dump_as_groups(groups, regs->data + header_len, + regs->len - header_len); + return 0; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ethtool-6.3/internal.h new/ethtool-6.5/internal.h --- old/ethtool-6.3/internal.h 2023-02-12 20:23:47.000000000 +0100 +++ new/ethtool-6.5/internal.h 2023-09-11 22:14:13.000000000 +0200 @@ -36,25 +36,12 @@ struct nl_context; #endif -/* ethtool.h expects these to be defined by <linux/types.h> */ -#ifndef HAVE_BE_TYPES -typedef uint16_t __be16; -typedef uint32_t __be32; -typedef unsigned long long __be64; -#endif - typedef unsigned long long u64; typedef uint32_t u32; typedef uint16_t u16; typedef uint8_t u8; typedef int32_t s32; -/* ethtool.h epxects __KERNEL_DIV_ROUND_UP to be defined by <linux/kernel.h> */ -#include <linux/kernel.h> -#ifndef __KERNEL_DIV_ROUND_UP -#define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) -#endif - #include <linux/ethtool.h> #include <linux/net_tstamp.h> @@ -373,6 +360,9 @@ /* VMware vmxnet3 ethernet controller */ int vmxnet3_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs); +/* hns3 ethernet controller */ +int hns3_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs); + /* Rx flow classification */ int rxclass_parse_ruleopts(struct cmd_context *ctx, struct ethtool_rx_flow_spec *fsp, __u32 *rss_context); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ethtool-6.3/m4/ax_append_flag.m4 new/ethtool-6.5/m4/ax_append_flag.m4 --- old/ethtool-6.3/m4/ax_append_flag.m4 1970-01-01 01:00:00.000000000 +0100 +++ new/ethtool-6.5/m4/ax_append_flag.m4 2023-06-05 00:50:37.000000000 +0200 @@ -0,0 +1,71 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_append_flag.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE]) +# +# DESCRIPTION +# +# FLAG is appended to the FLAGS-VARIABLE shell variable, with a space +# added in between. +# +# If FLAGS-VARIABLE is not specified, the current language's flags (e.g. +# CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains +# FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly +# FLAG. +# +# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. +# +# LICENSE +# +# Copyright (c) 2008 Guido U. Draheim <gui...@gmx.de> +# Copyright (c) 2011 Maarten Bosmans <mkbosm...@gmail.com> +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <https://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 7 + +AC_DEFUN([AX_APPEND_FLAG], +[dnl +AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF +AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])]) +AS_VAR_SET_IF(FLAGS,[ + AS_CASE([" AS_VAR_GET(FLAGS) "], + [*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])], + [ + AS_VAR_APPEND(FLAGS,[" $1"]) + AC_RUN_LOG([: FLAGS="$FLAGS"]) + ]) + ], + [ + AS_VAR_SET(FLAGS,[$1]) + AC_RUN_LOG([: FLAGS="$FLAGS"]) + ]) +AS_VAR_POPDEF([FLAGS])dnl +])dnl AX_APPEND_FLAG diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ethtool-6.3/m4/ax_check_compile_flag.m4 new/ethtool-6.5/m4/ax_check_compile_flag.m4 --- old/ethtool-6.3/m4/ax_check_compile_flag.m4 1970-01-01 01:00:00.000000000 +0100 +++ new/ethtool-6.5/m4/ax_check_compile_flag.m4 2023-06-05 00:50:37.000000000 +0200 @@ -0,0 +1,74 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) +# +# DESCRIPTION +# +# Check whether the given FLAG works with the current language's compiler +# or gives an error. (Warnings, however, are ignored) +# +# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on +# success/failure. +# +# If EXTRA-FLAGS is defined, it is added to the current language's default +# flags (e.g. CFLAGS) when the check is done. The check is thus made with +# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to +# force the compiler to issue an error when a bad flag is given. +# +# INPUT gives an alternative input source to AC_COMPILE_IFELSE. +# +# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this +# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. +# +# LICENSE +# +# Copyright (c) 2008 Guido U. Draheim <gui...@gmx.de> +# Copyright (c) 2011 Maarten Bosmans <mkbosm...@gmail.com> +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <https://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 5 + +AC_DEFUN([AX_CHECK_COMPILE_FLAG], +[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF +AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl +AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ + ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS + _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" + AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], + [AS_VAR_SET(CACHEVAR,[yes])], + [AS_VAR_SET(CACHEVAR,[no])]) + _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) +AS_VAR_IF(CACHEVAR,yes, + [m4_default([$2], :)], + [m4_default([$3], :)]) +AS_VAR_POPDEF([CACHEVAR])dnl +])dnl AX_CHECK_COMPILE_FLAGS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ethtool-6.3/netlink/desc-ethtool.c new/ethtool-6.5/netlink/desc-ethtool.c --- old/ethtool-6.3/netlink/desc-ethtool.c 2023-05-08 21:28:31.000000000 +0200 +++ new/ethtool-6.5/netlink/desc-ethtool.c 2023-05-10 08:20:56.000000000 +0200 @@ -159,6 +159,8 @@ NLATTR_DESC_U32(ETHTOOL_A_RINGS_CQE_SIZE), NLATTR_DESC_BOOL(ETHTOOL_A_RINGS_TX_PUSH), NLATTR_DESC_BOOL(ETHTOOL_A_RINGS_RX_PUSH), + NLATTR_DESC_U32(ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN), + NLATTR_DESC_U32(ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN_MAX), }; static const struct pretty_nla_desc __channels_desc[] = { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ethtool-6.3/netlink/rings.c new/ethtool-6.5/netlink/rings.c --- old/ethtool-6.3/netlink/rings.c 2023-05-08 21:28:31.000000000 +0200 +++ new/ethtool-6.5/netlink/rings.c 2023-05-10 08:20:56.000000000 +0200 @@ -44,22 +44,26 @@ print_string(PRINT_ANY, "ifname", "Ring parameters for %s:\n", nlctx->devname); print_string(PRINT_FP, NULL, "Pre-set maximums:\n", NULL); - show_u32("rx-max", "RX:\t\t", tb[ETHTOOL_A_RINGS_RX_MAX]); - show_u32("rx-mini-max", "RX Mini:\t", tb[ETHTOOL_A_RINGS_RX_MINI_MAX]); - show_u32("rx-jumbo-max", "RX Jumbo:\t", + show_u32("rx-max", "RX:\t\t\t", tb[ETHTOOL_A_RINGS_RX_MAX]); + show_u32("rx-mini-max", "RX Mini:\t\t", tb[ETHTOOL_A_RINGS_RX_MINI_MAX]); + show_u32("rx-jumbo-max", "RX Jumbo:\t\t", tb[ETHTOOL_A_RINGS_RX_JUMBO_MAX]); - show_u32("tx-max", "TX:\t\t", tb[ETHTOOL_A_RINGS_TX_MAX]); + show_u32("tx-max", "TX:\t\t\t", tb[ETHTOOL_A_RINGS_TX_MAX]); + show_u32("tx-push-buff-max-len", "TX push buff len:\t", + tb[ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN_MAX]); print_string(PRINT_FP, NULL, "Current hardware settings:\n", NULL); - show_u32("rx", "RX:\t\t", tb[ETHTOOL_A_RINGS_RX]); - show_u32("rx-mini", "RX Mini:\t", tb[ETHTOOL_A_RINGS_RX_MINI]); - show_u32("rx-jumbo", "RX Jumbo:\t", tb[ETHTOOL_A_RINGS_RX_JUMBO]); - show_u32("tx", "TX:\t\t", tb[ETHTOOL_A_RINGS_TX]); - show_u32("rx-buf-len", "RX Buf Len:\t", tb[ETHTOOL_A_RINGS_RX_BUF_LEN]); - show_u32("cqe-size", "CQE Size:\t", tb[ETHTOOL_A_RINGS_CQE_SIZE]); - show_bool("tx-push", "TX Push:\t%s\n", tb[ETHTOOL_A_RINGS_TX_PUSH]); - show_bool("rx-push", "RX Push:\t%s\n", tb[ETHTOOL_A_RINGS_RX_PUSH]); + show_u32("rx", "RX:\t\t\t", tb[ETHTOOL_A_RINGS_RX]); + show_u32("rx-mini", "RX Mini:\t\t", tb[ETHTOOL_A_RINGS_RX_MINI]); + show_u32("rx-jumbo", "RX Jumbo:\t\t", tb[ETHTOOL_A_RINGS_RX_JUMBO]); + show_u32("tx", "TX:\t\t\t", tb[ETHTOOL_A_RINGS_TX]); + show_u32("rx-buf-len", "RX Buf Len:\t\t", tb[ETHTOOL_A_RINGS_RX_BUF_LEN]); + show_u32("cqe-size", "CQE Size:\t\t", tb[ETHTOOL_A_RINGS_CQE_SIZE]); + show_bool("tx-push", "TX Push:\t\t%s\n", tb[ETHTOOL_A_RINGS_TX_PUSH]); + show_bool("rx-push", "RX Push:\t\t%s\n", tb[ETHTOOL_A_RINGS_RX_PUSH]); + show_u32("tx-push-buf-len", "TX push buff len:\t", + tb[ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN]); - tcp_hds_fmt = "TCP data split:\t%s\n"; + tcp_hds_fmt = "TCP data split:\t\t%s\n"; tcp_hds_key = "tcp-data-split"; tcp_hds = tb[ETHTOOL_A_RINGS_TCP_DATA_SPLIT] ? mnl_attr_get_u8(tb[ETHTOOL_A_RINGS_TCP_DATA_SPLIT]) : 0; @@ -137,6 +141,12 @@ .handler = nl_parse_direct_u32, .min_argc = 1, }, + { + .arg = "tx-push-buf-len", + .type = ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN, + .handler = nl_parse_direct_u32, + .min_argc = 1, + }, { .arg = "rx-buf-len", .type = ETHTOOL_A_RINGS_RX_BUF_LEN, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ethtool-6.3/netlink/settings.c new/ethtool-6.5/netlink/settings.c --- old/ethtool-6.3/netlink/settings.c 2023-05-08 00:44:42.000000000 +0200 +++ new/ethtool-6.5/netlink/settings.c 2023-08-28 01:13:04.000000000 +0200 @@ -1089,7 +1089,7 @@ .force_hex = true, }; -static const struct lookup_entry_u32 duplex_values[] = { +static const struct lookup_entry_u8 duplex_values[] = { { .arg = "half", .val = DUPLEX_HALF }, { .arg = "full", .val = DUPLEX_FULL }, {} @@ -1342,6 +1342,9 @@ nlctx->devname = ctx->devname; ret = nl_parser(nlctx, sset_params, NULL, PARSER_GROUP_MSG, msgbuffs); + if (ret == -EOPNOTSUPP) + return ret; + if (ret < 0) { ret = 1; goto out_free; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ethtool-6.3/qsfp.c new/ethtool-6.5/qsfp.c --- old/ethtool-6.3/qsfp.c 2022-12-08 13:20:15.000000000 +0100 +++ new/ethtool-6.5/qsfp.c 2023-06-14 20:46:26.000000000 +0200 @@ -872,6 +872,35 @@ } } +static void sff8636_show_signals(const struct sff8636_memory_map *map) +{ + unsigned int v; + + /* There appears to be no Rx LOS support bit, use Tx for both */ + if (map->page_00h[SFF8636_OPTION_4_OFFSET] & SFF8636_O4_TX_LOS) { + v = map->lower_memory[SFF8636_LOS_AW_OFFSET] & 0xf; + sff_show_lane_status("Rx loss of signal", 4, "Yes", "No", v); + v = map->lower_memory[SFF8636_LOS_AW_OFFSET] >> 4; + sff_show_lane_status("Tx loss of signal", 4, "Yes", "No", v); + } + + v = map->lower_memory[SFF8636_LOL_AW_OFFSET] & 0xf; + if (map->page_00h[SFF8636_OPTION_3_OFFSET] & SFF8636_O3_RX_LOL) + sff_show_lane_status("Rx loss of lock", 4, "Yes", "No", v); + + v = map->lower_memory[SFF8636_LOL_AW_OFFSET] >> 4; + if (map->page_00h[SFF8636_OPTION_3_OFFSET] & SFF8636_O3_TX_LOL) + sff_show_lane_status("Tx loss of lock", 4, "Yes", "No", v); + + v = map->lower_memory[SFF8636_FAULT_AW_OFFSET] & 0xf; + if (map->page_00h[SFF8636_OPTION_4_OFFSET] & SFF8636_O4_TX_FAULT) + sff_show_lane_status("Tx fault", 4, "Yes", "No", v); + + v = map->lower_memory[SFF8636_FAULT_AW_OFFSET] >> 4; + if (map->page_00h[SFF8636_OPTION_2_OFFSET] & SFF8636_O2_TX_EQ_AUTO) + sff_show_lane_status("Tx adaptive eq fault", 4, "Yes", "No", v); +} + static void sff8636_show_page_zero(const struct sff8636_memory_map *map) { sff8636_show_ext_identifier(map); @@ -905,6 +934,7 @@ SFF8636_DATE_VENDOR_LOT_OFFSET + 1, "Date code"); sff_show_revision_compliance(map->lower_memory, SFF8636_REV_COMPLIANCE_OFFSET); + sff8636_show_signals(map); } static void sff8636_show_all_common(const struct sff8636_memory_map *map) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ethtool-6.3/qsfp.h new/ethtool-6.5/qsfp.h --- old/ethtool-6.3/qsfp.h 2022-12-08 13:20:15.000000000 +0100 +++ new/ethtool-6.5/qsfp.h 2023-06-14 20:46:26.000000000 +0200 @@ -55,6 +55,8 @@ #define SFF8636_TX2_FAULT_AW (1 << 1) #define SFF8636_TX1_FAULT_AW (1 << 0) +#define SFF8636_LOL_AW_OFFSET 0x05 + /* Module Monitor Interrupt Flags - 6-8 */ #define SFF8636_TEMP_AW_OFFSET 0x06 #define SFF8636_TEMP_HALARM_STATUS (1 << 7) @@ -525,9 +527,15 @@ /* 56h-5Fh reserved */ #define SFF8636_OPTION_2_OFFSET 0xC1 +/* Tx input equalizers auto-adaptive */ +#define SFF8636_O2_TX_EQ_AUTO (1 << 3) /* Rx output amplitude */ #define SFF8636_O2_RX_OUTPUT_AMP (1 << 0) #define SFF8636_OPTION_3_OFFSET 0xC2 +/* Tx CDR Loss of Lock */ +#define SFF8636_O3_TX_LOL (1 << 5) +/* Rx CDR Loss of Lock */ +#define SFF8636_O3_RX_LOL (1 << 4) /* Rx Squelch Disable */ #define SFF8636_O3_RX_SQL_DSBL (1 << 3) /* Rx Output Disable capable */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ethtool-6.3/rxclass.c new/ethtool-6.5/rxclass.c --- old/ethtool-6.3/rxclass.c 2023-05-08 00:44:42.000000000 +0200 +++ new/ethtool-6.5/rxclass.c 2023-09-11 22:14:13.000000000 +0200 @@ -446,7 +446,7 @@ * If loc rolls over it should be greater than or equal to rmgr->size * and as such we know we have reached the end of the list. */ - if (!~(rmgr->slot[slot_num] | (~1UL << rmgr->size % BITS_PER_LONG))) { + if (!~(rmgr->slot[slot_num] | (~1UL << loc % BITS_PER_LONG))) { loc -= 1 + (loc % BITS_PER_LONG); slot_num--; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ethtool-6.3/sff-common.c new/ethtool-6.5/sff-common.c --- old/ethtool-6.3/sff-common.c 2022-12-08 13:20:15.000000000 +0100 +++ new/ethtool-6.5/sff-common.c 2023-06-14 20:46:26.000000000 +0200 @@ -53,6 +53,23 @@ printf("\n"); } +void sff_show_lane_status(const char *name, unsigned int lane_cnt, + const char *yes, const char *no, unsigned int value) +{ + printf("\t%-41s : ", name); + if (!value) { + printf("None\n"); + return; + } + + printf("["); + while (lane_cnt--) { + printf(" %s%c", value & 1 ? yes : no, lane_cnt ? ',': ' '); + value >>= 1; + } + printf("]\n"); +} + void sff8024_show_oui(const __u8 *id, int id_offset) { printf("\t%-41s : %02x:%02x:%02x\n", "Vendor OUI", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ethtool-6.3/sff-common.h new/ethtool-6.5/sff-common.h --- old/ethtool-6.3/sff-common.h 2022-12-08 13:20:15.000000000 +0100 +++ new/ethtool-6.5/sff-common.h 2023-06-14 20:46:26.000000000 +0200 @@ -198,6 +198,8 @@ const char *unit); void sff_show_ascii(const __u8 *id, unsigned int first_reg, unsigned int last_reg, const char *name); +void sff_show_lane_status(const char *name, unsigned int lane_cnt, + const char *yes, const char *no, unsigned int value); void sff_show_thresholds(struct sff_diags sd); void sff8024_show_oui(const __u8 *id, int id_offset); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ethtool-6.3/uapi/linux/ethtool_netlink.h new/ethtool-6.5/uapi/linux/ethtool_netlink.h --- old/ethtool-6.3/uapi/linux/ethtool_netlink.h 2023-05-08 21:28:31.000000000 +0200 +++ new/ethtool-6.5/uapi/linux/ethtool_netlink.h 2023-09-12 22:20:52.000000000 +0200 @@ -357,6 +357,8 @@ ETHTOOL_A_RINGS_CQE_SIZE, /* u32 */ ETHTOOL_A_RINGS_TX_PUSH, /* u8 */ ETHTOOL_A_RINGS_RX_PUSH, /* u8 */ + ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN, /* u32 */ + ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN_MAX, /* u32 */ /* add new constants above here */ __ETHTOOL_A_RINGS_CNT, @@ -781,7 +783,7 @@ /* add new constants above here */ __ETHTOOL_A_STATS_GRP_CNT, - ETHTOOL_A_STATS_GRP_MAX = (__ETHTOOL_A_STATS_CNT - 1) + ETHTOOL_A_STATS_GRP_MAX = (__ETHTOOL_A_STATS_GRP_CNT - 1) }; enum { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/ethtool-6.3/uapi/linux/if_link.h new/ethtool-6.5/uapi/linux/if_link.h --- old/ethtool-6.3/uapi/linux/if_link.h 2023-05-08 21:28:31.000000000 +0200 +++ new/ethtool-6.5/uapi/linux/if_link.h 2023-09-12 22:20:52.000000000 +0200 @@ -567,6 +567,7 @@ IFLA_BRPORT_MAB, IFLA_BRPORT_MCAST_N_GROUPS, IFLA_BRPORT_MCAST_MAX_GROUPS, + IFLA_BRPORT_NEIGH_VLAN_SUPPRESS, __IFLA_BRPORT_MAX }; #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1) @@ -633,6 +634,7 @@ IFLA_MACVLAN_MACADDR_COUNT, IFLA_MACVLAN_BC_QUEUE_LEN, IFLA_MACVLAN_BC_QUEUE_LEN_USED, + IFLA_MACVLAN_BC_CUTOFF, __IFLA_MACVLAN_MAX, }; @@ -824,6 +826,7 @@ IFLA_VXLAN_TTL_INHERIT, IFLA_VXLAN_DF, IFLA_VXLAN_VNIFILTER, /* only applicable with COLLECT_METADATA mode */ + IFLA_VXLAN_LOCALBYPASS, __IFLA_VXLAN_MAX }; #define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)