aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
3 daysethtool.8: document all debugging flagsupstream-masterMichal Kubecek
Only the 0x01 flag (DEBUG_PARSE) for --debug is documented in the man page. Document all debugging flags, including those which only work with netlink interface. Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
4 daysMerge branch 'next' into masterMichal Kubecek
- preserve uapi/
4 daysupdate UAPI header copiesMichal Kubecek
Update to kernel v6.9. Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
2024-04-17Merge branch 'master' into nextMichal Kubecek
2024-04-17netlink: fix typo in coalesce_reply_cb()gaoxingwang
Add missing colon in coalesce_reply_cb() Fixes: ec573f209dfd (netlink: settings: add netlink support for coalesce tx aggr params) Signed-off-by: Gao Xingwang <gaoxingwang1@huawei.com> Reviewed-by: Heng Qi <hengqi@linux.alibaba.com>
2024-04-17ethtool: add support for RSS input transformationAhmed Zaki
Add support for RSS input transformation [1]. Currently, only symmetric-xor is supported. The user can set the RSS input transformation via: # ethtool -X <dev> xfrm symmetric-xor and sets it off (default) by: # ethtool -X <dev> xfrm none The status of the transformation is reported by a new section at the end of "ethtool -x": # ethtool -x <dev> . . . . RSS hash function: toeplitz: on xor: off crc32: off RSS input transformation: symmetric-xor: on Link: https://lore.kernel.org/netdev/20231213003321.605376-1-ahmed.zaki@intel.com/ Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com> Signed-off-by: Ahmed Zaki <ahmed.zaki@intel.com> Acked-by: Jakub Kicinski <kuba@kernel.org>
2024-04-17ethtool: add support for rx-flow-hash gtpTakeru Hayasaka
GTP Flow hash was added to the ice driver. By executing "ethtool -N <dev> rx-flow-hash gtpu4t sde", RSS can include not only the IP's src/dst but also the TEID of GTP packets. Additionally, options <e> have been support. These allow specification to include TEID in the hash computation. Signed-off-by: Takeru Hayasaka <hayatake396@gmail.com>
2024-04-17update UAPI header copiesMichal Kubecek
Update to kernel commit 2bd99aef1b19. Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
2024-01-29update UAPI header copiesMichal Kubecek
Update to kernel v6.8-rc2. Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
2024-01-29Release version 6.7.Michal Kubecek
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
2024-01-28changelog: fix 6.6 release entry dateMichal Kubecek
Drop the extra comma. Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
2024-01-28update UAPI header copiesMichal Kubecek
Update to kernel v6.7. Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
2024-01-28ethtool: add support for setting TCP data splitAlexander Lobakin
Add support for controlling header split (aka TCP data split) feature, backed by kernel commit 50d73710715d ("ethtool: add SET for TCP_DATA_SPLIT ringparam"). Command format: ethtool -G|--set-ring devname tcp-data-split [ auto|on|off ] "auto" is defined solely by device's driver. Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
2024-01-28net: ethtool: Add default branch to sff8636_show_all_ioctl switchHao Lan
The current sff8636_show_all_ioctl code uses a switch statement to determine the module type, and exits directly with a return statement when a match is found. However, when the module type cannot be matched, the sff8636_memory_map_init_buf and sff8636_show_all_common functions are executed. This writing style is not intuitive enough. Therefore, this patch adding a default branch in the switch statement to improve the readability of the code. Signed-off-by: Hao Lan <lanhao@huawei.com> Signed-off-by: Jijie Shao <shaojijie@huawei.com>
2024-01-28ethtool: Fix SFF-8472 transceiver module identificationIdo Schimmel
According to table 5-1 in SFF-8472 Rev. 12.4, the Identifier Values for "GBIC" (01h) and "Module soldered to motherboard (ex: SFF)" (02h) are supported by the specification in addition to the current one. Therefore, adjust ethtool to invoke the SFF-8079 parser for them, which will in turn invoke the SFF-8472 parser if the transceiver module supports digital diagnostic monitoring. Without this patch, the EEPROM contents of such transceiver modules will be hex dumped instead of being parsed and printed in a human readable format. Fixes: 25b64c66f58d ("ethtool: Add netlink handler for getmodule (-m)") Reported-by: Ivar Simensen <is@datarespons.no> Closes: https://lore.kernel.org/netdev/AM0PR03MB5938EE1722EF2C75112B86F5B9B9A@AM0PR03MB5938.eurprd03.prod.outlook.com/ Tested-by: Ivar Simensen <is@datarespons.no> Signed-off-by: Ido Schimmel <idosch@nvidia.com>
2024-01-28netlink: fix -Walloc-sizeSam James
GCC 14 introduces a new -Walloc-size included in -Wextra which gives: ``` netlink/strset.c: In function ‘get_perdev_by_ifindex’: netlink/strset.c:121:16: warning: allocation of insufficient size ‘1’ for type ‘struct perdev_strings’ with size ‘648’ [-Walloc-size] 121 | perdev = calloc(sizeof(*perdev), 1); | ^ ``` The calloc prototype is: ``` void *calloc(size_t nmemb, size_t size); ``` So, just swap the number of members and size arguments to match the prototype, as we're initialising 1 struct of size `sizeof(*perdev)`. GCC then sees we're not doing anything wrong. This is consistent with other use in the codebase too. Signed-off-by: Sam James <sam@gentoo.org> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
2023-11-23update UAPI header copiesMichal Kubecek
Update to kernel v6.7-rc2. Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
2023-11-23Release version 6.6.Michal Kubecek
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
2023-11-23ethtool: Add support for more CMIS transceiver modulesIdo Schimmel
Add three more SFF-8024 Identifier Values that according to the standard support the Common Management Interface Specification (CMIS) memory map so that ethtool will be able to dump, parse and print their EEPROM contents. Reported-by: Mark Wang <markwang@nvidia.com> Tested-by: Mark Wang <markwang@nvidia.com> Signed-off-by: Ido Schimmel <idosch@nvidia.com>
2023-11-23Add missing header files for source distributionFlorian Fainelli
We were not listing all of the uapi header files in ethtool_SOURCES which prevented the proper construction of a distribution source tarball. This is noticeable with older kernel headers where the build would be breaking in such a way: /storage/buildroot/output/arm64/host/bin/aarch64-linux-gcc -DHAVE_CONFIG_H -I. -I./uapi -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -Wextra -D_POSIX_C_SOURCE=200809L -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -D_FORTIFY_SOURCE=2 -std=gnu11 -c -o netlink/rings.o netlink/rings.c In file included from internal.h:45, from common.c:7: ./uapi/linux/ethtool.h:1507:19: warning: implicit declaration of function '__KERNEL_DIV_ROUND_UP' [-Wimplicit-function-declaration] __u32 queue_mask[__KERNEL_DIV_ROUND_UP(MAX_NUM_QUEUE, 32)]; ^~~~~~~~~~~~~~~~~~~~~ ./uapi/linux/ethtool.h:1507:8: error: variably modified 'queue_mask' at file scope __u32 queue_mask[__KERNEL_DIV_ROUND_UP(MAX_NUM_QUEUE, 32)]; ^~~~~~~~~~ make[3]: *** [Makefile:1410: common.o] Error 1 make[3]: *** Waiting for unfinished jobs.... Fixes: da2beb7afc25 ("update UAPI header copies") Reported-by: Markus Mayer <mmayer@broadcom.com> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
2023-09-12update UAPI header copiesMichal Kubecek
Update to kernel v6.6-rc1. Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
2023-09-12Release version 6.5.Michal Kubecek
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
2023-09-11rxclass: fix a bug in rmgr when searching for empty slotYinjun Zhang
When reverse searching the list in rmgr for a free location the last slot (first slot searched) in the list needs special care as it might not span the full word length. This is done by building a bit-mask covering the not-active parts of the last word and using that to judge if there is a free location in the last word or not. Once that is known searching in the last slot, or to skip it, can be done by the same algorithm as for the other slots in the list. There is a bug in creating the bit-mask for the non-active parts of the last slot where the 0-indexed nature of bit addressing is not taken into account when shifting. This leads to a one-off bug, fix it. Fixes: 8d63f72ccdcb ("Add RX packet classification interface") Signed-off-by: Yinjun Zhang <yinjun.zhang@corigine.com> Cc: Alexander Duyck <alexanderduyck@meta.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2023-09-11hns3: add support dump registers for hns3 driverJijie Shao
Add support pretty printer for the registers of hns3 driver. This printer supports PF and VF, and is compatible with hns3 drivers of earlier versions. Sample output: $ ethtool -d eth1 [cmdq_regs] comm_nic_csq_baseaddr_l : 0x48168000 comm_nic_csq_baseaddr_h : 0x00000000 comm_nic_csq_depth : 0x00000080 comm_nic_csq_tail : 0x00000050 comm_nic_csq_head : 0x00000050 comm_nic_crq_baseaddr_l : 0x48170000 comm_nic_crq_baseaddr_h : 0x00000000 comm_nic_crq_depth : 0x00000080 comm_nic_crq_tail : 0x00000000 comm_nic_crq_head : 0x00000000 comm_vector0_cmdq_src : 0x00000000 comm_cmdq_intr_sts : 0x00000000 comm_cmdq_intr_en : 0x00000002 comm_cmdq_intr_gen : 0x00000000 [common_regs] misc_vector_base : 0x00000001 pf_other_int : 0x00000040 misc_reset_sts : 0x00000000 misc_vector_int_sts : 0x00000000 global_reset : 0x00000000 fun_rst_ing : 0x00000000 gro_en : 0x00000001 ... Signed-off-by: Jijie Shao <shaojijie@huawei.com>
2023-08-28update UAPI header copiesMichal Kubecek
Update to kernel v6.5. Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
2023-08-28netlink: Allow nl_sset return -EOPNOTSUPP to fallback to do_ssetGang Li
Currently, nl_sset treats any negative value returned by nl_parser (including -EOPNOTSUPP) as `1`. Consequently, netlink_run_handler directly calls exit without returning to main and invoking do_sset through ioctl_init. To fallback to do_sset, this commit allows nl_sset return -EOPNOTSUPP. Fixes: 6c19c0d559c8 ("netlink: use genetlink ops information to decide about fallback") Signed-off-by: Gang Li <gang.li@linux.dev>
2023-07-01Release version 6.4.Michal Kubecek
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
2023-07-01update UAPI header copiesMichal Kubecek
Update to kernel v6.4. Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
2023-07-01netlink: fix duplex settingLadislav Michl
nl_parse_lookup_u8 handler is used with duplex_values defined as lookup_entry_u32. While it still works on little endian machines, duplex is always 0 (DUPLEX_HALF) on big endian ones... Fixes: 392b12e38747 ("netlink: add netlink handler for sset (-s)") Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
2023-06-14cmis: report LOL / LOS / Tx FaultJakub Kicinski
Report whether Loss of Lock, of Signal and Tx Faults were detected. Print "None" in case no lane has the problem, and per-lane "Yes" / "No" if at least one of the lanes reports true. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Tested-by: Ido Schimmel <idosch@nvidia.com>
2023-06-14sff-8636: report LOL / LOS / Tx FaultJakub Kicinski
Report whether Loss of Lock, of Signal and Tx Faults were detected. Print "None" in case no lane has the problem, and per-lane "Yes" / "No" if at least one of the lanes reports true. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Tested-by: Ido Schimmel <idosch@nvidia.com>
2023-06-05drop checks for macros provided in UAPI header copiesMichal Kubecek
Macros NETLINK_GENERIC and __KERNEL_DIV_ROUND_UP are now provided in UAPI header copies so that we no longer need to check if they are defined and provide fallback definitions. Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
2023-06-05do not check for strtol() functionMichal Kubecek
The C11 standard guarantees strtol() function to be provided. As we require C11 now, the autoconf check is no longer necessary. Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
2023-06-05actually check for C11 compilerMichal Kubecek
Recently added check for C11 compiler only defined macro AX_CHECK_STDC with the check but did not use it so that no check was actually performed. Fixes: 31b7b5ec7edd ("Require a compiler with support for C11 features") Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
2023-06-05add local copies of macros from autoconf-archiveMichal Kubecek
To allow building on systems with old or missing autoconf-archive package, add local copies of macros AX_CHECK_COMPILE_FLAG and AX_APPEND_FLAG. These are needed for AX_CHECK_STDC. Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
2023-05-31drop check for big endian typesMichal Kubecek
The build time check for definition of __be16 and __be32 types and their fallback definitions are no longer needed since we added a sanitized copy of linux/types.h which does provide these types (and __be64 which we also need). These were provided to fix build on older systems with outdated system <linux/types.h> Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
2023-05-31Require a compiler with support for C11 featuresDario Binacchi
Just like the kernel, which has been using -std=gnu11 for about a year, we also require a C11 compiler for ethtool. Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2023-05-10Merge branch 'next' into masterMichal Kubecek
2023-05-08Release version 6.3.Michal Kubecek
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
2023-05-08Fix argc and argp handling issuesNicholas Vinson
Fixes issues that were originally found using gcc's static analyzer. The flags used to invoke the analyzer are given below. Upon manual review of the results and discussion of the previous patch '[PATCH ethtool 3/3] Fix potential null-pointer deference issues.', it was determined that when using a kernel lacking the execve patch ( see https://github.com/gregkh/linux/commit/dcd46d897adb70d63e025f175a00a89797d31a43), it is possible for argc to be 0 and argp to be an array with only a single NULL entry. This scenario would cause ethtool to read beyond the bounds of the argp array. However, this scenario should not be possible for any Linux kernel released within the last two years should have the execve patch applied. CFLAGS=-march=native -O2 -pipe -fanalyzer \ -Werror=analyzer-va-arg-type-mismatch \ -Werror=analyzer-va-list-exhausted \ -Werror=analyzer-va-list-leak \ -Werror=analyzer-va-list-use-after-va-end CXXCFLAGS=-march=native -O2 \ -pipe -fanalyzer \ -Werror=analyzer-va-arg-type-mismatch \ -Werror=analyzer-va-list-exhausted \ -Werror=analyzer-va-list-leak \ -Werror=analyzer-va-list-use-after-va-end LDFLAGS="-Wl,-O1 -Wl,--as-needed" GCC version is gcc (Gentoo 13.1.0-r1 p1) 13.1.0 Additional Information: https://patchwork.kernel.org/project/netdevbpf/patch/20221208011122.2343363-8-jesse.brandeburg@intel.com/ Signed-off-by: Nicholas Vinson <nvinson234@gmail.com> Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
2023-05-08update UAPI header copiesMichal Kubecek
Update to kernel v6.4-rc1. Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
2023-05-08Merge branch 'review/next/tx-push-buf-len-v2' into nextMichal Kubecek
Shay Agroskin: This patchset adds a new sub-configuration to ethtool get/set queue params (ethtool -g) called 'tx-push-buf-len'. This configuration specifies the maximum number of bytes of a transmitted packet a driver can push directly to the underlying device ('push' mode). The motivation for pushing some of the bytes to the device has the advantages of - Allowing a smart device to take fast actions based on the packet's header - Reducing latency for small packets that can be copied completely into the device This new param is practically similar to tx-copybreak value that can be set using ethtool's tunable but conceptually serves a different purpose. While tx-copybreak is used to reduce the overhead of DMA mapping and makes no sense to use if less than the whole segment gets copied, tx-push-buf-len allows to improve performance by analyzing the packet's data (usually headers) before performing the DMA operation. The configuration can be queried and set using the commands: $ ethtool -g [interface] # ethtool -G [interface] tx-push-buf-len [number of bytes]
2023-05-08ethtool: Add support for configuring tx-push-buf-lenShay Agroskin
This attribute, which is part of ethtool's ring param configuration allows the user to specify the maximum number of the packet's payload that can be written directly to the device. Example usage: # ethtool -G [interface] tx-push-buf-len [number of bytes] Signed-off-by: Shay Agroskin <shayagr@amazon.com>
2023-05-08update UAPI header copiesShay Agroskin
Update to kernel commit 233eb4e786b5. Signed-off-by: Shay Agroskin <shayagr@amazon.com>
2023-05-08rxclass: Fix return code in rxclass_rule_insDavid Ahern
ethtool is not exiting non-0 when -N fails. e.g., $ sudo ethtool -N eth0 flow-type tcp4 src-ip 1.2.3.4 action 3 loc 1023 rmgr: Cannot insert RX class rule: No such device $ echo $? 0 Update rxclass_rule_ins to return err. Fixes: 8d63f72ccdcb ("Add RX packet classification interface") Cc: Alexander Duyck <alexanderduyck@fb.com> Signed-off-by: David Ahern <dsahern@kernel.org> Acked-by: Alexander Duyck <alexanderduyck@fb.com>
2023-05-08Merge tag 'review/fanalyze-fixes-p2'Michal Kubecek
Nicolas Vinton: This patch series provides updates to correct issues found by gcc -fanalyze. The issues were found by specifying the following flags when building: CFLAGS="-march=native -O2 -pipe -fanalyzer -Werror=analyzer-va-arg-type-mismatch -Werror=analyzer-va-list-exhausted -Werror=analyzer-va-list-leak -Werror=analyzer-va-list-use-after-va-end" CXXCFLAGS="-march=native -O2 -pipe -fanalyzer -Werror=analyzer-va-arg-type-mismatch -Werror=analyzer-va-list-exhausted -Werror=analyzer-va-list-leak -Werror=analyzer-va-list-use-after-va-end" LDFLAGS="-Wl,-O1 -Wl,--as-needed" GCC version is gcc (Gentoo 13.1.0-r1 p1) 13.1.0
2023-05-08Fix reported memory leak.Nicholas Vinson
Found via gcc -fanalyzer. In the function nl_sfeatures() malloc() is called to allocate a block of memory; however, that memory block is never explictily freed. Signed-off-by: Nicholas Vinson <nvinson234@gmail.com>
2023-05-08Update FAM syntax to conform to std C.Nicholas Vinson
Found via gcc -fanalyzer. When using the non-standard FAM syntax: uint32_t req_mask[0]; gcc-13 with the -fanalyzer flag generates an internal compiler error. Updating the syntax to use the standard C syntax: uint32_t req_mask[]; works around the gcc bug. Signed-off-by: Nicholas Vinson <nvinson234@gmail.com>
2023-05-08netlink: settings: fix netlink support when PLCA is not presentJakub Kicinski
PLCA support threw the PLCA commands as required into the initial support check at the start of nl_gset(). That's not correct. The initial check (AFAIU) queries for the base support in the kernel i.e. support for the commands which correspond to ioctls. If those are not available (presumably very old kernel or kernel without ethtool-netlink) we're better off using the ioctl. For new functionality, however, falling back to ioctl is counterproductive. New functionality (like PLCA) isn't supported via the ioctl, anyway, and we're losing all the other netlink-only functionality (I noticed that the link down statistics are gone). After much deliberation I decided to add a second check for command support in gset_request(). Seems cleanest and if any of the non-required commands narrows the capabilities (e.g. does not support dump) we should just skip it too. Falling back to ioctl would again be a regression. Fixes: cf02fc1b1095 ("add support for IEEE 802.3cg-2019 Clause 148") Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-05-08Merge branch 'review/uapi-closure'Michal Kubecek
Michal Kubecek: On multiple occasion, build on older systems with system <linux/...> headers missing definitions or later changes failed which we either worked around by adding conditional defines or fixed by adding a sanitized copy of such header to uapi/ directory. To prevent these problems, add sanitized copies of all uapi headers that we include from any source file or from an already present uapi header copy (and repeat the process recursively). For this purpose, add the update scripts to the repository, update it to add missing files automatically and run the update.