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-03-02 23:02:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ethtool (Old) and /work/SRC/openSUSE:Factory/.ethtool.new.31432 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ethtool" Thu Mar 2 23:02:56 2023 rev:77 rq:1068233 version:6.2 Changes: -------- --- /work/SRC/openSUSE:Factory/ethtool/ethtool.changes 2022-12-21 16:06:11.598409757 +0100 +++ /work/SRC/openSUSE:Factory/.ethtool.new.31432/ethtool.changes 2023-03-02 23:03:18.671363406 +0100 @@ -1,0 +2,12 @@ +Tue Feb 21 15:00:27 UTC 2023 - Michal Kubecek <mkube...@suse.cz> + +- update to upstream release 6.2 + * Feature: link down event statistics (no option) + * Feature: JSON output for coalesce (-c) + * Feature: new link modes (no option) + * Feature: JSON output for ring (-g) + * Feature: netlink handler for RSS get (-x) + * Fix: fix boolean value output in JSON output +- enforce "-std=c11" on SLE <= 12 where the default is older + +------------------------------------------------------------------- Old: ---- ethtool-6.1.tar.sign ethtool-6.1.tar.xz New: ---- ethtool-6.2.tar.sign ethtool-6.2.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ethtool.spec ++++++ --- /var/tmp/diff_new_pack.u5o8JL/_old 2023-03-02 23:03:19.275372039 +0100 +++ /var/tmp/diff_new_pack.u5o8JL/_new 2023-03-02 23:03:19.279372097 +0100 @@ -1,7 +1,7 @@ # # spec file for package ethtool # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: ethtool -Version: 6.1 +Version: 6.2 Release: 0 Summary: Utility for examining and tuning Ethernet-based network interfaces License: GPL-2.0-only @@ -42,6 +42,9 @@ %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.1.tar.xz -> ethtool-6.2.tar.xz ++++++ ++++ 1899 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.1/Makefile.am new/ethtool-6.2/Makefile.am --- old/ethtool-6.1/Makefile.am 2022-12-16 11:00:26.000000000 +0100 +++ new/ethtool-6.2/Makefile.am 2023-02-21 15:14:45.000000000 +0100 @@ -7,7 +7,8 @@ sbin_PROGRAMS = ethtool ethtool_SOURCES = ethtool.c uapi/linux/ethtool.h internal.h \ - uapi/linux/net_tstamp.h rxclass.c common.c common.h \ + uapi/linux/net_tstamp.h uapi/linux/if.h uapi/linux/hdlc/ioctl.h \ + rxclass.c common.c common.h \ json_writer.c json_writer.h json_print.c json_print.h \ list.h if ETHTOOL_ENABLE_PRETTY_DUMP @@ -39,11 +40,12 @@ netlink/eee.c netlink/tsinfo.c netlink/fec.c \ netlink/stats.c \ netlink/desc-ethtool.c netlink/desc-genlctrl.c \ - netlink/module-eeprom.c netlink/module.c \ + netlink/module-eeprom.c netlink/module.c netlink/rss.c \ netlink/desc-rtnl.c netlink/cable_test.c netlink/tunnels.c \ uapi/linux/ethtool_netlink.h \ uapi/linux/netlink.h uapi/linux/genetlink.h \ - uapi/linux/rtnetlink.h uapi/linux/if_link.h + uapi/linux/rtnetlink.h uapi/linux/if_link.h \ + uapi/linux/if.h uapi/linux/hdlc/ioctl.h AM_CPPFLAGS += @MNL_CFLAGS@ LDADD += @MNL_LIBS@ endif 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.1/NEWS new/ethtool-6.2/NEWS --- old/ethtool-6.1/NEWS 2022-12-19 23:05:44.000000000 +0100 +++ new/ethtool-6.2/NEWS 2023-02-21 15:24:20.000000000 +0100 @@ -1,3 +1,12 @@ +Version 6.2 - February 21, 2023 + * Feature: link down event statistics (no option) + * Feature: JSON output for coalesce (-c) + * Feature: new link modes (no option) + * Feature: JSON output for ring (-g) + * Feature: netlink handler for RSS get (-x) + * Fix: fix boolean value output in JSON output + * Fix: fix build errors and warnings + Version 6.1 - December 19, 2022 * Feature: update link mode tables * Feature: register dump for NXP ENETC driver (-d) 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.1/common.c new/ethtool-6.2/common.c --- old/ethtool-6.1/common.c 2020-08-07 14:31:03.000000000 +0200 +++ new/ethtool-6.2/common.c 2023-02-01 22:05:17.000000000 +0100 @@ -173,3 +173,39 @@ fprintf(stdout, "\n"); } } + +void print_indir_table(struct cmd_context *ctx, u64 ring_count, + u32 indir_size, u32 *indir) +{ + u32 i; + + printf("RX flow hash indirection table for %s with %llu RX ring(s):\n", + ctx->devname, ring_count); + + if (!indir_size) + printf("Operation not supported\n"); + + for (i = 0; i < indir_size; i++) { + if (i % 8 == 0) + printf("%5u: ", i); + printf(" %5u", indir[i]); + if (i % 8 == 7 || i == indir_size - 1) + fputc('\n', stdout); + } +} + +void print_rss_hkey(u8 *hkey, u32 hkey_size) +{ + u32 i; + + printf("RSS hash key:\n"); + if (!hkey_size || !hkey) + printf("Operation not supported\n"); + + for (i = 0; i < hkey_size; i++) { + if (i == (hkey_size - 1)) + printf("%02x\n", hkey[i]); + else + printf("%02x:", hkey[i]); + } +} 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.1/common.h new/ethtool-6.2/common.h --- old/ethtool-6.1/common.h 2020-06-10 10:58:44.000000000 +0200 +++ new/ethtool-6.2/common.h 2023-02-01 22:05:17.000000000 +0100 @@ -8,6 +8,8 @@ #define ETHTOOL_COMMON_H__ #include "internal.h" +#include <stddef.h> +#include <errno.h> #define KERNEL_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c)) @@ -41,5 +43,7 @@ void print_flags(const struct flag_info *info, unsigned int n_info, u32 value); int dump_wol(struct ethtool_wolinfo *wol); void dump_mdix(u8 mdix, u8 mdix_ctrl); - +void print_indir_table(struct cmd_context *ctx, u64 ring_count, + u32 indir_size, u32 *indir); +void print_rss_hkey(u8 *hkey, u32 hkey_size); #endif /* ETHTOOL_COMMON_H__ */ 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.1/configure.ac new/ethtool-6.2/configure.ac --- old/ethtool-6.1/configure.ac 2022-12-19 22:59:47.000000000 +0100 +++ new/ethtool-6.2/configure.ac 2023-02-21 15:18:28.000000000 +0100 @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(ethtool, 6.1, net...@vger.kernel.org) +AC_INIT(ethtool, 6.2, net...@vger.kernel.org) AC_PREREQ(2.52) AC_CONFIG_SRCDIR([ethtool.c]) AM_INIT_AUTOMAKE([gnu subdir-objects]) 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.1/ethtool.8 new/ethtool-6.2/ethtool.8 --- old/ethtool-6.1/ethtool.8 2022-12-19 23:15:08.000000000 +0100 +++ new/ethtool-6.2/ethtool.8 2023-02-21 15:53:37.000000000 +0100 @@ -117,7 +117,7 @@ . hy \\n(HY .. . -.TH ETHTOOL 8 "December 2022" "Ethtool version 6.1" +.TH ETHTOOL 8 "February 2023" "Ethtool version 6.2" .SH NAME ethtool \- query or control network driver and hardware settings . @@ -853,6 +853,12 @@ 0x8000000000000000000000 400000baseLR4_ER4_FR4 Full 0x10000000000000000000000 400000baseDR4 Full 0x20000000000000000000000 400000baseCR4 Full +0x200000000000000000000000 800000baseCR8 Full +0x400000000000000000000000 800000baseKR8 Full +0x800000000000000000000000 800000baseDR8 Full +0x1000000000000000000000000 800000baseDR8_2 Full +0x2000000000000000000000000 800000baseSR8 Full +0x4000000000000000000000000 800000baseVR8 Full .TE .TP .BI phyad \ N 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.1/ethtool.8.in new/ethtool-6.2/ethtool.8.in --- old/ethtool-6.1/ethtool.8.in 2022-12-19 23:00:08.000000000 +0100 +++ new/ethtool-6.2/ethtool.8.in 2023-02-21 15:18:44.000000000 +0100 @@ -117,7 +117,7 @@ . hy \\n(HY .. . -.TH ETHTOOL 8 "December 2022" "Ethtool version @VERSION@" +.TH ETHTOOL 8 "February 2023" "Ethtool version @VERSION@" .SH NAME ethtool \- query or control network driver and hardware settings . @@ -853,6 +853,12 @@ 0x8000000000000000000000 400000baseLR4_ER4_FR4 Full 0x10000000000000000000000 400000baseDR4 Full 0x20000000000000000000000 400000baseCR4 Full +0x200000000000000000000000 800000baseCR8 Full +0x400000000000000000000000 800000baseKR8 Full +0x800000000000000000000000 800000baseDR8 Full +0x1000000000000000000000000 800000baseDR8_2 Full +0x2000000000000000000000000 800000baseSR8 Full +0x4000000000000000000000000 800000baseVR8 Full .TE .TP .BI phyad \ N 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.1/ethtool.c new/ethtool-6.2/ethtool.c --- old/ethtool-6.1/ethtool.c 2022-12-16 11:00:26.000000000 +0100 +++ new/ethtool-6.2/ethtool.c 2023-02-21 15:14:45.000000000 +0100 @@ -478,6 +478,12 @@ ETHTOOL_LINK_MODE_100baseFX_Half_BIT, ETHTOOL_LINK_MODE_100baseFX_Full_BIT, ETHTOOL_LINK_MODE_10baseT1L_Full_BIT, + ETHTOOL_LINK_MODE_800000baseCR8_Full_BIT, + ETHTOOL_LINK_MODE_800000baseKR8_Full_BIT, + ETHTOOL_LINK_MODE_800000baseDR8_Full_BIT, + ETHTOOL_LINK_MODE_800000baseDR8_2_Full_BIT, + ETHTOOL_LINK_MODE_800000baseSR8_Full_BIT, + ETHTOOL_LINK_MODE_800000baseVR8_Full_BIT, }; static const enum ethtool_link_mode_bit_indices additional_advertised_flags_bits[] = { @@ -720,6 +726,18 @@ "100baseFX/Full" }, { 0, ETHTOOL_LINK_MODE_10baseT1L_Full_BIT, "10baseT1L/Full" }, + { 0, ETHTOOL_LINK_MODE_800000baseCR8_Full_BIT, + "800000baseCR8/Full" }, + { 0, ETHTOOL_LINK_MODE_800000baseKR8_Full_BIT, + "800000baseKR8/Full" }, + { 0, ETHTOOL_LINK_MODE_800000baseDR8_Full_BIT, + "800000baseDR8/Full" }, + { 0, ETHTOOL_LINK_MODE_800000baseDR8_2_Full_BIT, + "800000baseDR8_2/Full" }, + { 0, ETHTOOL_LINK_MODE_800000baseSR8_Full_BIT, + "800000baseSR8/Full" }, + { 0, ETHTOOL_LINK_MODE_800000baseVR8_Full_BIT, + "800000baseVR8/Full" }, }; int indent; int did1, new_line_pend; @@ -3882,27 +3900,6 @@ return err ? 1 : 0; } -static void print_indir_table(struct cmd_context *ctx, - struct ethtool_rxnfc *ring_count, - u32 indir_size, u32 *indir) -{ - u32 i; - - printf("RX flow hash indirection table for %s with %llu RX ring(s):\n", - ctx->devname, ring_count->data); - - if (!indir_size) - printf("Operation not supported\n"); - - for (i = 0; i < indir_size; i++) { - if (i % 8 == 0) - printf("%5u: ", i); - printf(" %5u", indir[i]); - if (i % 8 == 7 || i == indir_size - 1) - fputc('\n', stdout); - } -} - static int do_grxfhindir(struct cmd_context *ctx, struct ethtool_rxnfc *ring_count) { @@ -3934,7 +3931,8 @@ return 1; } - print_indir_table(ctx, ring_count, indir->size, indir->ring_index); + print_indir_table(ctx, ring_count->data, indir->size, + indir->ring_index); free(indir); return 0; @@ -3949,7 +3947,7 @@ u32 rss_context = 0; u32 i, indir_bytes; unsigned int arg_num = 0; - char *hkey; + u8 *hkey; int err; while (arg_num < ctx->argc) { @@ -3999,21 +3997,13 @@ return 1; } - print_indir_table(ctx, &ring_count, rss->indir_size, rss->rss_config); + print_indir_table(ctx, ring_count.data, rss->indir_size, + rss->rss_config); indir_bytes = rss->indir_size * sizeof(rss->rss_config[0]); - hkey = ((char *)rss->rss_config + indir_bytes); + hkey = ((u8 *)rss->rss_config + indir_bytes); - printf("RSS hash key:\n"); - if (!rss->key_size) - printf("Operation not supported\n"); - - for (i = 0; i < rss->key_size; i++) { - if (i == (rss->key_size - 1)) - printf("%02x\n", (u8) hkey[i]); - else - printf("%02x:", (u8) hkey[i]); - } + print_rss_hkey(hkey, rss->key_size); printf("RSS hash function:\n"); if (!rss->hfunc) { @@ -5696,6 +5686,7 @@ }, { .opts = "-c|--show-coalesce", + .json = true, .func = do_gcoalesce, .nlfunc = nl_gcoalesce, .help = "Show coalesce options" @@ -5732,6 +5723,7 @@ }, { .opts = "-g|--show-ring", + .json = true, .func = do_gring, .nlfunc = nl_gring, .help = "Query RX/TX ring parameters" @@ -5867,7 +5859,9 @@ }, { .opts = "-x|--show-rxfh-indir|--show-rxfh", + .json = true, .func = do_grxfh, + .nlfunc = nl_grss, .help = "Show Rx flow hash indirection table and/or RSS hash key", .xhelp = " [ context %d ]\n" }, 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.1/ethtool.spec new/ethtool-6.2/ethtool.spec --- old/ethtool-6.1/ethtool.spec 2022-12-19 23:15:09.000000000 +0100 +++ new/ethtool-6.2/ethtool.spec 2023-02-21 15:53:53.000000000 +0100 @@ -1,5 +1,5 @@ Name : ethtool -Version : 6.1 +Version : 6.2 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.1/internal.h new/ethtool-6.2/internal.h --- old/ethtool-6.1/internal.h 2022-12-16 11:00:26.000000000 +0100 +++ new/ethtool-6.2/internal.h 2023-02-12 20:23:47.000000000 +0100 @@ -21,6 +21,9 @@ #include <unistd.h> #include <endian.h> #include <sys/ioctl.h> +#define __UAPI_DEF_IF_IFNAMSIZ 1 +#define __UAPI_DEF_IF_IFMAP 1 +#define __UAPI_DEF_IF_IFREQ 1 #include <linux/if.h> #include "json_writer.h" @@ -52,10 +55,6 @@ #define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) #endif -#ifndef ALTIFNAMSIZ -#define ALTIFNAMSIZ 128 -#endif - #include <linux/ethtool.h> #include <linux/net_tstamp.h> 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.1/marvell.c new/ethtool-6.2/marvell.c --- old/ethtool-6.1/marvell.c 2020-09-23 23:00:15.000000000 +0200 +++ new/ethtool-6.2/marvell.c 2023-02-01 22:05:17.000000000 +0100 @@ -31,23 +31,23 @@ static void dump_queue(const char *name, const void *a, int rx) { struct desc { - u_int32_t ctl; - u_int32_t next; - u_int32_t data_lo; - u_int32_t data_hi; - u_int32_t status; - u_int32_t timestamp; - u_int16_t csum2; - u_int16_t csum1; - u_int16_t csum2_start; - u_int16_t csum1_start; - u_int32_t addr_lo; - u_int32_t addr_hi; - u_int32_t count_lo; - u_int32_t count_hi; - u_int32_t byte_count; - u_int32_t csr; - u_int32_t flag; + uint32_t ctl; + uint32_t next; + uint32_t data_lo; + uint32_t data_hi; + uint32_t status; + uint32_t timestamp; + uint16_t csum2; + uint16_t csum1; + uint16_t csum2_start; + uint16_t csum1_start; + uint32_t addr_lo; + uint32_t addr_hi; + uint32_t count_lo; + uint32_t count_hi; + uint32_t byte_count; + uint32_t csr; + uint32_t flag; }; const struct desc *d = a; 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.1/netlink/channels.c new/ethtool-6.2/netlink/channels.c --- old/ethtool-6.1/netlink/channels.c 2020-12-15 23:07:04.000000000 +0100 +++ new/ethtool-6.2/netlink/channels.c 2023-02-01 16:14:47.000000000 +0100 @@ -37,15 +37,17 @@ putchar('\n'); printf("Channel parameters for %s:\n", nlctx->devname); printf("Pre-set maximums:\n"); - show_u32(tb[ETHTOOL_A_CHANNELS_RX_MAX], "RX:\t\t"); - show_u32(tb[ETHTOOL_A_CHANNELS_TX_MAX], "TX:\t\t"); - show_u32(tb[ETHTOOL_A_CHANNELS_OTHER_MAX], "Other:\t\t"); - show_u32(tb[ETHTOOL_A_CHANNELS_COMBINED_MAX], "Combined:\t"); + show_u32("rx-max", "RX:\t\t", tb[ETHTOOL_A_CHANNELS_RX_MAX]); + show_u32("tx-max", "TX:\t\t", tb[ETHTOOL_A_CHANNELS_TX_MAX]); + show_u32("other-max", "Other:\t\t", tb[ETHTOOL_A_CHANNELS_OTHER_MAX]); + show_u32("combined-max", "Combined:\t", + tb[ETHTOOL_A_CHANNELS_COMBINED_MAX]); printf("Current hardware settings:\n"); - show_u32(tb[ETHTOOL_A_CHANNELS_RX_COUNT], "RX:\t\t"); - show_u32(tb[ETHTOOL_A_CHANNELS_TX_COUNT], "TX:\t\t"); - show_u32(tb[ETHTOOL_A_CHANNELS_OTHER_COUNT], "Other:\t\t"); - show_u32(tb[ETHTOOL_A_CHANNELS_COMBINED_COUNT], "Combined:\t"); + show_u32("rx", "RX:\t\t", tb[ETHTOOL_A_CHANNELS_RX_COUNT]); + show_u32("tx", "TX:\t\t", tb[ETHTOOL_A_CHANNELS_TX_COUNT]); + show_u32("other", "Other:\t\t", tb[ETHTOOL_A_CHANNELS_OTHER_COUNT]); + show_u32("combined", "Combined:\t", + tb[ETHTOOL_A_CHANNELS_COMBINED_COUNT]); return MNL_CB_OK; } 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.1/netlink/coalesce.c new/ethtool-6.2/netlink/coalesce.c --- old/ethtool-6.1/netlink/coalesce.c 2021-09-12 23:28:33.000000000 +0200 +++ new/ethtool-6.2/netlink/coalesce.c 2023-02-01 16:14:47.000000000 +0100 @@ -33,43 +33,64 @@ if (!dev_ok(nlctx)) return err_ret; + open_json_object(NULL); + if (silent) - putchar('\n'); - printf("Coalesce parameters for %s:\n", nlctx->devname); + show_cr(); + print_string(PRINT_ANY, "ifname", "Coalesce parameters for %s:\n", + nlctx->devname); show_bool("rx", "Adaptive RX: %s ", tb[ETHTOOL_A_COALESCE_USE_ADAPTIVE_RX]); show_bool("tx", "TX: %s\n", tb[ETHTOOL_A_COALESCE_USE_ADAPTIVE_TX]); - show_u32(tb[ETHTOOL_A_COALESCE_STATS_BLOCK_USECS], - "stats-block-usecs: "); - show_u32(tb[ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL], - "sample-interval: "); - show_u32(tb[ETHTOOL_A_COALESCE_PKT_RATE_LOW], "pkt-rate-low: "); - show_u32(tb[ETHTOOL_A_COALESCE_PKT_RATE_HIGH], "pkt-rate-high: "); - putchar('\n'); - show_u32(tb[ETHTOOL_A_COALESCE_RX_USECS], "rx-usecs: "); - show_u32(tb[ETHTOOL_A_COALESCE_RX_MAX_FRAMES], "rx-frames: "); - show_u32(tb[ETHTOOL_A_COALESCE_RX_USECS_IRQ], "rx-usecs-irq: "); - show_u32(tb[ETHTOOL_A_COALESCE_RX_MAX_FRAMES_IRQ], "rx-frames-irq: "); - putchar('\n'); - show_u32(tb[ETHTOOL_A_COALESCE_TX_USECS], "tx-usecs: "); - show_u32(tb[ETHTOOL_A_COALESCE_TX_MAX_FRAMES], "tx-frames: "); - show_u32(tb[ETHTOOL_A_COALESCE_TX_USECS_IRQ], "tx-usecs-irq: "); - show_u32(tb[ETHTOOL_A_COALESCE_TX_MAX_FRAMES_IRQ], "tx-frames-irq: "); - putchar('\n'); - show_u32(tb[ETHTOOL_A_COALESCE_RX_USECS_LOW], "rx-usecs-low: "); - show_u32(tb[ETHTOOL_A_COALESCE_RX_MAX_FRAMES_LOW], "rx-frame-low: "); - show_u32(tb[ETHTOOL_A_COALESCE_TX_USECS_LOW], "tx-usecs-low: "); - show_u32(tb[ETHTOOL_A_COALESCE_TX_MAX_FRAMES_LOW], "tx-frame-low: "); - putchar('\n'); - show_u32(tb[ETHTOOL_A_COALESCE_RX_USECS_HIGH], "rx-usecs-high: "); - show_u32(tb[ETHTOOL_A_COALESCE_RX_MAX_FRAMES_HIGH], "rx-frame-high: "); - show_u32(tb[ETHTOOL_A_COALESCE_TX_USECS_HIGH], "tx-usecs-high: "); - show_u32(tb[ETHTOOL_A_COALESCE_TX_MAX_FRAMES_HIGH], "tx-frame-high: "); - putchar('\n'); + show_u32("stats-block-usecs", "stats-block-usecs:\t", + tb[ETHTOOL_A_COALESCE_STATS_BLOCK_USECS]); + show_u32("sample-interval", "sample-interval:\t", + tb[ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL]); + show_u32("pkt-rate-low", "pkt-rate-low:\t\t", + tb[ETHTOOL_A_COALESCE_PKT_RATE_LOW]); + show_u32("pkt-rate-high", "pkt-rate-high:\t\t", + tb[ETHTOOL_A_COALESCE_PKT_RATE_HIGH]); + show_cr(); + show_u32("rx-usecs", "rx-usecs:\t", tb[ETHTOOL_A_COALESCE_RX_USECS]); + show_u32("rx-frames", "rx-frames:\t", + tb[ETHTOOL_A_COALESCE_RX_MAX_FRAMES]); + show_u32("rx-usecs-irq", "rx-usecs-irq:\t", + tb[ETHTOOL_A_COALESCE_RX_USECS_IRQ]); + show_u32("rx-frames-irq", "rx-frames-irq:\t", + tb[ETHTOOL_A_COALESCE_RX_MAX_FRAMES_IRQ]); + show_cr(); + show_u32("tx-usecs", "tx-usecs:\t", tb[ETHTOOL_A_COALESCE_TX_USECS]); + show_u32("tx-frames", "tx-frames:\t", + tb[ETHTOOL_A_COALESCE_TX_MAX_FRAMES]); + show_u32("tx-usecs-irq", "tx-usecs-irq:\t", + tb[ETHTOOL_A_COALESCE_TX_USECS_IRQ]); + show_u32("tx-frames-irq", "tx-frames-irq:\t", + tb[ETHTOOL_A_COALESCE_TX_MAX_FRAMES_IRQ]); + show_cr(); + show_u32("rx-usecs-low", "rx-usecs-low:\t", + tb[ETHTOOL_A_COALESCE_RX_USECS_LOW]); + show_u32("rx-frame-low", "rx-frame-low:\t", + tb[ETHTOOL_A_COALESCE_RX_MAX_FRAMES_LOW]); + show_u32("tx-usecs-low", "tx-usecs-low:\t", + tb[ETHTOOL_A_COALESCE_TX_USECS_LOW]); + show_u32("tx-frame-low", "tx-frame-low:\t", + tb[ETHTOOL_A_COALESCE_TX_MAX_FRAMES_LOW]); + show_cr(); + show_u32("rx-usecs-high", "rx-usecs-high:\t", + tb[ETHTOOL_A_COALESCE_RX_USECS_HIGH]); + show_u32("rx-frame-high", "rx-frame-high:\t", + tb[ETHTOOL_A_COALESCE_RX_MAX_FRAMES_HIGH]); + show_u32("tx-usecs-high", "tx-usecs-high:\t", + tb[ETHTOOL_A_COALESCE_TX_USECS_HIGH]); + show_u32("tx-frame-high", "tx-frame-high:\t", + tb[ETHTOOL_A_COALESCE_TX_MAX_FRAMES_HIGH]); + show_cr(); show_bool("rx", "CQE mode RX: %s ", tb[ETHTOOL_A_COALESCE_USE_CQE_MODE_RX]); show_bool("tx", "TX: %s\n", tb[ETHTOOL_A_COALESCE_USE_CQE_MODE_TX]); - putchar('\n'); + show_cr(); + + close_json_object(); return MNL_CB_OK; } @@ -92,7 +113,11 @@ ETHTOOL_A_COALESCE_HEADER, 0); if (ret < 0) return ret; - return nlsock_send_get_request(nlsk, coalesce_reply_cb); + + new_json_obj(ctx->json); + ret = nlsock_send_get_request(nlsk, coalesce_reply_cb); + delete_json_obj(); + return ret; } /* COALESCE_SET */ 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.1/netlink/desc-ethtool.c new/ethtool-6.2/netlink/desc-ethtool.c --- old/ethtool-6.1/netlink/desc-ethtool.c 2022-12-19 18:20:15.000000000 +0100 +++ new/ethtool-6.2/netlink/desc-ethtool.c 2023-02-21 15:14:45.000000000 +0100 @@ -442,6 +442,15 @@ NLATTR_DESC_U32_ENUM(ETHTOOL_A_PODL_PSE_PW_D_STATUS, pse_pw_d_status), }; +static const struct pretty_nla_desc __rss_desc[] = { + NLATTR_DESC_INVALID(ETHTOOL_A_RSS_UNSPEC), + NLATTR_DESC_NESTED(ETHTOOL_A_RSS_HEADER, header), + NLATTR_DESC_U32(ETHTOOL_A_RSS_CONTEXT), + NLATTR_DESC_U32(ETHTOOL_A_RSS_HFUNC), + NLATTR_DESC_BINARY(ETHTOOL_A_RSS_INDIR), + NLATTR_DESC_BINARY(ETHTOOL_A_RSS_HKEY), +}; + const struct pretty_nlmsg_desc ethnl_umsg_desc[] = { NLMSG_DESC_INVALID(ETHTOOL_MSG_USER_NONE), NLMSG_DESC(ETHTOOL_MSG_STRSET_GET, strset), @@ -481,6 +490,7 @@ NLMSG_DESC(ETHTOOL_MSG_MODULE_SET, module), NLMSG_DESC(ETHTOOL_MSG_PSE_GET, pse), NLMSG_DESC(ETHTOOL_MSG_PSE_SET, pse), + NLMSG_DESC(ETHTOOL_MSG_RSS_GET, rss), }; const unsigned int ethnl_umsg_n_desc = ARRAY_SIZE(ethnl_umsg_desc); @@ -524,6 +534,7 @@ NLMSG_DESC(ETHTOOL_MSG_MODULE_GET_REPLY, module), NLMSG_DESC(ETHTOOL_MSG_MODULE_NTF, module), NLMSG_DESC(ETHTOOL_MSG_PSE_GET_REPLY, pse), + NLMSG_DESC(ETHTOOL_MSG_RSS_GET_REPLY, rss), }; const unsigned int ethnl_kmsg_n_desc = ARRAY_SIZE(ethnl_kmsg_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.1/netlink/extapi.h new/ethtool-6.2/netlink/extapi.h --- old/ethtool-6.1/netlink/extapi.h 2022-01-19 00:46:20.000000000 +0100 +++ new/ethtool-6.2/netlink/extapi.h 2023-02-21 15:14:45.000000000 +0100 @@ -47,6 +47,7 @@ int nl_smodule(struct cmd_context *ctx); int nl_monitor(struct cmd_context *ctx); int nl_getmodule(struct cmd_context *ctx); +int nl_grss(struct cmd_context *ctx); void nl_monitor_usage(void); @@ -114,6 +115,7 @@ #define nl_getmodule NULL #define nl_gmodule NULL #define nl_smodule NULL +#define nl_grss NULL #endif /* ETHTOOL_ENABLE_NETLINK */ 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.1/netlink/netlink.h new/ethtool-6.2/netlink/netlink.h --- old/ethtool-6.1/netlink/netlink.h 2022-01-19 00:46:20.000000000 +0100 +++ new/ethtool-6.2/netlink/netlink.h 2023-02-01 22:05:17.000000000 +0100 @@ -100,12 +100,20 @@ const char *between, const char *after, const char *if_none); -static inline void show_u32(const struct nlattr *attr, const char *label) +static inline void show_u32(const char *key, + const char *fmt, + const struct nlattr *attr) { - if (attr) - printf("%s%u\n", label, mnl_attr_get_u32(attr)); - else - printf("%sn/a\n", label); + if (is_json_context()) { + if (attr) + print_uint(PRINT_JSON, key, NULL, + mnl_attr_get_u32(attr)); + } else { + if (attr) + printf("%s%u\n", fmt, mnl_attr_get_u32(attr)); + else + printf("%sn/a\n", fmt); + } } static inline const char *u8_to_bool(const uint8_t *val) @@ -120,7 +128,7 @@ { if (is_json_context()) { if (val) - print_bool(PRINT_JSON, key, NULL, val); + print_bool(PRINT_JSON, key, NULL, *val); } else { print_string(PRINT_FP, NULL, fmt, u8_to_bool(val)); } @@ -132,6 +140,12 @@ show_bool_val(key, fmt, attr ? mnl_attr_get_payload(attr) : NULL); } +static inline void show_cr(void) +{ + if (!is_json_context()) + putchar('\n'); +} + /* misc */ static inline void copy_devname(char *dst, const char *src) 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.1/netlink/parser.c new/ethtool-6.2/netlink/parser.c --- old/ethtool-6.1/netlink/parser.c 2022-12-08 13:20:15.000000000 +0100 +++ new/ethtool-6.2/netlink/parser.c 2023-02-03 00:11:33.000000000 +0100 @@ -237,7 +237,7 @@ struct nl_msg_buff *msgbuff, void *dest) { const char *arg = *nlctx->argp; - float meters; + float meters = 0.0; uint32_t cm; int ret; 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.1/netlink/rings.c new/ethtool-6.2/netlink/rings.c --- old/ethtool-6.1/netlink/rings.c 2022-12-04 17:51:19.000000000 +0100 +++ new/ethtool-6.2/netlink/rings.c 2023-02-21 15:14:45.000000000 +0100 @@ -21,6 +21,9 @@ DECLARE_ATTR_TB_INFO(tb); struct nl_context *nlctx = data; unsigned char tcp_hds; + char *tcp_hds_fmt; + char *tcp_hds_key; + char tcp_hds_buf[256]; bool silent; int err_ret; int ret; @@ -34,41 +37,50 @@ if (!dev_ok(nlctx)) return err_ret; + open_json_object(NULL); + if (silent) - putchar('\n'); - printf("Ring parameters for %s:\n", nlctx->devname); - printf("Pre-set maximums:\n"); - show_u32(tb[ETHTOOL_A_RINGS_RX_MAX], "RX:\t\t"); - show_u32(tb[ETHTOOL_A_RINGS_RX_MINI_MAX], "RX Mini:\t"); - show_u32(tb[ETHTOOL_A_RINGS_RX_JUMBO_MAX], "RX Jumbo:\t"); - show_u32(tb[ETHTOOL_A_RINGS_TX_MAX], "TX:\t\t"); - printf("Current hardware settings:\n"); - show_u32(tb[ETHTOOL_A_RINGS_RX], "RX:\t\t"); - show_u32(tb[ETHTOOL_A_RINGS_RX_MINI], "RX Mini:\t"); - show_u32(tb[ETHTOOL_A_RINGS_RX_JUMBO], "RX Jumbo:\t"); - show_u32(tb[ETHTOOL_A_RINGS_TX], "TX:\t\t"); - show_u32(tb[ETHTOOL_A_RINGS_RX_BUF_LEN], "RX Buf Len:\t\t"); - show_u32(tb[ETHTOOL_A_RINGS_CQE_SIZE], "CQE Size:\t\t"); + show_cr(); + 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", + tb[ETHTOOL_A_RINGS_RX_JUMBO_MAX]); + show_u32("tx-max", "TX:\t\t", tb[ETHTOOL_A_RINGS_TX_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]); + tcp_hds_fmt = "TCP data split:\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; - printf("TCP data split:\t"); switch (tcp_hds) { case ETHTOOL_TCP_DATA_SPLIT_UNKNOWN: - printf("n/a\n"); + print_string(PRINT_FP, tcp_hds_key, tcp_hds_fmt, "n/a"); break; case ETHTOOL_TCP_DATA_SPLIT_DISABLED: - printf("off\n"); + print_string(PRINT_ANY, tcp_hds_key, tcp_hds_fmt, "off"); break; case ETHTOOL_TCP_DATA_SPLIT_ENABLED: - printf("on\n"); + print_string(PRINT_ANY, tcp_hds_key, tcp_hds_fmt, "on"); break; default: - printf("unknown(%d)\n", tcp_hds); + snprintf(tcp_hds_buf, sizeof(tcp_hds_buf), + "unknown(%d)\n", tcp_hds); + print_string(PRINT_ANY, tcp_hds_key, tcp_hds_fmt, tcp_hds_buf); break; } + close_json_object(); + return MNL_CB_OK; } @@ -90,7 +102,11 @@ ETHTOOL_A_RINGS_HEADER, 0); if (ret < 0) return ret; - return nlsock_send_get_request(nlsk, rings_reply_cb); + + new_json_obj(ctx->json); + ret = nlsock_send_get_request(nlsk, rings_reply_cb); + delete_json_obj(); + return ret; } /* RINGS_SET */ 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.1/netlink/rss.c new/ethtool-6.2/netlink/rss.c --- old/ethtool-6.1/netlink/rss.c 1970-01-01 01:00:00.000000000 +0100 +++ new/ethtool-6.2/netlink/rss.c 2023-02-01 22:05:17.000000000 +0100 @@ -0,0 +1,230 @@ +/* + * rss.c - netlink implementation of RSS context commands + * + * Implementation of "ethtool -x <dev>" + */ + +#include <errno.h> +#include <string.h> +#include <stdio.h> + +#include "../internal.h" +#include "../common.h" +#include "netlink.h" +#include "strset.h" +#include "parser.h" + +struct cb_args { + struct nl_context *nlctx; + u32 num_rings; +}; + +void dump_json_rss_info(struct cmd_context *ctx, u32 *indir_table, + u32 indir_size, u8 *hkey, u32 hkey_size, + const struct stringset *hash_funcs, u8 hfunc) +{ + unsigned int i; + + open_json_object(NULL); + print_string(PRINT_JSON, "ifname", NULL, ctx->devname); + if (indir_size) { + open_json_array("rss-indirection-table", NULL); + for (i = 0; i < indir_size; i++) + print_uint(PRINT_JSON, NULL, NULL, indir_table[i]); + close_json_array("\n"); + } + + if (hkey_size) { + open_json_array("rss-hash-key", NULL); + for (i = 0; i < hkey_size; i++) + print_uint(PRINT_JSON, NULL, NULL, (u8)hkey[i]); + close_json_array("\n"); + } + + if (hfunc) { + for (i = 0; i < get_count(hash_funcs); i++) { + if (hfunc & (1 << i)) { + print_string(PRINT_JSON, "rss-hash-function", + NULL, get_string(hash_funcs, i)); + break; + } + } + } + + close_json_object(); +} + +int get_channels_cb(const struct nlmsghdr *nlhdr, void *data) +{ + const struct nlattr *tb[ETHTOOL_A_CHANNELS_MAX + 1] = {}; + DECLARE_ATTR_TB_INFO(tb); + struct cb_args *args = data; + struct nl_context *nlctx = args->nlctx; + bool silent; + int err_ret; + int ret; + + silent = nlctx->is_dump || nlctx->is_monitor; + err_ret = silent ? MNL_CB_OK : MNL_CB_ERROR; + ret = mnl_attr_parse(nlhdr, GENL_HDRLEN, attr_cb, &tb_info); + if (ret < 0) + return err_ret; + nlctx->devname = get_dev_name(tb[ETHTOOL_A_CHANNELS_HEADER]); + if (!dev_ok(nlctx)) + return err_ret; + if (tb[ETHTOOL_A_CHANNELS_COMBINED_COUNT]) + args->num_rings = mnl_attr_get_u32(tb[ETHTOOL_A_CHANNELS_COMBINED_COUNT]); + if (tb[ETHTOOL_A_CHANNELS_RX_COUNT]) + args->num_rings += mnl_attr_get_u32(tb[ETHTOOL_A_CHANNELS_RX_COUNT]); + return MNL_CB_OK; +} + +int rss_reply_cb(const struct nlmsghdr *nlhdr, void *data) +{ + const struct nlattr *tb[ETHTOOL_A_RSS_MAX + 1] = {}; + unsigned int indir_bytes = 0, hkey_bytes = 0; + DECLARE_ATTR_TB_INFO(tb); + struct cb_args *args = data; + struct nl_context *nlctx = args->nlctx; + const struct stringset *hash_funcs; + u32 rss_hfunc = 0, indir_size; + u32 *indir_table = NULL; + u8 *hkey = NULL; + bool silent; + int err_ret; + int ret; + + silent = nlctx->is_dump || nlctx->is_monitor; + err_ret = silent ? MNL_CB_OK : MNL_CB_ERROR; + ret = mnl_attr_parse(nlhdr, GENL_HDRLEN, attr_cb, &tb_info); + if (ret < 0) + return err_ret; + nlctx->devname = get_dev_name(tb[ETHTOOL_A_RSS_HEADER]); + if (!dev_ok(nlctx)) + return err_ret; + + show_cr(); + + if (tb[ETHTOOL_A_RSS_HFUNC]) + rss_hfunc = mnl_attr_get_u32(tb[ETHTOOL_A_RSS_HFUNC]); + + if (tb[ETHTOOL_A_RSS_INDIR]) { + indir_bytes = mnl_attr_get_payload_len(tb[ETHTOOL_A_RSS_INDIR]); + indir_table = mnl_attr_get_payload(tb[ETHTOOL_A_RSS_INDIR]); + } + + if (tb[ETHTOOL_A_RSS_HKEY]) { + hkey_bytes = mnl_attr_get_payload_len(tb[ETHTOOL_A_RSS_HKEY]); + hkey = mnl_attr_get_payload(tb[ETHTOOL_A_RSS_HKEY]); + } + + /* Fetch RSS hash functions and their status and print */ + if (!nlctx->is_monitor) { + ret = netlink_init_ethnl2_socket(nlctx); + if (ret < 0) + return MNL_CB_ERROR; + } + hash_funcs = global_stringset(ETH_SS_RSS_HASH_FUNCS, + nlctx->ethnl2_socket); + + ret = mnl_attr_parse(nlhdr, GENL_HDRLEN, attr_cb, &tb_info); + if (ret < 0) + return silent ? MNL_CB_OK : MNL_CB_ERROR; + + nlctx->devname = get_dev_name(tb[ETHTOOL_A_RSS_HEADER]); + if (!dev_ok(nlctx)) + return MNL_CB_OK; + + /* Fetch ring count info into args->num_rings */ + ret = nlsock_prep_get_request(nlctx->ethnl2_socket, + ETHTOOL_MSG_CHANNELS_GET, + ETHTOOL_A_CHANNELS_HEADER, 0); + if (ret < 0) + return MNL_CB_ERROR; + + ret = nlsock_sendmsg(nlctx->ethnl2_socket, NULL); + if (ret < 0) + return MNL_CB_ERROR; + + ret = nlsock_process_reply(nlctx->ethnl2_socket, get_channels_cb, args); + if (ret < 0) + return MNL_CB_ERROR; + + indir_size = indir_bytes / sizeof(u32); + if (is_json_context()) { + dump_json_rss_info(nlctx->ctx, (u32 *)indir_table, indir_size, + hkey, hkey_bytes, hash_funcs, rss_hfunc); + } else { + print_indir_table(nlctx->ctx, args->num_rings, + indir_size, (u32 *)indir_table); + print_rss_hkey(hkey, hkey_bytes); + printf("RSS hash function:\n"); + if (!rss_hfunc) { + printf(" Operation not supported\n"); + return 0; + } + for (unsigned int i = 0; i < get_count(hash_funcs); i++) { + printf(" %s: %s\n", get_string(hash_funcs, i), + (rss_hfunc & (1 << i)) ? "on" : "off"); + } + } + + return MNL_CB_OK; +} + +/* RSS_GET */ +static const struct param_parser grss_params[] = { + { + .arg = "context", + .type = ETHTOOL_A_RSS_CONTEXT, + .handler = nl_parse_direct_u32, + .min_argc = 1, + }, + {} +}; + +int nl_grss(struct cmd_context *ctx) +{ + struct nl_context *nlctx = ctx->nlctx; + struct nl_socket *nlsk = nlctx->ethnl_socket; + struct nl_msg_buff *msgbuff; + struct cb_args args = {}; + int ret; + + nlctx->cmd = "-x"; + nlctx->argp = ctx->argp; + nlctx->argc = ctx->argc; + nlctx->devname = ctx->devname; + nlsk = nlctx->ethnl_socket; + msgbuff = &nlsk->msgbuff; + + if (netlink_cmd_check(ctx, ETHTOOL_MSG_RSS_GET, true)) + return -EOPNOTSUPP; + + ret = msg_init(nlctx, msgbuff, ETHTOOL_MSG_RSS_GET, + NLM_F_REQUEST | NLM_F_ACK); + if (ret < 0) + return 1; + + if (ethnla_fill_header(msgbuff, ETHTOOL_A_RSS_HEADER, + ctx->devname, 0)) + return -EMSGSIZE; + + ret = nl_parser(nlctx, grss_params, NULL, PARSER_GROUP_NONE, NULL); + if (ret < 0) + goto err; + + ret = nlsock_sendmsg(nlsk, NULL); + if (ret < 0) + goto err; + + args.nlctx = nlctx; + new_json_obj(ctx->json); + ret = nlsock_process_reply(nlsk, rss_reply_cb, &args); + delete_json_obj(); + + if (ret == 0) + return 0; +err: + return nlctx->exit_code ?: 1; +} 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.1/netlink/settings.c new/ethtool-6.2/netlink/settings.c --- old/ethtool-6.1/netlink/settings.c 2022-12-19 18:00:47.000000000 +0100 +++ new/ethtool-6.2/netlink/settings.c 2023-02-21 15:14:45.000000000 +0100 @@ -5,6 +5,7 @@ */ #include <errno.h> +#include <inttypes.h> #include <string.h> #include <stdio.h> @@ -165,6 +166,12 @@ [ETHTOOL_LINK_MODE_100baseFX_Half_BIT] = __HALF_DUPLEX(100), [ETHTOOL_LINK_MODE_100baseFX_Full_BIT] = __REAL(100), [ETHTOOL_LINK_MODE_10baseT1L_Full_BIT] = __REAL(10), + [ETHTOOL_LINK_MODE_800000baseCR8_Full_BIT] = __REAL(800000), + [ETHTOOL_LINK_MODE_800000baseKR8_Full_BIT] = __REAL(800000), + [ETHTOOL_LINK_MODE_800000baseDR8_Full_BIT] = __REAL(800000), + [ETHTOOL_LINK_MODE_800000baseDR8_2_Full_BIT] = __REAL(800000), + [ETHTOOL_LINK_MODE_800000baseSR8_Full_BIT] = __REAL(800000), + [ETHTOOL_LINK_MODE_800000baseVR8_Full_BIT] = __REAL(800000), }; const unsigned int link_modes_count = ARRAY_SIZE(link_modes); @@ -772,6 +779,13 @@ } } + if (tb[ETHTOOL_A_LINKSTATE_EXT_DOWN_CNT]) { + uint32_t val; + + val = mnl_attr_get_u32(tb[ETHTOOL_A_LINKSTATE_EXT_DOWN_CNT]); + printf("\tLink Down Events: %u\n", val); + } + return MNL_CB_OK; } @@ -882,12 +896,16 @@ return MNL_CB_OK; } -static int gset_request(struct nl_socket *nlsk, uint8_t msg_type, +static int gset_request(struct nl_context *nlctx, uint8_t msg_type, uint16_t hdr_attr, mnl_cb_t cb) { + struct nl_socket *nlsk = nlctx->ethnl_socket; + u32 flags; int ret; - ret = nlsock_prep_get_request(nlsk, msg_type, hdr_attr, 0); + flags = get_stats_flag(nlctx, msg_type, hdr_attr); + + ret = nlsock_prep_get_request(nlsk, msg_type, hdr_attr, flags); if (ret < 0) return ret; return nlsock_send_get_request(nlsk, cb); @@ -896,7 +914,6 @@ int nl_gset(struct cmd_context *ctx) { struct nl_context *nlctx = ctx->nlctx; - struct nl_socket *nlsk = nlctx->ethnl_socket; int ret; if (netlink_cmd_check(ctx, ETHTOOL_MSG_LINKMODES_GET, true) || @@ -908,27 +925,27 @@ nlctx->suppress_nlerr = 1; - ret = gset_request(nlsk, ETHTOOL_MSG_LINKMODES_GET, + ret = gset_request(nlctx, ETHTOOL_MSG_LINKMODES_GET, ETHTOOL_A_LINKMODES_HEADER, linkmodes_reply_cb); if (ret == -ENODEV) return ret; - ret = gset_request(nlsk, ETHTOOL_MSG_LINKINFO_GET, + ret = gset_request(nlctx, ETHTOOL_MSG_LINKINFO_GET, ETHTOOL_A_LINKINFO_HEADER, linkinfo_reply_cb); if (ret == -ENODEV) return ret; - ret = gset_request(nlsk, ETHTOOL_MSG_WOL_GET, ETHTOOL_A_WOL_HEADER, + ret = gset_request(nlctx, ETHTOOL_MSG_WOL_GET, ETHTOOL_A_WOL_HEADER, wol_reply_cb); if (ret == -ENODEV) return ret; - ret = gset_request(nlsk, ETHTOOL_MSG_DEBUG_GET, ETHTOOL_A_DEBUG_HEADER, + ret = gset_request(nlctx, ETHTOOL_MSG_DEBUG_GET, ETHTOOL_A_DEBUG_HEADER, debug_reply_cb); if (ret == -ENODEV) return ret; - ret = gset_request(nlsk, ETHTOOL_MSG_LINKSTATE_GET, + ret = gset_request(nlctx, ETHTOOL_MSG_LINKSTATE_GET, ETHTOOL_A_LINKSTATE_HEADER, linkstate_reply_cb); if (ret == -ENODEV) return ret; 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.1/uapi/linux/ethtool.h new/ethtool-6.2/uapi/linux/ethtool.h --- old/ethtool-6.1/uapi/linux/ethtool.h 2022-12-19 18:00:47.000000000 +0100 +++ new/ethtool-6.2/uapi/linux/ethtool.h 2023-02-21 15:14:45.000000000 +0100 @@ -157,8 +157,10 @@ * in its bus driver structure (e.g. pci_driver::name). Must * not be an empty string. * @version: Driver version string; may be an empty string - * @fw_version: Firmware version string; may be an empty string - * @erom_version: Expansion ROM version string; may be an empty string + * @fw_version: Firmware version string; driver defined; may be an + * empty string + * @erom_version: Expansion ROM version string; driver defined; may be + * an empty string * @bus_info: Device bus address. This should match the dev_name() * string for the underlying bus device, if there is one. May be * an empty string. @@ -177,10 +179,6 @@ * * Users can use the %ETHTOOL_GSSET_INFO command to get the number of * strings in any string set (from Linux 2.6.34). - * - * Drivers should set at most @driver, @version, @fw_version and - * @bus_info in their get_drvinfo() implementation. The ethtool - * core fills in the other fields using other driver operations. */ struct ethtool_drvinfo { __u32 cmd; @@ -1735,6 +1733,13 @@ ETHTOOL_LINK_MODE_100baseFX_Half_BIT = 90, ETHTOOL_LINK_MODE_100baseFX_Full_BIT = 91, ETHTOOL_LINK_MODE_10baseT1L_Full_BIT = 92, + ETHTOOL_LINK_MODE_800000baseCR8_Full_BIT = 93, + ETHTOOL_LINK_MODE_800000baseKR8_Full_BIT = 94, + ETHTOOL_LINK_MODE_800000baseDR8_Full_BIT = 95, + ETHTOOL_LINK_MODE_800000baseDR8_2_Full_BIT = 96, + ETHTOOL_LINK_MODE_800000baseSR8_Full_BIT = 97, + ETHTOOL_LINK_MODE_800000baseVR8_Full_BIT = 98, + /* must be last entry */ __ETHTOOL_LINK_MODE_MASK_NBITS }; @@ -1846,6 +1851,7 @@ #define SPEED_100000 100000 #define SPEED_200000 200000 #define SPEED_400000 400000 +#define SPEED_800000 800000 #define SPEED_UNKNOWN -1 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.1/uapi/linux/ethtool_netlink.h new/ethtool-6.2/uapi/linux/ethtool_netlink.h --- old/ethtool-6.1/uapi/linux/ethtool_netlink.h 2022-12-19 18:00:47.000000000 +0100 +++ new/ethtool-6.2/uapi/linux/ethtool_netlink.h 2023-02-21 15:14:45.000000000 +0100 @@ -51,6 +51,7 @@ ETHTOOL_MSG_MODULE_SET, ETHTOOL_MSG_PSE_GET, ETHTOOL_MSG_PSE_SET, + ETHTOOL_MSG_RSS_GET, /* add new constants above here */ __ETHTOOL_MSG_USER_CNT, @@ -97,6 +98,7 @@ ETHTOOL_MSG_MODULE_GET_REPLY, ETHTOOL_MSG_MODULE_NTF, ETHTOOL_MSG_PSE_GET_REPLY, + ETHTOOL_MSG_RSS_GET_REPLY, /* add new constants above here */ __ETHTOOL_MSG_KERNEL_CNT, @@ -262,6 +264,7 @@ ETHTOOL_A_LINKSTATE_SQI_MAX, /* u32 */ ETHTOOL_A_LINKSTATE_EXT_STATE, /* u8 */ ETHTOOL_A_LINKSTATE_EXT_SUBSTATE, /* u8 */ + ETHTOOL_A_LINKSTATE_EXT_DOWN_CNT, /* u32 */ /* add new constants above here */ __ETHTOOL_A_LINKSTATE_CNT, @@ -879,6 +882,18 @@ ETHTOOL_A_PSE_MAX = (__ETHTOOL_A_PSE_CNT - 1) }; +enum { + ETHTOOL_A_RSS_UNSPEC, + ETHTOOL_A_RSS_HEADER, + ETHTOOL_A_RSS_CONTEXT, /* u32 */ + ETHTOOL_A_RSS_HFUNC, /* u32 */ + ETHTOOL_A_RSS_INDIR, /* binary */ + ETHTOOL_A_RSS_HKEY, /* binary */ + + __ETHTOOL_A_RSS_CNT, + ETHTOOL_A_RSS_MAX = (__ETHTOOL_A_RSS_CNT - 1), +}; + /* generic netlink info */ #define ETHTOOL_GENL_NAME "ethtool" #define ETHTOOL_GENL_VERSION 1 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.1/uapi/linux/hdlc/ioctl.h new/ethtool-6.2/uapi/linux/hdlc/ioctl.h --- old/ethtool-6.1/uapi/linux/hdlc/ioctl.h 1970-01-01 01:00:00.000000000 +0100 +++ new/ethtool-6.2/uapi/linux/hdlc/ioctl.h 2023-02-15 11:09:59.000000000 +0100 @@ -0,0 +1,94 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +#ifndef __HDLC_IOCTL_H__ +#define __HDLC_IOCTL_H__ + + +#define GENERIC_HDLC_VERSION 4 /* For synchronization with sethdlc utility */ + +#define CLOCK_DEFAULT 0 /* Default setting */ +#define CLOCK_EXT 1 /* External TX and RX clock - DTE */ +#define CLOCK_INT 2 /* Internal TX and RX clock - DCE */ +#define CLOCK_TXINT 3 /* Internal TX and external RX clock */ +#define CLOCK_TXFROMRX 4 /* TX clock derived from external RX clock */ + + +#define ENCODING_DEFAULT 0 /* Default setting */ +#define ENCODING_NRZ 1 +#define ENCODING_NRZI 2 +#define ENCODING_FM_MARK 3 +#define ENCODING_FM_SPACE 4 +#define ENCODING_MANCHESTER 5 + + +#define PARITY_DEFAULT 0 /* Default setting */ +#define PARITY_NONE 1 /* No parity */ +#define PARITY_CRC16_PR0 2 /* CRC16, initial value 0x0000 */ +#define PARITY_CRC16_PR1 3 /* CRC16, initial value 0xFFFF */ +#define PARITY_CRC16_PR0_CCITT 4 /* CRC16, initial 0x0000, ITU-T version */ +#define PARITY_CRC16_PR1_CCITT 5 /* CRC16, initial 0xFFFF, ITU-T version */ +#define PARITY_CRC32_PR0_CCITT 6 /* CRC32, initial value 0x00000000 */ +#define PARITY_CRC32_PR1_CCITT 7 /* CRC32, initial value 0xFFFFFFFF */ + +#define LMI_DEFAULT 0 /* Default setting */ +#define LMI_NONE 1 /* No LMI, all PVCs are static */ +#define LMI_ANSI 2 /* ANSI Annex D */ +#define LMI_CCITT 3 /* ITU-T Annex A */ +#define LMI_CISCO 4 /* The "original" LMI, aka Gang of Four */ + +#ifndef __ASSEMBLY__ + +typedef struct { + unsigned int clock_rate; /* bits per second */ + unsigned int clock_type; /* internal, external, TX-internal etc. */ + unsigned short loopback; +} sync_serial_settings; /* V.35, V.24, X.21 */ + +typedef struct { + unsigned int clock_rate; /* bits per second */ + unsigned int clock_type; /* internal, external, TX-internal etc. */ + unsigned short loopback; + unsigned int slot_map; +} te1_settings; /* T1, E1 */ + +typedef struct { + unsigned short encoding; + unsigned short parity; +} raw_hdlc_proto; + +typedef struct { + unsigned int t391; + unsigned int t392; + unsigned int n391; + unsigned int n392; + unsigned int n393; + unsigned short lmi; + unsigned short dce; /* 1 for DCE (network side) operation */ +} fr_proto; + +typedef struct { + unsigned int dlci; +} fr_proto_pvc; /* for creating/deleting FR PVCs */ + +typedef struct { + unsigned int dlci; + char master[IFNAMSIZ]; /* Name of master FRAD device */ +}fr_proto_pvc_info; /* for returning PVC information only */ + +typedef struct { + unsigned int interval; + unsigned int timeout; +} cisco_proto; + +typedef struct { + unsigned short dce; /* 1 for DCE (network side) operation */ + unsigned int modulo; /* modulo (8 = basic / 128 = extended) */ + unsigned int window; /* frame window size */ + unsigned int t1; /* timeout t1 */ + unsigned int t2; /* timeout t2 */ + unsigned int n2; /* frame retry counter */ +} x25_hdlc_proto; + +/* PPP doesn't need any info now - supply length = 0 to ioctl */ + +#endif /* __ASSEMBLY__ */ +#endif /* __HDLC_IOCTL_H__ */ 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.1/uapi/linux/if.h new/ethtool-6.2/uapi/linux/if.h --- old/ethtool-6.1/uapi/linux/if.h 1970-01-01 01:00:00.000000000 +0100 +++ new/ethtool-6.2/uapi/linux/if.h 2023-02-15 11:09:59.000000000 +0100 @@ -0,0 +1,296 @@ +/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ +/* + * INET An implementation of the TCP/IP protocol suite for the LINUX + * operating system. INET is implemented using the BSD Socket + * interface as the means of communication with the user level. + * + * Global definitions for the INET interface module. + * + * Version: @(#)if.h 1.0.2 04/18/93 + * + * Authors: Original taken from Berkeley UNIX 4.3, (c) UCB 1982-1988 + * Ross Biro + * Fred N. van Kempen, <wal...@uwalt.nl.mugnet.org> + * + * 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 + * 2 of the License, or (at your option) any later version. + */ +#ifndef _LINUX_IF_H +#define _LINUX_IF_H + +#include <linux/libc-compat.h> /* for compatibility with glibc */ +#include <linux/types.h> /* for "__kernel_caddr_t" et al */ +#include <linux/socket.h> /* for "struct sockaddr" et al */ + /* for "__user" et al */ + +#include <sys/socket.h> /* for struct sockaddr. */ + +#if __UAPI_DEF_IF_IFNAMSIZ +#define IFNAMSIZ 16 +#endif /* __UAPI_DEF_IF_IFNAMSIZ */ +#define IFALIASZ 256 +#define ALTIFNAMSIZ 128 +#include <linux/hdlc/ioctl.h> + +/* For glibc compatibility. An empty enum does not compile. */ +#if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO != 0 || \ + __UAPI_DEF_IF_NET_DEVICE_FLAGS != 0 +/** + * enum net_device_flags - &struct net_device flags + * + * These are the &struct net_device flags, they can be set by drivers, the + * kernel and some can be triggered by userspace. Userspace can query and + * set these flags using userspace utilities but there is also a sysfs + * entry available for all dev flags which can be queried and set. These flags + * are shared for all types of net_devices. The sysfs entries are available + * via /sys/class/net/<dev>/flags. Flags which can be toggled through sysfs + * are annotated below, note that only a few flags can be toggled and some + * other flags are always preserved from the original net_device flags + * even if you try to set them via sysfs. Flags which are always preserved + * are kept under the flag grouping @IFF_VOLATILE. Flags which are __volatile__ + * are annotated below as such. + * + * You should have a pretty good reason to be extending these flags. + * + * @IFF_UP: interface is up. Can be toggled through sysfs. + * @IFF_BROADCAST: broadcast address valid. Volatile. + * @IFF_DEBUG: turn on debugging. Can be toggled through sysfs. + * @IFF_LOOPBACK: is a loopback net. Volatile. + * @IFF_POINTOPOINT: interface is has p-p link. Volatile. + * @IFF_NOTRAILERS: avoid use of trailers. Can be toggled through sysfs. + * Volatile. + * @IFF_RUNNING: interface RFC2863 OPER_UP. Volatile. + * @IFF_NOARP: no ARP protocol. Can be toggled through sysfs. Volatile. + * @IFF_PROMISC: receive all packets. Can be toggled through sysfs. + * @IFF_ALLMULTI: receive all multicast packets. Can be toggled through + * sysfs. + * @IFF_MASTER: master of a load balancer. Volatile. + * @IFF_SLAVE: slave of a load balancer. Volatile. + * @IFF_MULTICAST: Supports multicast. Can be toggled through sysfs. + * @IFF_PORTSEL: can set media type. Can be toggled through sysfs. + * @IFF_AUTOMEDIA: auto media select active. Can be toggled through sysfs. + * @IFF_DYNAMIC: dialup device with changing addresses. Can be toggled + * through sysfs. + * @IFF_LOWER_UP: driver signals L1 up. Volatile. + * @IFF_DORMANT: driver signals dormant. Volatile. + * @IFF_ECHO: echo sent packets. Volatile. + */ +enum net_device_flags { +/* for compatibility with glibc net/if.h */ +#if __UAPI_DEF_IF_NET_DEVICE_FLAGS + IFF_UP = 1<<0, /* sysfs */ + IFF_BROADCAST = 1<<1, /* __volatile__ */ + IFF_DEBUG = 1<<2, /* sysfs */ + IFF_LOOPBACK = 1<<3, /* __volatile__ */ + IFF_POINTOPOINT = 1<<4, /* __volatile__ */ + IFF_NOTRAILERS = 1<<5, /* sysfs */ + IFF_RUNNING = 1<<6, /* __volatile__ */ + IFF_NOARP = 1<<7, /* sysfs */ + IFF_PROMISC = 1<<8, /* sysfs */ + IFF_ALLMULTI = 1<<9, /* sysfs */ + IFF_MASTER = 1<<10, /* __volatile__ */ + IFF_SLAVE = 1<<11, /* __volatile__ */ + IFF_MULTICAST = 1<<12, /* sysfs */ + IFF_PORTSEL = 1<<13, /* sysfs */ + IFF_AUTOMEDIA = 1<<14, /* sysfs */ + IFF_DYNAMIC = 1<<15, /* sysfs */ +#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS */ +#if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO + IFF_LOWER_UP = 1<<16, /* __volatile__ */ + IFF_DORMANT = 1<<17, /* __volatile__ */ + IFF_ECHO = 1<<18, /* __volatile__ */ +#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */ +}; +#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO != 0 || __UAPI_DEF_IF_NET_DEVICE_FLAGS != 0 */ + +/* for compatibility with glibc net/if.h */ +#if __UAPI_DEF_IF_NET_DEVICE_FLAGS +#define IFF_UP IFF_UP +#define IFF_BROADCAST IFF_BROADCAST +#define IFF_DEBUG IFF_DEBUG +#define IFF_LOOPBACK IFF_LOOPBACK +#define IFF_POINTOPOINT IFF_POINTOPOINT +#define IFF_NOTRAILERS IFF_NOTRAILERS +#define IFF_RUNNING IFF_RUNNING +#define IFF_NOARP IFF_NOARP +#define IFF_PROMISC IFF_PROMISC +#define IFF_ALLMULTI IFF_ALLMULTI +#define IFF_MASTER IFF_MASTER +#define IFF_SLAVE IFF_SLAVE +#define IFF_MULTICAST IFF_MULTICAST +#define IFF_PORTSEL IFF_PORTSEL +#define IFF_AUTOMEDIA IFF_AUTOMEDIA +#define IFF_DYNAMIC IFF_DYNAMIC +#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS */ + +#if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO +#define IFF_LOWER_UP IFF_LOWER_UP +#define IFF_DORMANT IFF_DORMANT +#define IFF_ECHO IFF_ECHO +#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */ + +#define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_ECHO|\ + IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT) + +#define IF_GET_IFACE 0x0001 /* for querying only */ +#define IF_GET_PROTO 0x0002 + +/* For definitions see hdlc.h */ +#define IF_IFACE_V35 0x1000 /* V.35 serial interface */ +#define IF_IFACE_V24 0x1001 /* V.24 serial interface */ +#define IF_IFACE_X21 0x1002 /* X.21 serial interface */ +#define IF_IFACE_T1 0x1003 /* T1 telco serial interface */ +#define IF_IFACE_E1 0x1004 /* E1 telco serial interface */ +#define IF_IFACE_SYNC_SERIAL 0x1005 /* can't be set by software */ +#define IF_IFACE_X21D 0x1006 /* X.21 Dual Clocking (FarSite) */ + +/* For definitions see hdlc.h */ +#define IF_PROTO_HDLC 0x2000 /* raw HDLC protocol */ +#define IF_PROTO_PPP 0x2001 /* PPP protocol */ +#define IF_PROTO_CISCO 0x2002 /* Cisco HDLC protocol */ +#define IF_PROTO_FR 0x2003 /* Frame Relay protocol */ +#define IF_PROTO_FR_ADD_PVC 0x2004 /* Create FR PVC */ +#define IF_PROTO_FR_DEL_PVC 0x2005 /* Delete FR PVC */ +#define IF_PROTO_X25 0x2006 /* X.25 */ +#define IF_PROTO_HDLC_ETH 0x2007 /* raw HDLC, Ethernet emulation */ +#define IF_PROTO_FR_ADD_ETH_PVC 0x2008 /* Create FR Ethernet-bridged PVC */ +#define IF_PROTO_FR_DEL_ETH_PVC 0x2009 /* Delete FR Ethernet-bridged PVC */ +#define IF_PROTO_FR_PVC 0x200A /* for reading PVC status */ +#define IF_PROTO_FR_ETH_PVC 0x200B +#define IF_PROTO_RAW 0x200C /* RAW Socket */ + +/* RFC 2863 operational status */ +enum { + IF_OPER_UNKNOWN, + IF_OPER_NOTPRESENT, + IF_OPER_DOWN, + IF_OPER_LOWERLAYERDOWN, + IF_OPER_TESTING, + IF_OPER_DORMANT, + IF_OPER_UP, +}; + +/* link modes */ +enum { + IF_LINK_MODE_DEFAULT, + IF_LINK_MODE_DORMANT, /* limit upward transition to dormant */ + IF_LINK_MODE_TESTING, /* limit upward transition to testing */ +}; + +/* + * Device mapping structure. I'd just gone off and designed a + * beautiful scheme using only loadable modules with arguments + * for driver options and along come the PCMCIA people 8) + * + * Ah well. The get() side of this is good for WDSETUP, and it'll + * be handy for debugging things. The set side is fine for now and + * being very small might be worth keeping for clean configuration. + */ + +/* for compatibility with glibc net/if.h */ +#if __UAPI_DEF_IF_IFMAP +struct ifmap { + unsigned long mem_start; + unsigned long mem_end; + unsigned short base_addr; + unsigned char irq; + unsigned char dma; + unsigned char port; + /* 3 bytes spare */ +}; +#endif /* __UAPI_DEF_IF_IFMAP */ + +struct if_settings { + unsigned int type; /* Type of physical device or protocol */ + unsigned int size; /* Size of the data allocated by the caller */ + union { + /* {atm/eth/dsl}_settings anyone ? */ + raw_hdlc_proto *raw_hdlc; + cisco_proto *cisco; + fr_proto *fr; + fr_proto_pvc *fr_pvc; + fr_proto_pvc_info *fr_pvc_info; + x25_hdlc_proto *x25; + + /* interface settings */ + sync_serial_settings *sync; + te1_settings *te1; + } ifs_ifsu; +}; + +/* + * Interface request structure used for socket + * ioctl's. All interface ioctl's must have parameter + * definitions which begin with ifr_name. The + * remainder may be interface specific. + */ + +/* for compatibility with glibc net/if.h */ +#if __UAPI_DEF_IF_IFREQ +struct ifreq { +#define IFHWADDRLEN 6 + union + { + char ifrn_name[IFNAMSIZ]; /* if name, e.g. "en0" */ + } ifr_ifrn; + + union { + struct sockaddr ifru_addr; + struct sockaddr ifru_dstaddr; + struct sockaddr ifru_broadaddr; + struct sockaddr ifru_netmask; + struct sockaddr ifru_hwaddr; + short ifru_flags; + int ifru_ivalue; + int ifru_mtu; + struct ifmap ifru_map; + char ifru_slave[IFNAMSIZ]; /* Just fits the size */ + char ifru_newname[IFNAMSIZ]; + void * ifru_data; + struct if_settings ifru_settings; + } ifr_ifru; +}; +#endif /* __UAPI_DEF_IF_IFREQ */ + +#define ifr_name ifr_ifrn.ifrn_name /* interface name */ +#define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */ +#define ifr_addr ifr_ifru.ifru_addr /* address */ +#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-p lnk */ +#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */ +#define ifr_netmask ifr_ifru.ifru_netmask /* interface net mask */ +#define ifr_flags ifr_ifru.ifru_flags /* flags */ +#define ifr_metric ifr_ifru.ifru_ivalue /* metric */ +#define ifr_mtu ifr_ifru.ifru_mtu /* mtu */ +#define ifr_map ifr_ifru.ifru_map /* device map */ +#define ifr_slave ifr_ifru.ifru_slave /* slave device */ +#define ifr_data ifr_ifru.ifru_data /* for use by interface */ +#define ifr_ifindex ifr_ifru.ifru_ivalue /* interface index */ +#define ifr_bandwidth ifr_ifru.ifru_ivalue /* link bandwidth */ +#define ifr_qlen ifr_ifru.ifru_ivalue /* Queue length */ +#define ifr_newname ifr_ifru.ifru_newname /* New name */ +#define ifr_settings ifr_ifru.ifru_settings /* Device/proto settings*/ + +/* + * Structure used in SIOCGIFCONF request. + * Used to retrieve interface configuration + * for machine (useful for programs which + * must know all networks accessible). + */ + +/* for compatibility with glibc net/if.h */ +#if __UAPI_DEF_IF_IFCONF +struct ifconf { + int ifc_len; /* size of buffer */ + union { + char *ifcu_buf; + struct ifreq *ifcu_req; + } ifc_ifcu; +}; +#endif /* __UAPI_DEF_IF_IFCONF */ + +#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */ +#define ifc_req ifc_ifcu.ifcu_req /* array of structures */ + +#endif /* _LINUX_IF_H */ 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.1/uapi/linux/if_link.h new/ethtool-6.2/uapi/linux/if_link.h --- old/ethtool-6.1/uapi/linux/if_link.h 2022-12-19 18:00:47.000000000 +0100 +++ new/ethtool-6.2/uapi/linux/if_link.h 2023-02-21 15:14:45.000000000 +0100 @@ -372,6 +372,8 @@ IFLA_TSO_MAX_SEGS, IFLA_ALLMULTI, /* Allmulti count: > 0 means acts ALLMULTI */ + IFLA_DEVLINK_PORT, + __IFLA_MAX }; @@ -559,6 +561,7 @@ IFLA_BRPORT_MCAST_EHT_HOSTS_LIMIT, IFLA_BRPORT_MCAST_EHT_HOSTS_CNT, IFLA_BRPORT_LOCKED, + IFLA_BRPORT_MAB, __IFLA_BRPORT_MAX }; #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1) 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.1/uapi/linux/net_tstamp.h new/ethtool-6.2/uapi/linux/net_tstamp.h --- old/ethtool-6.1/uapi/linux/net_tstamp.h 2022-12-16 10:49:20.000000000 +0100 +++ new/ethtool-6.2/uapi/linux/net_tstamp.h 2023-02-15 11:09:59.000000000 +0100 @@ -31,8 +31,9 @@ SOF_TIMESTAMPING_OPT_PKTINFO = (1<<13), SOF_TIMESTAMPING_OPT_TX_SWHW = (1<<14), SOF_TIMESTAMPING_BIND_PHC = (1 << 15), + SOF_TIMESTAMPING_OPT_ID_TCP = (1 << 16), - SOF_TIMESTAMPING_LAST = SOF_TIMESTAMPING_BIND_PHC, + SOF_TIMESTAMPING_LAST = SOF_TIMESTAMPING_OPT_ID_TCP, SOF_TIMESTAMPING_MASK = (SOF_TIMESTAMPING_LAST - 1) | SOF_TIMESTAMPING_LAST };