Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ethtool for openSUSE:Factory checked in at 2022-04-13 21:03:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ethtool (Old) and /work/SRC/openSUSE:Factory/.ethtool.new.1900 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ethtool" Wed Apr 13 21:03:56 2022 rev:72 rq:968300 version:5.17 Changes: -------- --- /work/SRC/openSUSE:Factory/ethtool/ethtool.changes 2022-01-27 23:16:48.411044511 +0100 +++ /work/SRC/openSUSE:Factory/.ethtool.new.1900/ethtool.changes 2022-04-13 21:03:56.596516175 +0200 @@ -1,0 +2,13 @@ +Mon Apr 4 00:11:20 UTC 2022 - Michal Kubecek <mkube...@suse.cz> + +- update to upstream release 5.17 + * Feature: transceiver module power mode (--set-module) + * Feature: transceiver module extended state (--show-module) + * Feature: get/set rx buffer length (-g and -G) + * Feature: tx copybreak buffer size (--get-tunable and + --set-tunable) + * Feature: JSON output for features (-k) + * Feature: support OSFP transceiver modules (-m) + * Fix: add missing free() calls (--get-tunable and --set-tunable) + +------------------------------------------------------------------- Old: ---- ethtool-5.16.tar.sign ethtool-5.16.tar.xz New: ---- ethtool-5.17.tar.sign ethtool-5.17.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ethtool.spec ++++++ --- /var/tmp/diff_new_pack.kjMGTm/_old 2022-04-13 21:03:57.368516792 +0200 +++ /var/tmp/diff_new_pack.kjMGTm/_new 2022-04-13 21:03:57.372516795 +0200 @@ -17,7 +17,7 @@ Name: ethtool -Version: 5.16 +Version: 5.17 Release: 0 Summary: Utility for examining and tuning Ethernet-based network interfaces License: GPL-2.0-only ++++++ ethtool-5.16.tar.xz -> ethtool-5.17.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-5.16/Makefile.am new/ethtool-5.17/Makefile.am --- old/ethtool-5.16/Makefile.am 2022-01-19 00:07:57.000000000 +0100 +++ new/ethtool-5.17/Makefile.am 2022-01-19 00:46:20.000000000 +0100 @@ -39,7 +39,7 @@ 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-eeprom.c netlink/module.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 \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-5.16/Makefile.in new/ethtool-5.17/Makefile.in --- old/ethtool-5.16/Makefile.in 2022-01-19 00:23:46.000000000 +0100 +++ new/ethtool-5.17/Makefile.in 2022-04-04 00:25:57.000000000 +0200 @@ -109,7 +109,7 @@ @ETHTOOL_ENABLE_NETLINK_TRUE@ netlink/eee.c netlink/tsinfo.c netlink/fec.c \ @ETHTOOL_ENABLE_NETLINK_TRUE@ netlink/stats.c \ @ETHTOOL_ENABLE_NETLINK_TRUE@ netlink/desc-ethtool.c netlink/desc-genlctrl.c \ -@ETHTOOL_ENABLE_NETLINK_TRUE@ netlink/module-eeprom.c \ +@ETHTOOL_ENABLE_NETLINK_TRUE@ netlink/module-eeprom.c netlink/module.c \ @ETHTOOL_ENABLE_NETLINK_TRUE@ netlink/desc-rtnl.c netlink/cable_test.c netlink/tunnels.c \ @ETHTOOL_ENABLE_NETLINK_TRUE@ uapi/linux/ethtool_netlink.h \ @ETHTOOL_ENABLE_NETLINK_TRUE@ uapi/linux/netlink.h uapi/linux/genetlink.h \ @@ -157,7 +157,7 @@ netlink/rings.c netlink/channels.c netlink/coalesce.c \ netlink/pause.c 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/desc-rtnl.c \ + netlink/module-eeprom.c netlink/module.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 \ @@ -217,6 +217,7 @@ @ETHTOOL_ENABLE_NETLINK_TRUE@ netlink/desc-ethtool.$(OBJEXT) \ @ETHTOOL_ENABLE_NETLINK_TRUE@ netlink/desc-genlctrl.$(OBJEXT) \ @ETHTOOL_ENABLE_NETLINK_TRUE@ netlink/module-eeprom.$(OBJEXT) \ +@ETHTOOL_ENABLE_NETLINK_TRUE@ netlink/module.$(OBJEXT) \ @ETHTOOL_ENABLE_NETLINK_TRUE@ netlink/desc-rtnl.$(OBJEXT) \ @ETHTOOL_ENABLE_NETLINK_TRUE@ netlink/cable_test.$(OBJEXT) \ @ETHTOOL_ENABLE_NETLINK_TRUE@ netlink/tunnels.$(OBJEXT) @@ -246,7 +247,7 @@ netlink/channels.c netlink/coalesce.c netlink/pause.c \ 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/desc-rtnl.c \ + netlink/module-eeprom.c netlink/module.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 \ @@ -308,6 +309,7 @@ @ETHTOOL_ENABLE_NETLINK_TRUE@ netlink/test_cmdline-desc-ethtool.$(OBJEXT) \ @ETHTOOL_ENABLE_NETLINK_TRUE@ netlink/test_cmdline-desc-genlctrl.$(OBJEXT) \ @ETHTOOL_ENABLE_NETLINK_TRUE@ netlink/test_cmdline-module-eeprom.$(OBJEXT) \ +@ETHTOOL_ENABLE_NETLINK_TRUE@ netlink/test_cmdline-module.$(OBJEXT) \ @ETHTOOL_ENABLE_NETLINK_TRUE@ netlink/test_cmdline-desc-rtnl.$(OBJEXT) \ @ETHTOOL_ENABLE_NETLINK_TRUE@ netlink/test_cmdline-cable_test.$(OBJEXT) \ @ETHTOOL_ENABLE_NETLINK_TRUE@ netlink/test_cmdline-tunnels.$(OBJEXT) @@ -342,7 +344,7 @@ netlink/rings.c netlink/channels.c netlink/coalesce.c \ netlink/pause.c 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/desc-rtnl.c \ + netlink/module-eeprom.c netlink/module.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 \ @@ -404,6 +406,7 @@ @ETHTOOL_ENABLE_NETLINK_TRUE@ netlink/test_features-desc-ethtool.$(OBJEXT) \ @ETHTOOL_ENABLE_NETLINK_TRUE@ netlink/test_features-desc-genlctrl.$(OBJEXT) \ @ETHTOOL_ENABLE_NETLINK_TRUE@ netlink/test_features-module-eeprom.$(OBJEXT) \ +@ETHTOOL_ENABLE_NETLINK_TRUE@ netlink/test_features-module.$(OBJEXT) \ @ETHTOOL_ENABLE_NETLINK_TRUE@ netlink/test_features-desc-rtnl.$(OBJEXT) \ @ETHTOOL_ENABLE_NETLINK_TRUE@ netlink/test_features-cable_test.$(OBJEXT) \ @ETHTOOL_ENABLE_NETLINK_TRUE@ netlink/test_features-tunnels.$(OBJEXT) @@ -976,6 +979,8 @@ netlink/$(DEPDIR)/$(am__dirstamp) netlink/module-eeprom.$(OBJEXT): netlink/$(am__dirstamp) \ netlink/$(DEPDIR)/$(am__dirstamp) +netlink/module.$(OBJEXT): netlink/$(am__dirstamp) \ + netlink/$(DEPDIR)/$(am__dirstamp) netlink/desc-rtnl.$(OBJEXT): netlink/$(am__dirstamp) \ netlink/$(DEPDIR)/$(am__dirstamp) netlink/cable_test.$(OBJEXT): netlink/$(am__dirstamp) \ @@ -1032,6 +1037,8 @@ netlink/$(DEPDIR)/$(am__dirstamp) netlink/test_cmdline-module-eeprom.$(OBJEXT): netlink/$(am__dirstamp) \ netlink/$(DEPDIR)/$(am__dirstamp) +netlink/test_cmdline-module.$(OBJEXT): netlink/$(am__dirstamp) \ + netlink/$(DEPDIR)/$(am__dirstamp) netlink/test_cmdline-desc-rtnl.$(OBJEXT): netlink/$(am__dirstamp) \ netlink/$(DEPDIR)/$(am__dirstamp) netlink/test_cmdline-cable_test.$(OBJEXT): netlink/$(am__dirstamp) \ @@ -1088,6 +1095,8 @@ netlink/$(am__dirstamp) netlink/$(DEPDIR)/$(am__dirstamp) netlink/test_features-module-eeprom.$(OBJEXT): \ netlink/$(am__dirstamp) netlink/$(DEPDIR)/$(am__dirstamp) +netlink/test_features-module.$(OBJEXT): netlink/$(am__dirstamp) \ + netlink/$(DEPDIR)/$(am__dirstamp) netlink/test_features-desc-rtnl.$(OBJEXT): netlink/$(am__dirstamp) \ netlink/$(DEPDIR)/$(am__dirstamp) netlink/test_features-cable_test.$(OBJEXT): netlink/$(am__dirstamp) \ @@ -1238,6 +1247,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@netlink/$(DEPDIR)/features.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@netlink/$(DEPDIR)/fec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@netlink/$(DEPDIR)/module-eeprom.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@netlink/$(DEPDIR)/module.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@netlink/$(DEPDIR)/monitor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@netlink/$(DEPDIR)/msgbuff.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@netlink/$(DEPDIR)/netlink.Po@am__quote@ @@ -1262,6 +1272,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@netlink/$(DEPDIR)/test_cmdline-features.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@netlink/$(DEPDIR)/test_cmdline-fec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@netlink/$(DEPDIR)/test_cmdline-module-eeprom.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@netlink/$(DEPDIR)/test_cmdline-module.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@netlink/$(DEPDIR)/test_cmdline-monitor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@netlink/$(DEPDIR)/test_cmdline-msgbuff.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@netlink/$(DEPDIR)/test_cmdline-netlink.Po@am__quote@ @@ -1288,6 +1299,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@netlink/$(DEPDIR)/test_features-features.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@netlink/$(DEPDIR)/test_features-fec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@netlink/$(DEPDIR)/test_features-module-eeprom.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@netlink/$(DEPDIR)/test_features-module.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@netlink/$(DEPDIR)/test_features-monitor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@netlink/$(DEPDIR)/test_features-msgbuff.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@netlink/$(DEPDIR)/test_features-netlink.Po@am__quote@ @@ -2218,6 +2230,20 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_cmdline_CFLAGS) $(CFLAGS) -c -o netlink/test_cmdline-module-eeprom.obj `if test -f 'netlink/module-eeprom.c'; then $(CYGPATH_W) 'netlink/module-eeprom.c'; else $(CYGPATH_W) '$(srcdir)/netlink/module-eeprom.c'; fi` +netlink/test_cmdline-module.o: netlink/module.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_cmdline_CFLAGS) $(CFLAGS) -MT netlink/test_cmdline-module.o -MD -MP -MF netlink/$(DEPDIR)/test_cmdline-module.Tpo -c -o netlink/test_cmdline-module.o `test -f 'netlink/module.c' || echo '$(srcdir)/'`netlink/module.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) netlink/$(DEPDIR)/test_cmdline-module.Tpo netlink/$(DEPDIR)/test_cmdline-module.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netlink/module.c' object='netlink/test_cmdline-module.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_cmdline_CFLAGS) $(CFLAGS) -c -o netlink/test_cmdline-module.o `test -f 'netlink/module.c' || echo '$(srcdir)/'`netlink/module.c + +netlink/test_cmdline-module.obj: netlink/module.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_cmdline_CFLAGS) $(CFLAGS) -MT netlink/test_cmdline-module.obj -MD -MP -MF netlink/$(DEPDIR)/test_cmdline-module.Tpo -c -o netlink/test_cmdline-module.obj `if test -f 'netlink/module.c'; then $(CYGPATH_W) 'netlink/module.c'; else $(CYGPATH_W) '$(srcdir)/netlink/module.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) netlink/$(DEPDIR)/test_cmdline-module.Tpo netlink/$(DEPDIR)/test_cmdline-module.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netlink/module.c' object='netlink/test_cmdline-module.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_cmdline_CFLAGS) $(CFLAGS) -c -o netlink/test_cmdline-module.obj `if test -f 'netlink/module.c'; then $(CYGPATH_W) 'netlink/module.c'; else $(CYGPATH_W) '$(srcdir)/netlink/module.c'; fi` + netlink/test_cmdline-desc-rtnl.o: netlink/desc-rtnl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_cmdline_CFLAGS) $(CFLAGS) -MT netlink/test_cmdline-desc-rtnl.o -MD -MP -MF netlink/$(DEPDIR)/test_cmdline-desc-rtnl.Tpo -c -o netlink/test_cmdline-desc-rtnl.o `test -f 'netlink/desc-rtnl.c' || echo '$(srcdir)/'`netlink/desc-rtnl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) netlink/$(DEPDIR)/test_cmdline-desc-rtnl.Tpo netlink/$(DEPDIR)/test_cmdline-desc-rtnl.Po @@ -3156,6 +3182,20 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_features_CFLAGS) $(CFLAGS) -c -o netlink/test_features-module-eeprom.obj `if test -f 'netlink/module-eeprom.c'; then $(CYGPATH_W) 'netlink/module-eeprom.c'; else $(CYGPATH_W) '$(srcdir)/netlink/module-eeprom.c'; fi` +netlink/test_features-module.o: netlink/module.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_features_CFLAGS) $(CFLAGS) -MT netlink/test_features-module.o -MD -MP -MF netlink/$(DEPDIR)/test_features-module.Tpo -c -o netlink/test_features-module.o `test -f 'netlink/module.c' || echo '$(srcdir)/'`netlink/module.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) netlink/$(DEPDIR)/test_features-module.Tpo netlink/$(DEPDIR)/test_features-module.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netlink/module.c' object='netlink/test_features-module.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_features_CFLAGS) $(CFLAGS) -c -o netlink/test_features-module.o `test -f 'netlink/module.c' || echo '$(srcdir)/'`netlink/module.c + +netlink/test_features-module.obj: netlink/module.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_features_CFLAGS) $(CFLAGS) -MT netlink/test_features-module.obj -MD -MP -MF netlink/$(DEPDIR)/test_features-module.Tpo -c -o netlink/test_features-module.obj `if test -f 'netlink/module.c'; then $(CYGPATH_W) 'netlink/module.c'; else $(CYGPATH_W) '$(srcdir)/netlink/module.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) netlink/$(DEPDIR)/test_features-module.Tpo netlink/$(DEPDIR)/test_features-module.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netlink/module.c' object='netlink/test_features-module.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_features_CFLAGS) $(CFLAGS) -c -o netlink/test_features-module.obj `if test -f 'netlink/module.c'; then $(CYGPATH_W) 'netlink/module.c'; else $(CYGPATH_W) '$(srcdir)/netlink/module.c'; fi` + netlink/test_features-desc-rtnl.o: netlink/desc-rtnl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_features_CFLAGS) $(CFLAGS) -MT netlink/test_features-desc-rtnl.o -MD -MP -MF netlink/$(DEPDIR)/test_features-desc-rtnl.Tpo -c -o netlink/test_features-desc-rtnl.o `test -f 'netlink/desc-rtnl.c' || echo '$(srcdir)/'`netlink/desc-rtnl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) netlink/$(DEPDIR)/test_features-desc-rtnl.Tpo netlink/$(DEPDIR)/test_features-desc-rtnl.Po diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-5.16/NEWS new/ethtool-5.17/NEWS --- old/ethtool-5.16/NEWS 2022-01-19 00:10:01.000000000 +0100 +++ new/ethtool-5.17/NEWS 2022-04-04 00:22:51.000000000 +0200 @@ -1,3 +1,12 @@ +Version 5.17 - April 4, 2022 + * Feature: transceiver module power mode (--set-module) + * Feature: transceiver module extended state (--show-module) + * Feature: get/set rx buffer length (-g and -G) + * Feature: tx copybreak buffer size (--get-tunable and --set-tunable) + * Feature: JSON output for features (-k) + * Feature: support OSFP transceiver modules (-m) + * Fix: add missing free() calls (--get-tunable and --set-tunable) + Version 5.16 - January 19, 2022 * Feature: use memory maps for module EEPROM parsing (-m) * Feature: show CMIS diagnostic information (-m) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-5.16/configure new/ethtool-5.17/configure --- old/ethtool-5.16/configure 2022-01-19 00:23:46.000000000 +0100 +++ new/ethtool-5.17/configure 2022-04-04 00:25:57.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for ethtool 5.16. +# Generated by GNU Autoconf 2.69 for ethtool 5.17. # # Report bugs to <net...@vger.kernel.org>. # @@ -580,8 +580,8 @@ # Identity of this package. PACKAGE_NAME='ethtool' PACKAGE_TARNAME='ethtool' -PACKAGE_VERSION='5.16' -PACKAGE_STRING='ethtool 5.16' +PACKAGE_VERSION='5.17' +PACKAGE_STRING='ethtool 5.17' PACKAGE_BUGREPORT='net...@vger.kernel.org' PACKAGE_URL='' @@ -1254,7 +1254,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ethtool 5.16 to adapt to many kinds of systems. +\`configure' configures ethtool 5.17 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1320,7 +1320,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ethtool 5.16:";; + short | recursive ) echo "Configuration of ethtool 5.17:";; esac cat <<\_ACEOF @@ -1430,7 +1430,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ethtool configure 5.16 +ethtool configure 5.17 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1677,7 +1677,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ethtool $as_me 5.16, which was +It was created by ethtool $as_me 5.17, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2542,7 +2542,7 @@ # Define the identity of the package. PACKAGE='ethtool' - VERSION='5.16' + VERSION='5.17' cat >>confdefs.h <<_ACEOF @@ -5122,7 +5122,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ethtool $as_me 5.16, which was +This file was extended by ethtool $as_me 5.17, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5188,7 +5188,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -ethtool config.status 5.16 +ethtool config.status 5.17 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-5.16/configure.ac new/ethtool-5.17/configure.ac --- old/ethtool-5.16/configure.ac 2022-01-19 00:09:01.000000000 +0100 +++ new/ethtool-5.17/configure.ac 2022-04-04 00:10:29.000000000 +0200 @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(ethtool, 5.16, net...@vger.kernel.org) +AC_INIT(ethtool, 5.17, 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' old/ethtool-5.16/ethtool.8 new/ethtool-5.17/ethtool.8 --- old/ethtool-5.16/ethtool.8 2022-01-19 00:23:47.000000000 +0100 +++ new/ethtool-5.17/ethtool.8 2022-04-04 00:26:02.000000000 +0200 @@ -117,7 +117,7 @@ . hy \\n(HY .. . -.TH ETHTOOL 8 "January 2022" "Ethtool version 5.16" +.TH ETHTOOL 8 "April 2022" "Ethtool version 5.17" .SH NAME ethtool \- query or control network driver and hardware settings . @@ -198,6 +198,7 @@ .BN rx\-mini .BN rx\-jumbo .BN tx +.BN rx\-buf\-len .HP .B ethtool \-i|\-\-driver .I devname @@ -417,12 +418,14 @@ .I devname .RB [ rx-copybreak ] .RB [ tx-copybreak ] +.RB [ tx-buf-size ] .RB [ pfc-prevention-tout ] .HP .B ethtool \-\-set\-tunable .I devname .BN rx\-copybreak .BN tx\-copybreak +.BN tx\-buf\-size .BN pfc\-prevention\-tout .HP .B ethtool \-\-reset @@ -477,6 +480,14 @@ .HP .B ethtool \-\-show\-tunnels .I devname +.HP +.B ethtool \-\-show\-module +.I devname +.HP +.B ethtool \-\-set\-module +.I devname +.RB [ power\-mode\-policy +.BR high | auto ] . .\" Adjust lines (i.e. full justification) and hyphenate. .ad @@ -559,6 +570,9 @@ .TP .BI tx \ N Changes the number of ring entries for the Tx ring. +.TP +.BI rx\-buf\-len \ N +Changes the size of a buffer in the Rx ring. .RE .TP .B \-i \-\-driver @@ -1306,6 +1320,9 @@ .B tx\-copybreak Get the current tx copybreak value in bytes. .TP +.B tx\-buf\-size +Get the current tx copybreak buffer size in bytes. +.TP .B pfc\-prevention\-tout Get the current pfc prevention timeout value in msecs. .RE @@ -1320,6 +1337,9 @@ .BI tx\-copybreak \ N Set the tx copybreak value in bytes. .TP +.BI tx\-buf\-size \ N +Set the tx copybreak buffer size in bytes. +.TP .BI pfc\-prevention\-tout \ N Set pfc prevention timeout in msecs. Value of 0 means disable and 65535 means auto. .RE @@ -1460,6 +1480,23 @@ List UDP ports kernel has programmed the device to parse as VxLAN, or GENEVE tunnels. .RE +.TP +.B \-\-show\-module +Show the transceiver module's parameters. +.RE +.TP +.B \-\-set\-module +Set the transceiver module's parameters. +.RS 4 +.TP +.A2 power-mode-policy high auto +Set the power mode policy for the module. When set to \fBhigh\fR, the module +always operates at high power mode. When set to \fBauto\fR, the module is +transitioned by the host to high power mode when the first port using it is put +administratively up and to low power mode when the last port using it is put +administratively down. The power mode policy can be set before a module is +plugged-in. +.RE .SH BUGS Not supported (in part or whole) on all network drivers. .SH AUTHOR diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-5.16/ethtool.8.in new/ethtool-5.17/ethtool.8.in --- old/ethtool-5.16/ethtool.8.in 2022-01-19 00:09:01.000000000 +0100 +++ new/ethtool-5.17/ethtool.8.in 2022-04-04 00:10:48.000000000 +0200 @@ -117,7 +117,7 @@ . hy \\n(HY .. . -.TH ETHTOOL 8 "January 2022" "Ethtool version @VERSION@" +.TH ETHTOOL 8 "April 2022" "Ethtool version @VERSION@" .SH NAME ethtool \- query or control network driver and hardware settings . @@ -198,6 +198,7 @@ .BN rx\-mini .BN rx\-jumbo .BN tx +.BN rx\-buf\-len .HP .B ethtool \-i|\-\-driver .I devname @@ -417,12 +418,14 @@ .I devname .RB [ rx-copybreak ] .RB [ tx-copybreak ] +.RB [ tx-buf-size ] .RB [ pfc-prevention-tout ] .HP .B ethtool \-\-set\-tunable .I devname .BN rx\-copybreak .BN tx\-copybreak +.BN tx\-buf\-size .BN pfc\-prevention\-tout .HP .B ethtool \-\-reset @@ -477,6 +480,14 @@ .HP .B ethtool \-\-show\-tunnels .I devname +.HP +.B ethtool \-\-show\-module +.I devname +.HP +.B ethtool \-\-set\-module +.I devname +.RB [ power\-mode\-policy +.BR high | auto ] . .\" Adjust lines (i.e. full justification) and hyphenate. .ad @@ -559,6 +570,9 @@ .TP .BI tx \ N Changes the number of ring entries for the Tx ring. +.TP +.BI rx\-buf\-len \ N +Changes the size of a buffer in the Rx ring. .RE .TP .B \-i \-\-driver @@ -1306,6 +1320,9 @@ .B tx\-copybreak Get the current tx copybreak value in bytes. .TP +.B tx\-buf\-size +Get the current tx copybreak buffer size in bytes. +.TP .B pfc\-prevention\-tout Get the current pfc prevention timeout value in msecs. .RE @@ -1320,6 +1337,9 @@ .BI tx\-copybreak \ N Set the tx copybreak value in bytes. .TP +.BI tx\-buf\-size \ N +Set the tx copybreak buffer size in bytes. +.TP .BI pfc\-prevention\-tout \ N Set pfc prevention timeout in msecs. Value of 0 means disable and 65535 means auto. .RE @@ -1460,6 +1480,23 @@ List UDP ports kernel has programmed the device to parse as VxLAN, or GENEVE tunnels. .RE +.TP +.B \-\-show\-module +Show the transceiver module's parameters. +.RE +.TP +.B \-\-set\-module +Set the transceiver module's parameters. +.RS 4 +.TP +.A2 power-mode-policy high auto +Set the power mode policy for the module. When set to \fBhigh\fR, the module +always operates at high power mode. When set to \fBauto\fR, the module is +transitioned by the host to high power mode when the first port using it is put +administratively up and to low power mode when the last port using it is put +administratively down. The power mode policy can be set before a module is +plugged-in. +.RE .SH BUGS Not supported (in part or whole) on all network drivers. .SH AUTHOR diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-5.16/ethtool.c new/ethtool-5.17/ethtool.c --- old/ethtool-5.16/ethtool.c 2022-01-19 00:07:57.000000000 +0100 +++ new/ethtool-5.17/ethtool.c 2022-04-04 00:08:42.000000000 +0200 @@ -5009,6 +5009,7 @@ [ETHTOOL_ID_UNSPEC] = "Unspec", [ETHTOOL_RX_COPYBREAK] = "rx-copybreak", [ETHTOOL_TX_COPYBREAK] = "tx-copybreak", + [ETHTOOL_TX_COPYBREAK_BUF_SIZE] = "tx-buf-size", [ETHTOOL_PFC_PREVENTION_TOUT] = "pfc-prevention-tout", }; @@ -5048,6 +5049,11 @@ .size = sizeof(u16), .type = CMDL_U16, }, + { .t_id = ETHTOOL_TX_COPYBREAK_BUF_SIZE, + .t_type_id = ETHTOOL_TUNABLE_U32, + .size = sizeof(u32), + .type = CMDL_U32, + }, }; #define TUNABLES_INFO_SIZE ARRAY_SIZE(tunables_info) @@ -5091,6 +5097,7 @@ ret = send_ioctl(ctx, tuna); if (ret) { perror(tunable_strings[tuna->id]); + free(tuna); return ret; } free(tuna); @@ -5168,6 +5175,7 @@ ret = send_ioctl(ctx, tuna); if (ret) { fprintf(stderr, "%s: Cannot get tunable\n", ts); + free(tuna); return ret; } print_tunable(tuna); @@ -5724,9 +5732,11 @@ " [ rx-mini N ]\n" " [ rx-jumbo N ]\n" " [ tx N ]\n" + " [ rx-buf-len N]\n" }, { .opts = "-k|--show-features|--show-offload", + .json = true, .func = do_gfeatures, .nlfunc = nl_gfeatures, .help = "Get state of protocol offload and other features" @@ -5960,6 +5970,7 @@ .help = "Get tunable", .xhelp = " [ rx-copybreak ]\n" " [ tx-copybreak ]\n" + " [ tx-buf-size ]\n" " [ pfc-precention-tout ]\n" }, { @@ -5968,6 +5979,7 @@ .help = "Set tunable", .xhelp = " [ rx-copybreak N]\n" " [ tx-copybreak N]\n" + " [ tx-buf-size N]\n" " [ pfc-precention-tout N]\n" }, { @@ -6039,6 +6051,18 @@ .help = "Show NIC tunnel offload information", }, { + .opts = "--show-module", + .json = true, + .nlfunc = nl_gmodule, + .help = "Show transceiver module settings", + }, + { + .opts = "--set-module", + .nlfunc = nl_smodule, + .help = "Set transceiver module settings", + .xhelp = " [ power-mode-policy high|auto ]\n" + }, + { .opts = "-h|--help", .no_dev = true, .func = show_usage, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-5.16/ethtool.spec new/ethtool-5.17/ethtool.spec --- old/ethtool-5.16/ethtool.spec 2022-01-19 00:23:48.000000000 +0100 +++ new/ethtool-5.17/ethtool.spec 2022-04-04 00:26:02.000000000 +0200 @@ -1,5 +1,5 @@ Name : ethtool -Version : 5.16 +Version : 5.17 Release : 1 Group : Utilities diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-5.16/netlink/desc-ethtool.c new/ethtool-5.17/netlink/desc-ethtool.c --- old/ethtool-5.16/netlink/desc-ethtool.c 2022-01-19 00:07:57.000000000 +0100 +++ new/ethtool-5.17/netlink/desc-ethtool.c 2022-01-19 00:46:20.000000000 +0100 @@ -392,6 +392,13 @@ NLATTR_DESC_BINARY(ETHTOOL_A_PHC_VCLOCKS_INDEX), }; +static const struct pretty_nla_desc __module_desc[] = { + NLATTR_DESC_INVALID(ETHTOOL_A_MODULE_UNSPEC), + NLATTR_DESC_NESTED(ETHTOOL_A_MODULE_HEADER, header), + NLATTR_DESC_U8(ETHTOOL_A_MODULE_POWER_MODE_POLICY), + NLATTR_DESC_U8(ETHTOOL_A_MODULE_POWER_MODE), +}; + const struct pretty_nlmsg_desc ethnl_umsg_desc[] = { NLMSG_DESC_INVALID(ETHTOOL_MSG_USER_NONE), NLMSG_DESC(ETHTOOL_MSG_STRSET_GET, strset), @@ -427,6 +434,8 @@ NLMSG_DESC(ETHTOOL_MSG_MODULE_EEPROM_GET, module_eeprom), NLMSG_DESC(ETHTOOL_MSG_STATS_GET, stats), NLMSG_DESC(ETHTOOL_MSG_PHC_VCLOCKS_GET, phc_vclocks), + NLMSG_DESC(ETHTOOL_MSG_MODULE_GET, module), + NLMSG_DESC(ETHTOOL_MSG_MODULE_SET, module), }; const unsigned int ethnl_umsg_n_desc = ARRAY_SIZE(ethnl_umsg_desc); @@ -467,6 +476,8 @@ NLMSG_DESC(ETHTOOL_MSG_MODULE_EEPROM_GET_REPLY, module_eeprom), NLMSG_DESC(ETHTOOL_MSG_STATS_GET_REPLY, stats), NLMSG_DESC(ETHTOOL_MSG_PHC_VCLOCKS_GET_REPLY, phc_vclocks), + NLMSG_DESC(ETHTOOL_MSG_MODULE_GET_REPLY, module), + NLMSG_DESC(ETHTOOL_MSG_MODULE_NTF, module), }; const unsigned int ethnl_kmsg_n_desc = ARRAY_SIZE(ethnl_kmsg_desc); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-5.16/netlink/extapi.h new/ethtool-5.17/netlink/extapi.h --- old/ethtool-5.16/netlink/extapi.h 2022-01-19 00:07:57.000000000 +0100 +++ new/ethtool-5.17/netlink/extapi.h 2022-01-19 00:46:20.000000000 +0100 @@ -43,6 +43,8 @@ int nl_sfec(struct cmd_context *ctx); bool nl_gstats_chk(struct cmd_context *ctx); int nl_gstats(struct cmd_context *ctx); +int nl_gmodule(struct cmd_context *ctx); +int nl_smodule(struct cmd_context *ctx); int nl_monitor(struct cmd_context *ctx); int nl_getmodule(struct cmd_context *ctx); @@ -110,6 +112,8 @@ #define nl_gstats_chk NULL #define nl_gstats NULL #define nl_getmodule NULL +#define nl_gmodule NULL +#define nl_smodule NULL #endif /* ETHTOOL_ENABLE_NETLINK */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-5.16/netlink/features.c new/ethtool-5.17/netlink/features.c --- old/ethtool-5.16/netlink/features.c 2020-10-19 10:14:08.000000000 +0200 +++ new/ethtool-5.17/netlink/features.c 2022-04-03 18:24:49.000000000 +0200 @@ -82,8 +82,17 @@ feature_on(results->wanted, idx)) suffix = feature_on(results->wanted, idx) ? " [requested on]" : " [requested off]"; - printf("%s%s: %s%s\n", prefix, name, - feature_on(results->active, idx) ? "on" : "off", suffix); + if (is_json_context()) { + open_json_object(name); + print_bool(PRINT_JSON, "active", NULL, feature_on(results->active, idx)); + print_bool(PRINT_JSON, "fixed", NULL, + (!feature_on(results->hw, idx) || feature_on(results->nochange, idx))); + print_bool(PRINT_JSON, "requested", NULL, feature_on(results->wanted, idx)); + close_json_object(); + } else { + printf("%s%s: %s%s\n", prefix, name, + feature_on(results->active, idx) ? "on" : "off", suffix); + } } /* this assumes pattern contains no more than one asterisk */ @@ -153,9 +162,18 @@ feature_on(results.active, j); } } - if (n_match != 1) - printf("%s: %s\n", off_flag_def[i].long_name, - flag_value ? "on" : "off"); + if (n_match != 1) { + if (is_json_context()) { + open_json_object(off_flag_def[i].long_name); + print_bool(PRINT_JSON, "active", NULL, flag_value); + print_null(PRINT_JSON, "fixed", NULL, NULL); + print_null(PRINT_JSON, "requested", NULL, NULL); + close_json_object(); + } else { + printf("%s: %s\n", off_flag_def[i].long_name, + flag_value ? "on" : "off"); + } + } if (n_match == 0) continue; for (j = 0; j < results.count; j++) { @@ -210,8 +228,10 @@ if (silent) putchar('\n'); - printf("Features for %s:\n", nlctx->devname); + open_json_object(NULL); + print_string(PRINT_ANY, "ifname", "Features for %s:\n", nlctx->devname); ret = dump_features(tb, feature_names); + close_json_object(); return (silent || !ret) ? MNL_CB_OK : MNL_CB_ERROR; } @@ -234,7 +254,12 @@ ETHTOOL_FLAG_COMPACT_BITSETS); if (ret < 0) return ret; - return nlsock_send_get_request(nlsk, features_reply_cb); + + new_json_obj(ctx->json); + ret = nlsock_send_get_request(nlsk, features_reply_cb); + delete_json_obj(); + + return ret; } /* FEATURES_SET */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-5.16/netlink/module-eeprom.c new/ethtool-5.17/netlink/module-eeprom.c --- old/ethtool-5.16/netlink/module-eeprom.c 2021-12-02 22:38:42.000000000 +0100 +++ new/ethtool-5.17/netlink/module-eeprom.c 2022-04-03 18:24:49.000000000 +0200 @@ -223,6 +223,7 @@ case SFF8024_ID_QSFP_PLUS: return sff8636_show_all_nl(ctx); case SFF8024_ID_QSFP_DD: + case SFF8024_ID_OSFP: case SFF8024_ID_DSFP: return cmis_show_all_nl(ctx); #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-5.16/netlink/module.c new/ethtool-5.17/netlink/module.c --- old/ethtool-5.16/netlink/module.c 1970-01-01 01:00:00.000000000 +0100 +++ new/ethtool-5.17/netlink/module.c 2022-01-19 00:46:20.000000000 +0100 @@ -0,0 +1,179 @@ +/* + * module.c - netlink implementation of module commands + * + * Implementation of "ethtool --show-module <dev>" and + * "ethtool --set-module <dev> ..." + */ + +#include <errno.h> +#include <ctype.h> +#include <inttypes.h> +#include <string.h> +#include <stdio.h> + +#include "../internal.h" +#include "../common.h" +#include "netlink.h" +#include "parser.h" + +/* MODULE_GET */ + +static const char *module_power_mode_policy_name(u8 val) +{ + switch (val) { + case ETHTOOL_MODULE_POWER_MODE_POLICY_HIGH: + return "high"; + case ETHTOOL_MODULE_POWER_MODE_POLICY_AUTO: + return "auto"; + default: + return "unknown"; + } +} + +static const char *module_power_mode_name(u8 val) +{ + switch (val) { + case ETHTOOL_MODULE_POWER_MODE_LOW: + return "low"; + case ETHTOOL_MODULE_POWER_MODE_HIGH: + return "high"; + default: + return "unknown"; + } +} + +int module_reply_cb(const struct nlmsghdr *nlhdr, void *data) +{ + const struct nlattr *tb[ETHTOOL_A_MODULE_MAX + 1] = {}; + struct nl_context *nlctx = data; + DECLARE_ATTR_TB_INFO(tb); + 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_MODULE_HEADER]); + if (!dev_ok(nlctx)) + return err_ret; + + if (silent) + print_nl(); + + open_json_object(NULL); + + print_string(PRINT_ANY, "ifname", "Module parameters for %s:\n", + nlctx->devname); + + if (tb[ETHTOOL_A_MODULE_POWER_MODE_POLICY]) { + u8 val; + + val = mnl_attr_get_u8(tb[ETHTOOL_A_MODULE_POWER_MODE_POLICY]); + print_string(PRINT_ANY, "power-mode-policy", + "power-mode-policy: %s\n", + module_power_mode_policy_name(val)); + } + + if (tb[ETHTOOL_A_MODULE_POWER_MODE]) { + u8 val; + + val = mnl_attr_get_u8(tb[ETHTOOL_A_MODULE_POWER_MODE]); + print_string(PRINT_ANY, "power-mode", + "power-mode: %s\n", module_power_mode_name(val)); + } + + close_json_object(); + + return MNL_CB_OK; +} + +int nl_gmodule(struct cmd_context *ctx) +{ + struct nl_context *nlctx = ctx->nlctx; + struct nl_socket *nlsk; + int ret; + + if (netlink_cmd_check(ctx, ETHTOOL_MSG_MODULE_GET, true)) + return -EOPNOTSUPP; + if (ctx->argc > 0) { + fprintf(stderr, "ethtool: unexpected parameter '%s'\n", + *ctx->argp); + return 1; + } + + nlsk = nlctx->ethnl_socket; + ret = nlsock_prep_get_request(nlsk, ETHTOOL_MSG_MODULE_GET, + ETHTOOL_A_MODULE_HEADER, 0); + if (ret < 0) + return ret; + + new_json_obj(ctx->json); + ret = nlsock_send_get_request(nlsk, module_reply_cb); + delete_json_obj(); + return ret; +} + +/* MODULE_SET */ + +static const struct lookup_entry_u8 power_mode_policy_values[] = { + { .arg = "high", .val = ETHTOOL_MODULE_POWER_MODE_POLICY_HIGH }, + { .arg = "auto", .val = ETHTOOL_MODULE_POWER_MODE_POLICY_AUTO }, + {} +}; + +static const struct param_parser smodule_params[] = { + { + .arg = "power-mode-policy", + .type = ETHTOOL_A_MODULE_POWER_MODE_POLICY, + .handler = nl_parse_lookup_u8, + .handler_data = power_mode_policy_values, + .min_argc = 1, + }, + {} +}; + +int nl_smodule(struct cmd_context *ctx) +{ + struct nl_context *nlctx = ctx->nlctx; + struct nl_msg_buff *msgbuff; + struct nl_socket *nlsk; + int ret; + + if (netlink_cmd_check(ctx, ETHTOOL_MSG_MODULE_SET, false)) + return -EOPNOTSUPP; + if (!ctx->argc) { + fprintf(stderr, "ethtool (--set-module): parameters missing\n"); + return 1; + } + + nlctx->cmd = "--set-module"; + nlctx->argp = ctx->argp; + nlctx->argc = ctx->argc; + nlctx->devname = ctx->devname; + nlsk = nlctx->ethnl_socket; + msgbuff = &nlsk->msgbuff; + + ret = msg_init(nlctx, msgbuff, ETHTOOL_MSG_MODULE_SET, + NLM_F_REQUEST | NLM_F_ACK); + if (ret < 0) + return 2; + if (ethnla_fill_header(msgbuff, ETHTOOL_A_MODULE_HEADER, + ctx->devname, 0)) + return -EMSGSIZE; + + ret = nl_parser(nlctx, smodule_params, NULL, PARSER_GROUP_NONE, NULL); + if (ret < 0) + return 1; + + ret = nlsock_sendmsg(nlsk, NULL); + if (ret < 0) + return 83; + ret = nlsock_process_reply(nlsk, nomsg_reply_cb, nlctx); + if (ret == 0) + return 0; + else + return nlctx->exit_code ?: 83; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-5.16/netlink/monitor.c new/ethtool-5.17/netlink/monitor.c --- old/ethtool-5.16/netlink/monitor.c 2022-01-19 00:07:57.000000000 +0100 +++ new/ethtool-5.17/netlink/monitor.c 2022-01-19 00:46:20.000000000 +0100 @@ -71,6 +71,10 @@ .cmd = ETHTOOL_MSG_FEC_NTF, .cb = fec_reply_cb, }, + { + .cmd = ETHTOOL_MSG_MODULE_NTF, + .cb = module_reply_cb, + }, }; static void clear_filter(struct nl_context *nlctx) @@ -178,6 +182,10 @@ .pattern = "--cable-test-tdr", .cmd = ETHTOOL_MSG_CABLE_TEST_TDR_NTF, }, + { + .pattern = "--show-module|--set-module", + .cmd = ETHTOOL_MSG_MODULE_NTF, + }, }; static bool pattern_match(const char *s, const char *pattern) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-5.16/netlink/netlink.h new/ethtool-5.17/netlink/netlink.h --- old/ethtool-5.16/netlink/netlink.h 2022-01-19 00:07:57.000000000 +0100 +++ new/ethtool-5.17/netlink/netlink.h 2022-01-19 00:46:20.000000000 +0100 @@ -91,6 +91,7 @@ int cable_test_tdr_reply_cb(const struct nlmsghdr *nlhdr, void *data); int cable_test_tdr_ntf_cb(const struct nlmsghdr *nlhdr, void *data); int fec_reply_cb(const struct nlmsghdr *nlhdr, void *data); +int module_reply_cb(const struct nlmsghdr *nlhdr, void *data); /* dump helpers */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-5.16/netlink/rings.c new/ethtool-5.17/netlink/rings.c --- old/ethtool-5.16/netlink/rings.c 2022-01-19 00:07:57.000000000 +0100 +++ new/ethtool-5.17/netlink/rings.c 2022-01-19 00:46:20.000000000 +0100 @@ -46,6 +46,7 @@ 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"); return MNL_CB_OK; } @@ -98,6 +99,12 @@ .handler = nl_parse_direct_u32, .min_argc = 1, }, + { + .arg = "rx-buf-len", + .type = ETHTOOL_A_RINGS_RX_BUF_LEN, + .handler = nl_parse_direct_u32, + .min_argc = 1, + }, {} }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-5.16/netlink/settings.c new/ethtool-5.17/netlink/settings.c --- old/ethtool-5.16/netlink/settings.c 2022-01-19 00:07:57.000000000 +0100 +++ new/ethtool-5.17/netlink/settings.c 2022-01-19 00:46:20.000000000 +0100 @@ -593,6 +593,7 @@ [ETHTOOL_LINK_EXT_STATE_CALIBRATION_FAILURE] = "Calibration failure", [ETHTOOL_LINK_EXT_STATE_POWER_BUDGET_EXCEEDED] = "Power budget exceeded", [ETHTOOL_LINK_EXT_STATE_OVERHEAT] = "Overheat", + [ETHTOOL_LINK_EXT_STATE_MODULE] = "Module", }; static const char *const names_autoneg_link_ext_substate[] = { @@ -652,6 +653,11 @@ "Cable test failure", }; +static const char *const names_module_link_ext_substate[] = { + [ETHTOOL_LINK_EXT_SUBSTATE_MODULE_CMIS_NOT_READY] = + "CMIS module is not in ModuleReady state", +}; + static const char *link_ext_substate_get(uint8_t link_ext_state_val, uint8_t link_ext_substate_val) { switch (link_ext_state_val) { @@ -675,6 +681,10 @@ return get_enum_string(names_cable_issue_link_ext_substate, ARRAY_SIZE(names_cable_issue_link_ext_substate), link_ext_substate_val); + case ETHTOOL_LINK_EXT_STATE_MODULE: + return get_enum_string(names_module_link_ext_substate, + ARRAY_SIZE(names_module_link_ext_substate), + link_ext_substate_val); default: return NULL; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-5.16/netlink/strset.c new/ethtool-5.17/netlink/strset.c --- old/ethtool-5.16/netlink/strset.c 2020-08-07 14:30:25.000000000 +0200 +++ new/ethtool-5.17/netlink/strset.c 2022-04-04 00:08:42.000000000 +0200 @@ -147,10 +147,10 @@ devname); if (ret < 0) return MNL_CB_OK; - nlctx->devname = devname; + if (ifindex && nlctx->filter_devname && + strncmp(devname, nlctx->filter_devname, ALTIFNAMSIZ)) + return MNL_CB_OK; } - if (ifindex && !dev_ok(nlctx)) - return MNL_CB_OK; if (ifindex) { struct perdev_strings *perdev; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-5.16/qsfp.c new/ethtool-5.17/qsfp.c --- old/ethtool-5.16/qsfp.c 2021-12-02 22:59:33.000000000 +0100 +++ new/ethtool-5.17/qsfp.c 2022-04-03 18:24:49.000000000 +0200 @@ -947,7 +947,9 @@ { struct sff8636_memory_map map = {}; - if (id[SFF8636_ID_OFFSET] == SFF8024_ID_QSFP_DD) { + if (id[SFF8636_ID_OFFSET] == SFF8024_ID_QSFP_DD || + id[SFF8636_ID_OFFSET] == SFF8024_ID_OSFP || + id[SFF8636_ID_OFFSET] == SFF8024_ID_DSFP) { cmis_show_all_ioctl(id); return; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-5.16/sff-common.c new/ethtool-5.17/sff-common.c --- old/ethtool-5.16/sff-common.c 2021-07-09 00:16:22.000000000 +0200 +++ new/ethtool-5.17/sff-common.c 2022-04-03 18:24:49.000000000 +0200 @@ -139,6 +139,9 @@ case SFF8024_ID_QSFP_DD: printf(" (QSFP-DD Double Density 8X Pluggable Transceiver (INF-8628))\n"); break; + case SFF8024_ID_OSFP: + printf(" (OSFP 8X Pluggable Transceiver)\n"); + break; case SFF8024_ID_DSFP: printf(" (DSFP Dual Small Form Factor Pluggable Transceiver)\n"); break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-5.16/sff-common.h new/ethtool-5.17/sff-common.h --- old/ethtool-5.16/sff-common.h 2021-12-02 22:59:33.000000000 +0100 +++ new/ethtool-5.17/sff-common.h 2022-04-03 18:24:49.000000000 +0200 @@ -62,6 +62,7 @@ #define SFF8024_ID_CDFP_S3 0x16 #define SFF8024_ID_MICRO_QSFP 0x17 #define SFF8024_ID_QSFP_DD 0x18 +#define SFF8024_ID_OSFP 0x19 #define SFF8024_ID_DSFP 0x1B #define SFF8024_ID_LAST SFF8024_ID_DSFP #define SFF8024_ID_UNALLOCATED_LAST 0x7F diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-5.16/shell-completion/bash/ethtool new/ethtool-5.17/shell-completion/bash/ethtool --- old/ethtool-5.16/shell-completion/bash/ethtool 2022-01-19 00:07:57.000000000 +0100 +++ new/ethtool-5.17/shell-completion/bash/ethtool 2022-01-19 00:46:20.000000000 +0100 @@ -1137,6 +1137,27 @@ fi } +# Completion for ethtool --set-module +_ethtool_set_module() +{ + local -A settings=( + [power-mode-policy]=1 + ) + + case "$prev" in + power-mode-policy) + COMPREPLY=( $( compgen -W 'high auto' -- "$cur" ) ) + return ;; + esac + + # Remove settings which have been seen + local word + for word in "${words[@]:3:${#words[@]}-4}"; do + unset "settings[$word]" + done + + COMPREPLY=( $( compgen -W "${!settings[*]}" -- "$cur" ) ) +} # Complete any ethtool command _ethtool() @@ -1189,6 +1210,8 @@ [--show-time-stamping]=devname [--statistics]=devname [--test]=test + [--set-module]=set_module + [--show-module]=devname ) local -A other_funcs=( [--config-ntuple]=config_nfc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-5.16/uapi/linux/ethtool.h new/ethtool-5.17/uapi/linux/ethtool.h --- old/ethtool-5.16/uapi/linux/ethtool.h 2022-01-19 00:07:57.000000000 +0100 +++ new/ethtool-5.17/uapi/linux/ethtool.h 2022-01-19 00:46:20.000000000 +0100 @@ -229,6 +229,7 @@ ETHTOOL_RX_COPYBREAK, ETHTOOL_TX_COPYBREAK, ETHTOOL_PFC_PREVENTION_TOUT, /* timeout in msecs */ + ETHTOOL_TX_COPYBREAK_BUF_SIZE, /* * Add your fresh new tunable attribute above and remember to update * tunable_strings[] in net/ethtool/common.c @@ -601,6 +602,7 @@ ETHTOOL_LINK_EXT_STATE_CALIBRATION_FAILURE, ETHTOOL_LINK_EXT_STATE_POWER_BUDGET_EXCEEDED, ETHTOOL_LINK_EXT_STATE_OVERHEAT, + ETHTOOL_LINK_EXT_STATE_MODULE, }; /* More information in addition to ETHTOOL_LINK_EXT_STATE_AUTONEG. */ @@ -647,6 +649,11 @@ ETHTOOL_LINK_EXT_SUBSTATE_CI_CABLE_TEST_FAILURE, }; +/* More information in addition to ETHTOOL_LINK_EXT_STATE_MODULE. */ +enum ethtool_link_ext_substate_module { + ETHTOOL_LINK_EXT_SUBSTATE_MODULE_CMIS_NOT_READY = 1, +}; + #define ETH_GSTRING_LEN 32 /** @@ -705,6 +712,29 @@ }; /** + * enum ethtool_module_power_mode_policy - plug-in module power mode policy + * @ETHTOOL_MODULE_POWER_MODE_POLICY_HIGH: Module is always in high power mode. + * @ETHTOOL_MODULE_POWER_MODE_POLICY_AUTO: Module is transitioned by the host + * to high power mode when the first port using it is put administratively + * up and to low power mode when the last port using it is put + * administratively down. + */ +enum ethtool_module_power_mode_policy { + ETHTOOL_MODULE_POWER_MODE_POLICY_HIGH = 1, + ETHTOOL_MODULE_POWER_MODE_POLICY_AUTO, +}; + +/** + * enum ethtool_module_power_mode - plug-in module power mode + * @ETHTOOL_MODULE_POWER_MODE_LOW: Module is in low power mode. + * @ETHTOOL_MODULE_POWER_MODE_HIGH: Module is in high power mode. + */ +enum ethtool_module_power_mode { + ETHTOOL_MODULE_POWER_MODE_LOW = 1, + ETHTOOL_MODULE_POWER_MODE_HIGH, +}; + +/** * struct ethtool_gstrings - string set for data tagging * @cmd: Command number = %ETHTOOL_GSTRINGS * @string_set: String set ID; one of &enum ethtool_stringset diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-5.16/uapi/linux/ethtool_netlink.h new/ethtool-5.17/uapi/linux/ethtool_netlink.h --- old/ethtool-5.16/uapi/linux/ethtool_netlink.h 2022-01-19 00:07:57.000000000 +0100 +++ new/ethtool-5.17/uapi/linux/ethtool_netlink.h 2022-01-19 00:46:20.000000000 +0100 @@ -47,6 +47,8 @@ ETHTOOL_MSG_MODULE_EEPROM_GET, ETHTOOL_MSG_STATS_GET, ETHTOOL_MSG_PHC_VCLOCKS_GET, + ETHTOOL_MSG_MODULE_GET, + ETHTOOL_MSG_MODULE_SET, /* add new constants above here */ __ETHTOOL_MSG_USER_CNT, @@ -90,6 +92,8 @@ ETHTOOL_MSG_MODULE_EEPROM_GET_REPLY, ETHTOOL_MSG_STATS_GET_REPLY, ETHTOOL_MSG_PHC_VCLOCKS_GET_REPLY, + ETHTOOL_MSG_MODULE_GET_REPLY, + ETHTOOL_MSG_MODULE_NTF, /* add new constants above here */ __ETHTOOL_MSG_KERNEL_CNT, @@ -325,6 +329,7 @@ ETHTOOL_A_RINGS_RX_MINI, /* u32 */ ETHTOOL_A_RINGS_RX_JUMBO, /* u32 */ ETHTOOL_A_RINGS_TX, /* u32 */ + ETHTOOL_A_RINGS_RX_BUF_LEN, /* u32 */ /* add new constants above here */ __ETHTOOL_A_RINGS_CNT, @@ -407,7 +412,9 @@ ETHTOOL_A_PAUSE_STAT_TX_FRAMES, ETHTOOL_A_PAUSE_STAT_RX_FRAMES, - /* add new constants above here */ + /* add new constants above here + * adjust ETHTOOL_PAUSE_STAT_CNT if adding non-stats! + */ __ETHTOOL_A_PAUSE_STAT_CNT, ETHTOOL_A_PAUSE_STAT_MAX = (__ETHTOOL_A_PAUSE_STAT_CNT - 1) }; @@ -833,6 +840,19 @@ ETHTOOL_A_STATS_RMON_MAX = (__ETHTOOL_A_STATS_RMON_CNT - 1) }; +/* MODULE */ + +enum { + ETHTOOL_A_MODULE_UNSPEC, + ETHTOOL_A_MODULE_HEADER, /* nest - _A_HEADER_* */ + ETHTOOL_A_MODULE_POWER_MODE_POLICY, /* u8 */ + ETHTOOL_A_MODULE_POWER_MODE, /* u8 */ + + /* add new constants above here */ + __ETHTOOL_A_MODULE_CNT, + ETHTOOL_A_MODULE_MAX = (__ETHTOOL_A_MODULE_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' old/ethtool-5.16/uapi/linux/if_link.h new/ethtool-5.17/uapi/linux/if_link.h --- old/ethtool-5.16/uapi/linux/if_link.h 2022-01-19 00:07:57.000000000 +0100 +++ new/ethtool-5.17/uapi/linux/if_link.h 2022-01-19 00:46:20.000000000 +0100 @@ -856,6 +856,7 @@ IFLA_BOND_TLB_DYNAMIC_LB, IFLA_BOND_PEER_NOTIF_DELAY, IFLA_BOND_AD_LACP_ACTIVE, + IFLA_BOND_MISSED_MAX, __IFLA_BOND_MAX, };