Hello community, here is the log from the commit of package ethtool for openSUSE:Factory checked in at 2018-02-09 15:44:32 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ethtool (Old) and /work/SRC/openSUSE:Factory/.ethtool.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ethtool" Fri Feb 9 15:44:32 2018 rev:49 rq:573299 version:4.15 Changes: -------- --- /work/SRC/openSUSE:Factory/ethtool/ethtool.changes 2017-11-01 11:06:53.791782531 +0100 +++ /work/SRC/openSUSE:Factory/.ethtool.new/ethtool.changes 2018-02-09 15:44:33.653822591 +0100 @@ -1,0 +2,10 @@ +Fri Feb 2 10:15:20 UTC 2018 - mkube...@suse.cz + +- Update to new updstream release 4.15 + * Feature: Support for FEC encoding control + * Feature: Add extended compliance codes parsing to sfp modules + * Feature: Add ETHTOOL_RESET support via --reset command + * Fix: Revert "ethtool: Add DMA Coalescing support" + * Fix: fix MFLCN register dump for 82599 and newer + +------------------------------------------------------------------- Old: ---- ethtool-4.13.tar.sign ethtool-4.13.tar.xz New: ---- ethtool-4.15.tar.sign ethtool-4.15.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ethtool.spec ++++++ --- /var/tmp/diff_new_pack.tpUj9O/_old 2018-02-09 15:44:34.481792862 +0100 +++ /var/tmp/diff_new_pack.tpUj9O/_new 2018-02-09 15:44:34.481792862 +0100 @@ -1,7 +1,7 @@ # # spec file for package ethtool # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # 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: 4.13 +Version: 4.15 Release: 0 Summary: Examine and Tune Ethernet-Based Network Interfaces License: GPL-2.0 ++++++ ethtool-4.13.tar.xz -> ethtool-4.15.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-4.13/NEWS new/ethtool-4.15/NEWS --- old/ethtool-4.13/NEWS 2017-10-27 20:04:48.000000000 +0200 +++ new/ethtool-4.15/NEWS 2018-02-01 19:34:54.000000000 +0100 @@ -1,3 +1,13 @@ +Version 4.15 - February 1, 2018 + + * Feature: Support for FEC encoding control + * Fix: Fix coding style warnings and errors reported by checkpatch + * Feature: Add extended compliance codes parsing to sfp modules + * Fix: Revert "ethtool: Add DMA Coalescing support" + * Feature: Add ETHTOOL_RESET support via --reset command + * Fix: fix MFLCN register dump for 82599 and newer + + Version 4.13 - October 27, 2017 * Fix: Do not return error code if no changes were attempted. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-4.13/configure new/ethtool-4.15/configure --- old/ethtool-4.13/configure 2017-10-27 20:11:24.000000000 +0200 +++ new/ethtool-4.15/configure 2018-02-01 19:36:22.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for ethtool 4.13. +# Generated by GNU Autoconf 2.69 for ethtool 4.15. # # Report bugs to <net...@vger.kernel.org>. # @@ -580,8 +580,8 @@ # Identity of this package. PACKAGE_NAME='ethtool' PACKAGE_TARNAME='ethtool' -PACKAGE_VERSION='4.13' -PACKAGE_STRING='ethtool 4.13' +PACKAGE_VERSION='4.15' +PACKAGE_STRING='ethtool 4.15' PACKAGE_BUGREPORT='net...@vger.kernel.org' PACKAGE_URL='' @@ -1237,7 +1237,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 4.13 to adapt to many kinds of systems. +\`configure' configures ethtool 4.15 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1303,7 +1303,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ethtool 4.13:";; + short | recursive ) echo "Configuration of ethtool 4.15:";; esac cat <<\_ACEOF @@ -1398,7 +1398,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ethtool configure 4.13 +ethtool configure 4.15 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1645,7 +1645,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 4.13, which was +It was created by ethtool $as_me 4.15, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2510,7 +2510,7 @@ # Define the identity of the package. PACKAGE='ethtool' - VERSION='4.13' + VERSION='4.15' cat >>confdefs.h <<_ACEOF @@ -4695,7 +4695,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 4.13, which was +This file was extended by ethtool $as_me 4.15, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4761,7 +4761,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 4.13 +ethtool config.status 4.15 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-4.13/configure.ac new/ethtool-4.15/configure.ac --- old/ethtool-4.13/configure.ac 2017-10-27 19:58:59.000000000 +0200 +++ new/ethtool-4.15/configure.ac 2018-02-01 19:29:22.000000000 +0100 @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(ethtool, 4.13, net...@vger.kernel.org) +AC_INIT(ethtool, 4.15, net...@vger.kernel.org) AC_PREREQ(2.52) AC_CONFIG_SRCDIR([ethtool.c]) AM_INIT_AUTOMAKE([gnu]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-4.13/ethtool-copy.h new/ethtool-4.15/ethtool-copy.h --- old/ethtool-4.13/ethtool-copy.h 2017-10-26 20:02:15.000000000 +0200 +++ new/ethtool-4.15/ethtool-copy.h 2017-12-14 20:20:37.000000000 +0100 @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ /* * ethtool.h: Defines for Linux ethtool. * @@ -400,7 +401,6 @@ * a TX interrupt, when the packet rate is above @pkt_rate_high. * @rate_sample_interval: How often to do adaptive coalescing packet rate * sampling, measured in seconds. Must not be zero. - * @dmac: How many usecs to store packets before moving to host memory. * * Each pair of (usecs, max_frames) fields specifies that interrupts * should be coalesced until @@ -451,7 +451,6 @@ __u32 tx_coalesce_usecs_high; __u32 tx_max_coalesced_frames_high; __u32 rate_sample_interval; - __u32 dmac; }; /** @@ -1238,6 +1237,47 @@ char data[]; }; +/** + * struct ethtool_fecparam - Ethernet forward error correction(fec) parameters + * @cmd: Command number = %ETHTOOL_GFECPARAM or %ETHTOOL_SFECPARAM + * @active_fec: FEC mode which is active on porte + * @fec: Bitmask of supported/configured FEC modes + * @rsvd: Reserved for future extensions. i.e FEC bypass feature. + * + * Drivers should reject a non-zero setting of @autoneg when + * autoneogotiation is disabled (or not supported) for the link. + * + */ +struct ethtool_fecparam { + __u32 cmd; + /* bitmask of FEC modes */ + __u32 active_fec; + __u32 fec; + __u32 reserved; +}; + +/** + * enum ethtool_fec_config_bits - flags definition of ethtool_fec_configuration + * @ETHTOOL_FEC_NONE: FEC mode configuration is not supported + * @ETHTOOL_FEC_AUTO: Default/Best FEC mode provided by driver + * @ETHTOOL_FEC_OFF: No FEC Mode + * @ETHTOOL_FEC_RS: Reed-Solomon Forward Error Detection mode + * @ETHTOOL_FEC_BASER: Base-R/Reed-Solomon Forward Error Detection mode + */ +enum ethtool_fec_config_bits { + ETHTOOL_FEC_NONE_BIT, + ETHTOOL_FEC_AUTO_BIT, + ETHTOOL_FEC_OFF_BIT, + ETHTOOL_FEC_RS_BIT, + ETHTOOL_FEC_BASER_BIT, +}; + +#define ETHTOOL_FEC_NONE (1 << ETHTOOL_FEC_NONE_BIT) +#define ETHTOOL_FEC_AUTO (1 << ETHTOOL_FEC_AUTO_BIT) +#define ETHTOOL_FEC_OFF (1 << ETHTOOL_FEC_OFF_BIT) +#define ETHTOOL_FEC_RS (1 << ETHTOOL_FEC_RS_BIT) +#define ETHTOOL_FEC_BASER (1 << ETHTOOL_FEC_BASER_BIT) + /* CMDs currently supported */ #define ETHTOOL_GSET 0x00000001 /* DEPRECATED, Get settings. * Please use ETHTOOL_GLINKSETTINGS @@ -1330,6 +1370,8 @@ #define ETHTOOL_SLINKSETTINGS 0x0000004d /* Set ethtool_link_settings */ #define ETHTOOL_PHY_GTUNABLE 0x0000004e /* Get PHY tunable configuration */ #define ETHTOOL_PHY_STUNABLE 0x0000004f /* Set PHY tunable configuration */ +#define ETHTOOL_GFECPARAM 0x00000050 /* Get FEC settings */ +#define ETHTOOL_SFECPARAM 0x00000051 /* Set FEC settings */ /* compatibility with older code */ #define SPARC_ETH_GSET ETHTOOL_GSET @@ -1384,9 +1426,12 @@ ETHTOOL_LINK_MODE_10000baseLR_Full_BIT = 44, ETHTOOL_LINK_MODE_10000baseLRM_Full_BIT = 45, ETHTOOL_LINK_MODE_10000baseER_Full_BIT = 46, - ETHTOOL_LINK_MODE_2500baseT_Full_BIT = 47, - ETHTOOL_LINK_MODE_5000baseT_Full_BIT = 48, + ETHTOOL_LINK_MODE_2500baseT_Full_BIT = 47, + ETHTOOL_LINK_MODE_5000baseT_Full_BIT = 48, + ETHTOOL_LINK_MODE_FEC_NONE_BIT = 49, + ETHTOOL_LINK_MODE_FEC_RS_BIT = 50, + ETHTOOL_LINK_MODE_FEC_BASER_BIT = 51, /* Last allowed bit for __ETHTOOL_LINK_MODE_LEGACY_MASK is bit * 31. Please do NOT define any SUPPORTED_* or ADVERTISED_* @@ -1395,7 +1440,7 @@ */ __ETHTOOL_LINK_MODE_LAST - = ETHTOOL_LINK_MODE_5000baseT_Full_BIT, + = ETHTOOL_LINK_MODE_FEC_BASER_BIT, }; #define __ETHTOOL_LINK_MODE_LEGACY_MASK(base_name) \ @@ -1486,13 +1531,17 @@ * it was forced up into this mode or autonegotiated. */ -/* The forced speed, in units of 1Mb. All values 0 to INT_MAX are legal. */ +/* The forced speed, in units of 1Mb. All values 0 to INT_MAX are legal. + * Update drivers/net/phy/phy.c:phy_speed_to_str() and + * drivers/net/bonding/bond_3ad.c:__get_link_speed() when adding new values. + */ #define SPEED_10 10 #define SPEED_100 100 #define SPEED_1000 1000 #define SPEED_2500 2500 #define SPEED_5000 5000 #define SPEED_10000 10000 +#define SPEED_14000 14000 #define SPEED_20000 20000 #define SPEED_25000 25000 #define SPEED_40000 40000 @@ -1635,6 +1684,7 @@ ETH_RESET_PHY = 1 << 6, /* Transceiver/PHY */ ETH_RESET_RAM = 1 << 7, /* RAM shared between * multiple components */ + ETH_RESET_AP = 1 << 8, /* Application processor */ ETH_RESET_DEDICATED = 0x0000ffff, /* All components dedicated to * this interface */ @@ -1703,6 +1753,8 @@ * %ethtool_link_mode_bit_indices for the link modes, and other * link features that the link partner advertised through * autonegotiation; 0 if unknown or not applicable. Read-only. + * @transceiver: Used to distinguish different possible PHY types, + * reported consistently by PHYLIB. Read-only. * * If autonegotiation is disabled, the speed and @duplex represent the * fixed link mode and are writable if the driver supports multiple @@ -1754,7 +1806,9 @@ __u8 eth_tp_mdix; __u8 eth_tp_mdix_ctrl; __s8 link_mode_masks_nwords; - __u32 reserved[8]; + __u8 transceiver; + __u8 reserved1[3]; + __u32 reserved[7]; __u32 link_mode_masks[0]; /* layout of link_mode_masks fields: * __u32 map_supported[link_mode_masks_nwords]; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-4.13/ethtool.8 new/ethtool-4.15/ethtool.8 --- old/ethtool-4.13/ethtool.8 2017-10-27 20:11:25.000000000 +0200 +++ new/ethtool-4.15/ethtool.8 2018-02-01 19:36:25.000000000 +0100 @@ -113,7 +113,7 @@ . hy \\n(HY .. . -.TH ETHTOOL 8 "October 2017" "Ethtool version 4.13" +.TH ETHTOOL 8 "February 2018" "Ethtool version 4.15" .SH NAME ethtool \- query or control network driver and hardware settings . @@ -165,7 +165,6 @@ .BN tx\-usecs\-high .BN tx\-frames\-high .BN sample\-interval -.BN dmac .HP .B ethtool \-g|\-\-show\-ring .I devname @@ -355,6 +354,37 @@ .B ethtool \-\-get\-phy\-tunable .I devname .RB [ downshift ] +.HP +.B ethtool \-\-reset +.I devname +.BN flags +.RB [ mgmt ] +.RB [ mgmt-shared ] +.RB [ irq ] +.RB [ irq-shared ] +.RB [ dma ] +.RB [ dma-shared ] +.RB [ filter ] +.RB [ filter-shared ] +.RB [ offload ] +.RB [ offload-shared ] +.RB [ mac ] +.RB [ mac-shared ] +.RB [ phy ] +.RB [ phy-shared ] +.RB [ ram ] +.RB [ ram-shared ] +.RB [ ap ] +.RB [ ap-shared ] +.RB [ dedicated ] +.RB [ all ] +.HP +.B ethtool \-\-show\-fec +.I devname +.HP +.B ethtool \-\-set\-fec +.I devname +.B4 encoding auto off rs baser . .\" Adjust lines (i.e. full justification) and hyphenate. .ad @@ -1007,6 +1037,70 @@ Gets the PHY downshift count/status. .RE +.TP +.B \-\-reset +Reset hardware components specified by flags and components listed below +.RS 4 +.TP +.BI flags \ N +Resets the components based on direct flags mask +.TP +.B mgmt +Management processor +.TP +.B irq +Interrupt requester +.TP +.B dma +DMA engine +.TP +.B filter +Filtering/flow direction +.TP +.B offload +Protocol offload +.TP +.B mac +Media access controller +.TP +.B phy +Transceiver/PHY +.TP +.B ram +RAM shared between multiple components +.B ap +Application Processor +.TP +.B dedicated +All components dedicated to this interface +.TP +.B all +All components used by this interface, even if shared +.RE +.TP +.B \-\-show\-fec +Queries the specified network device for its support of Forward Error Correction. +.TP +.B \-\-set\-fec +Configures Forward Error Correction for the specified network device. + +Forward Error Correction modes selected by a user are expected to be persisted +after any hotplug events. If a module is swapped that does not support the +current FEC mode, the driver or firmware must take the link down +administratively and report the problem in the system logs for users to correct. +.RS 4 +.TP +.A4 encoding auto off rs baser +Sets the FEC encoding for the device. +.TS +nokeep; +lB l. +auto Use the driver's default encoding +off Turn off FEC +RS Force RS-FEC encoding +BaseR Force BaseR encoding +.TE +.RE .SH BUGS Not supported (in part or whole) on all network drivers. .SH AUTHOR @@ -1024,7 +1118,8 @@ Alexander Duyck, Sucheta Chakraborty, Jesse Brandeburg, -Ben Hutchings. +Ben Hutchings, +Scott Branden. .SH AVAILABILITY .B ethtool is available from diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-4.13/ethtool.8.in new/ethtool-4.15/ethtool.8.in --- old/ethtool-4.13/ethtool.8.in 2017-10-27 19:59:44.000000000 +0200 +++ new/ethtool-4.15/ethtool.8.in 2018-02-01 19:30:41.000000000 +0100 @@ -113,7 +113,7 @@ . hy \\n(HY .. . -.TH ETHTOOL 8 "October 2017" "Ethtool version @VERSION@" +.TH ETHTOOL 8 "February 2018" "Ethtool version @VERSION@" .SH NAME ethtool \- query or control network driver and hardware settings . @@ -165,7 +165,6 @@ .BN tx\-usecs\-high .BN tx\-frames\-high .BN sample\-interval -.BN dmac .HP .B ethtool \-g|\-\-show\-ring .I devname @@ -355,6 +354,37 @@ .B ethtool \-\-get\-phy\-tunable .I devname .RB [ downshift ] +.HP +.B ethtool \-\-reset +.I devname +.BN flags +.RB [ mgmt ] +.RB [ mgmt-shared ] +.RB [ irq ] +.RB [ irq-shared ] +.RB [ dma ] +.RB [ dma-shared ] +.RB [ filter ] +.RB [ filter-shared ] +.RB [ offload ] +.RB [ offload-shared ] +.RB [ mac ] +.RB [ mac-shared ] +.RB [ phy ] +.RB [ phy-shared ] +.RB [ ram ] +.RB [ ram-shared ] +.RB [ ap ] +.RB [ ap-shared ] +.RB [ dedicated ] +.RB [ all ] +.HP +.B ethtool \-\-show\-fec +.I devname +.HP +.B ethtool \-\-set\-fec +.I devname +.B4 encoding auto off rs baser . .\" Adjust lines (i.e. full justification) and hyphenate. .ad @@ -1007,6 +1037,70 @@ Gets the PHY downshift count/status. .RE +.TP +.B \-\-reset +Reset hardware components specified by flags and components listed below +.RS 4 +.TP +.BI flags \ N +Resets the components based on direct flags mask +.TP +.B mgmt +Management processor +.TP +.B irq +Interrupt requester +.TP +.B dma +DMA engine +.TP +.B filter +Filtering/flow direction +.TP +.B offload +Protocol offload +.TP +.B mac +Media access controller +.TP +.B phy +Transceiver/PHY +.TP +.B ram +RAM shared between multiple components +.B ap +Application Processor +.TP +.B dedicated +All components dedicated to this interface +.TP +.B all +All components used by this interface, even if shared +.RE +.TP +.B \-\-show\-fec +Queries the specified network device for its support of Forward Error Correction. +.TP +.B \-\-set\-fec +Configures Forward Error Correction for the specified network device. + +Forward Error Correction modes selected by a user are expected to be persisted +after any hotplug events. If a module is swapped that does not support the +current FEC mode, the driver or firmware must take the link down +administratively and report the problem in the system logs for users to correct. +.RS 4 +.TP +.A4 encoding auto off rs baser +Sets the FEC encoding for the device. +.TS +nokeep; +lB l. +auto Use the driver's default encoding +off Turn off FEC +RS Force RS-FEC encoding +BaseR Force BaseR encoding +.TE +.RE .SH BUGS Not supported (in part or whole) on all network drivers. .SH AUTHOR @@ -1024,7 +1118,8 @@ Alexander Duyck, Sucheta Chakraborty, Jesse Brandeburg, -Ben Hutchings. +Ben Hutchings, +Scott Branden. .SH AVAILABILITY .B ethtool is available from diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-4.13/ethtool.c new/ethtool-4.15/ethtool.c --- old/ethtool-4.13/ethtool.c 2017-10-26 20:05:04.000000000 +0200 +++ new/ethtool-4.15/ethtool.c 2018-02-01 19:25:59.000000000 +0100 @@ -235,7 +235,7 @@ exit_bad_args(); errno = 0; v = strtoull(str, &endp, base); - if ( errno || *endp || v > max) + if (errno || *endp || v > max) exit_bad_args(); return v; } @@ -261,9 +261,8 @@ if (count != ETH_ALEN) exit_bad_args(); - for (i = 0; i < count; i++) { + for (i = 0; i < count; i++) dest[i] = buf[i]; - } } static int parse_hex_u32_bitmap(const char *s, @@ -408,7 +407,7 @@ break; } } - if( !found) + if (!found) exit_bad_args(); } } @@ -543,6 +542,9 @@ ETHTOOL_LINK_MODE_Pause_BIT, ETHTOOL_LINK_MODE_Asym_Pause_BIT, ETHTOOL_LINK_MODE_Backplane_BIT, + ETHTOOL_LINK_MODE_FEC_NONE_BIT, + ETHTOOL_LINK_MODE_FEC_RS_BIT, + ETHTOOL_LINK_MODE_FEC_BASER_BIT, }; unsigned int i; @@ -683,13 +685,14 @@ "10000baseLRM/Full" }, { 0, ETHTOOL_LINK_MODE_10000baseER_Full_BIT, "10000baseER/Full" }, - { 0, ETHTOOL_LINK_MODE_2500baseT_Full_BIT, - "2500baseT/Full" }, - { 0, ETHTOOL_LINK_MODE_5000baseT_Full_BIT, - "5000baseT/Full" }, + { 0, ETHTOOL_LINK_MODE_2500baseT_Full_BIT, + "2500baseT/Full" }, + { 0, ETHTOOL_LINK_MODE_5000baseT_Full_BIT, + "5000baseT/Full" }, }; int indent; int did1, new_line_pend, i; + int fecreported = 0; /* Indent just like the separate functions used to */ indent = strlen(prefix) + 14; @@ -715,7 +718,7 @@ } } if (did1 == 0) - fprintf(stdout, "Not reported"); + fprintf(stdout, "Not reported"); fprintf(stdout, "\n"); if (!link_mode_only) { @@ -741,6 +744,26 @@ fprintf(stdout, "Yes\n"); else fprintf(stdout, "No\n"); + + fprintf(stdout, " %s FEC modes:", prefix); + if (ethtool_link_mode_test_bit(ETHTOOL_LINK_MODE_FEC_NONE_BIT, + mask)) { + fprintf(stdout, " None"); + fecreported = 1; + } + if (ethtool_link_mode_test_bit(ETHTOOL_LINK_MODE_FEC_BASER_BIT, + mask)) { + fprintf(stdout, " BaseR"); + fecreported = 1; + } + if (ethtool_link_mode_test_bit(ETHTOOL_LINK_MODE_FEC_RS_BIT, + mask)) { + fprintf(stdout, " RS"); + fecreported = 1; + } + if (!fecreported) + fprintf(stdout, " Not reported"); + fprintf(stdout, "\n"); } } @@ -887,32 +910,32 @@ *data = 0; while (*optstr) { switch (*optstr) { - case 'p': - *data |= WAKE_PHY; - break; - case 'u': - *data |= WAKE_UCAST; - break; - case 'm': - *data |= WAKE_MCAST; - break; - case 'b': - *data |= WAKE_BCAST; - break; - case 'a': - *data |= WAKE_ARP; - break; - case 'g': - *data |= WAKE_MAGIC; - break; - case 's': - *data |= WAKE_MAGICSECURE; - break; - case 'd': - *data = 0; - break; - default: - return -1; + case 'p': + *data |= WAKE_PHY; + break; + case 'u': + *data |= WAKE_UCAST; + break; + case 'm': + *data |= WAKE_MCAST; + break; + case 'b': + *data |= WAKE_BCAST; + break; + case 'a': + *data |= WAKE_ARP; + break; + case 'g': + *data |= WAKE_MAGIC; + break; + case 's': + *data |= WAKE_MAGICSECURE; + break; + case 'd': + *data = 0; + break; + default: + return -1; } optstr++; } @@ -957,10 +980,11 @@ if (wol->supported & WAKE_MAGICSECURE) { int i; int delim = 0; + fprintf(stdout, " SecureOn password: "); for (i = 0; i < SOPASS_MAX; i++) { fprintf(stdout, "%s%02x", delim?":":"", wol->sopass[i]); - delim=1; + delim = 1; } fprintf(stdout, "\n"); } @@ -973,32 +997,32 @@ *data = 0; while (*optstr) { switch (*optstr) { - case 'm': - *data |= RXH_L2DA; - break; - case 'v': - *data |= RXH_VLAN; - break; - case 't': - *data |= RXH_L3_PROTO; - break; - case 's': - *data |= RXH_IP_SRC; - break; - case 'd': - *data |= RXH_IP_DST; - break; - case 'f': - *data |= RXH_L4_B_0_1; - break; - case 'n': - *data |= RXH_L4_B_2_3; - break; - case 'r': - *data |= RXH_DISCARD; - break; - default: - return -1; + case 'm': + *data |= RXH_L2DA; + break; + case 'v': + *data |= RXH_VLAN; + break; + case 't': + *data |= RXH_L3_PROTO; + break; + case 's': + *data |= RXH_IP_SRC; + break; + case 'd': + *data |= RXH_IP_DST; + break; + case 'f': + *data |= RXH_L4_B_0_1; + break; + case 'n': + *data |= RXH_L4_B_2_3; + break; + case 'r': + *data |= RXH_DISCARD; + break; + default: + return -1; } optstr++; } @@ -1012,27 +1036,20 @@ memset(buf, 0, sizeof(buf)); if (opts) { - if (opts & RXH_L2DA) { + if (opts & RXH_L2DA) strcat(buf, "L2DA\n"); - } - if (opts & RXH_VLAN) { + if (opts & RXH_VLAN) strcat(buf, "VLAN tag\n"); - } - if (opts & RXH_L3_PROTO) { + if (opts & RXH_L3_PROTO) strcat(buf, "L3 proto\n"); - } - if (opts & RXH_IP_SRC) { + if (opts & RXH_IP_SRC) strcat(buf, "IP SA\n"); - } - if (opts & RXH_IP_DST) { + if (opts & RXH_IP_DST) strcat(buf, "IP DA\n"); - } - if (opts & RXH_L4_B_0_1) { + if (opts & RXH_L4_B_0_1) strcat(buf, "L4 bytes 0 & 1 [TCP/UDP src port]\n"); - } - if (opts & RXH_L4_B_2_3) { + if (opts & RXH_L4_B_2_3) strcat(buf, "L4 bytes 2 & 3 [TCP/UDP dst port]\n"); - } } else { sprintf(buf, "None"); } @@ -1133,10 +1150,10 @@ { "tg3", tg3_dump_regs }, { "skge", skge_dump_regs }, { "sky2", sky2_dump_regs }, - { "vioc", vioc_dump_regs }, - { "smsc911x", smsc911x_dump_regs }, - { "at76c50x-usb", at76c50x_usb_dump_regs }, - { "sfc", sfc_dump_regs }, + { "vioc", vioc_dump_regs }, + { "smsc911x", smsc911x_dump_regs }, + { "at76c50x-usb", at76c50x_usb_dump_regs }, + { "sfc", sfc_dump_regs }, { "st_mac100", st_mac100_dump_regs }, { "st_gmac", st_gmac_dump_regs }, { "et131x", et131x_dump_regs }, @@ -1337,7 +1354,6 @@ "sample-interval: %u\n" "pkt-rate-low: %u\n" "pkt-rate-high: %u\n" - "dmac: %u\n" "\n" "rx-usecs: %u\n" "rx-frames: %u\n" @@ -1363,7 +1379,6 @@ ecoal->rate_sample_interval, ecoal->pkt_rate_low, ecoal->pkt_rate_high, - ecoal->dmac, ecoal->rx_coalesce_usecs, ecoal->rx_max_coalesced_frames, @@ -1571,6 +1586,20 @@ dump_link_caps("Link partner advertised EEE", "", link_mode, 1); } +static void dump_fec(u32 fec) +{ + if (fec & ETHTOOL_FEC_NONE) + fprintf(stdout, " None"); + if (fec & ETHTOOL_FEC_AUTO) + fprintf(stdout, " Auto"); + if (fec & ETHTOOL_FEC_OFF) + fprintf(stdout, " Off"); + if (fec & ETHTOOL_FEC_BASER) + fprintf(stdout, " BaseR"); + if (fec & ETHTOOL_FEC_RS) + fprintf(stdout, " RS"); +} + #define N_SOTS 7 static char *so_timestamping_labels[N_SOTS] = { @@ -2071,7 +2100,6 @@ int coal_adaptive_rx_wanted = -1; int coal_adaptive_tx_wanted = -1; s32 coal_sample_rate_wanted = -1; - s32 coal_dmac_wanted = -1; s32 coal_pkt_rate_low_wanted = -1; s32 coal_pkt_rate_high_wanted = -1; s32 coal_rx_usec_wanted = -1; @@ -2097,8 +2125,6 @@ &ecoal.use_adaptive_tx_coalesce }, { "sample-interval", CMDL_S32, &coal_sample_rate_wanted, &ecoal.rate_sample_interval }, - { "dmac", CMDL_S32, &coal_dmac_wanted, - &ecoal.dmac }, { "stats-block-usecs", CMDL_S32, &coal_stats_wanted, &ecoal.stats_block_coalesce_usecs }, { "pkt-rate-low", CMDL_S32, &coal_pkt_rate_low_wanted, @@ -2772,7 +2798,7 @@ i += 1; if (i >= argc) exit_bad_args(); - speed_wanted = get_int(argp[i],10); + speed_wanted = get_int(argp[i], 10); } else if (!strcmp(argp[i], "duplex")) { gset_changed = 1; i += 1; @@ -2983,7 +3009,7 @@ speed_wanted); if (duplex_wanted >= 0) fprintf(stderr, " duplex %s", - duplex_wanted ? + duplex_wanted ? "full" : "half"); fprintf(stderr, "\n"); } @@ -3068,14 +3094,12 @@ perror("Cannot get current wake-on-lan settings"); } else { /* Change everything the user specified. */ - if (wol_change) { + if (wol_change) wol.wolopts = wol_wanted; - } if (sopass_change) { int i; - for (i = 0; i < SOPASS_MAX; i++) { + for (i = 0; i < SOPASS_MAX; i++) wol.sopass[i] = sopass_wanted[i]; - } } /* Try to perform the update. */ @@ -3172,7 +3196,7 @@ free(regs); return 75; } - } + } if (dump_regs(gregs_dump_raw, gregs_dump_hex, &drvinfo, regs) < 0) { @@ -3331,7 +3355,7 @@ static int do_test(struct cmd_context *ctx) { enum { - ONLINE=0, + ONLINE = 0, OFFLINE, EXTERNAL_LB, } test_type; @@ -3342,15 +3366,14 @@ if (ctx->argc > 1) exit_bad_args(); if (ctx->argc == 1) { - if (!strcmp(ctx->argp[0], "online")) { + if (!strcmp(ctx->argp[0], "online")) test_type = ONLINE; - } else if (!strcmp(*ctx->argp, "offline")) { + else if (!strcmp(*ctx->argp, "offline")) test_type = OFFLINE; - } else if (!strcmp(*ctx->argp, "external_lb")) { + else if (!strcmp(*ctx->argp, "external_lb")) test_type = EXTERNAL_LB; - } else { + else exit_bad_args(); - } } else { test_type = OFFLINE; } @@ -3381,7 +3404,7 @@ err = send_ioctl(ctx, test); if (err < 0) { perror("Cannot test"); - free (test); + free(test); free(strings); return 74; } @@ -3512,7 +3535,7 @@ err = send_ioctl(ctx, &nfccmd); if (err < 0) perror("Cannot change RX network flow hashing options"); - } else if (!strcmp(ctx->argp[0], "flow-type")) { + } else if (!strcmp(ctx->argp[0], "flow-type")) { struct ethtool_rx_flow_spec rx_rule_fs; ctx->argc--; @@ -4193,8 +4216,8 @@ /* * Display error only if response is something other than op not * supported. It is possible that the interface uses the network - * flow classifier interface instead of N-tuple. - */ + * flow classifier interface instead of N-tuple. + */ if (err < 0) { if (errno != EOPNOTSUPP) perror("Cannot add new rule via N-tuple"); @@ -4336,7 +4359,7 @@ /* Find longest string and align all strings accordingly */ for (i = 0; i < strings->len; i++) { - cur_len = strlen((const char*)strings->data + + cur_len = strlen((const char *)strings->data + i * ETH_GSTRING_LEN); if (cur_len > max_len) max_len = cur_len; @@ -4586,7 +4609,6 @@ do_generic_set(cmdline_eee, ARRAY_SIZE(cmdline_eee), &change2); if (change2) { - eeecmd.cmd = ETHTOOL_SEEE; if (send_ioctl(ctx, &eeecmd)) { perror("Cannot set EEE settings"); @@ -4641,6 +4663,97 @@ return err; } +static __u32 parse_reset(char *val, __u32 bitset, char *arg, __u32 *data) +{ + __u32 bitval = 0; + int i; + + /* Check for component match */ + for (i = 0; val[i] != '\0'; i++) + if (arg[i] != val[i]) + return 0; + + /* Check if component has -shared specified or not */ + if (arg[i] == '\0') + bitval = bitset; + else if (!strcmp(arg+i, "-shared")) + bitval = bitset << ETH_RESET_SHARED_SHIFT; + + if (bitval) { + *data |= bitval; + return 1; + } + return 0; +} + +static int do_reset(struct cmd_context *ctx) +{ + struct ethtool_value resetinfo; + __u32 data; + int argc = ctx->argc; + char **argp = ctx->argp; + int i; + + if (argc == 0) + exit_bad_args(); + + data = 0; + + for (i = 0; i < argc; i++) { + if (!strcmp(argp[i], "flags")) { + __u32 flags; + + i++; + if (i >= argc) + exit_bad_args(); + flags = strtoul(argp[i], NULL, 0); + if (flags == 0) + exit_bad_args(); + else + data |= flags; + } else if (parse_reset("mgmt", ETH_RESET_MGMT, + argp[i], &data)) { + } else if (parse_reset("irq", ETH_RESET_IRQ, + argp[i], &data)) { + } else if (parse_reset("dma", ETH_RESET_DMA, + argp[i], &data)) { + } else if (parse_reset("filter", ETH_RESET_FILTER, + argp[i], &data)) { + } else if (parse_reset("offload", ETH_RESET_OFFLOAD, + argp[i], &data)) { + } else if (parse_reset("mac", ETH_RESET_MAC, + argp[i], &data)) { + } else if (parse_reset("phy", ETH_RESET_PHY, + argp[i], &data)) { + } else if (parse_reset("ram", ETH_RESET_RAM, + argp[i], &data)) { + } else if (parse_reset("ap", ETH_RESET_AP, + argp[i], &data)) { + } else if (!strcmp(argp[i], "dedicated")) { + data |= ETH_RESET_DEDICATED; + } else if (!strcmp(argp[i], "all")) { + data |= ETH_RESET_ALL; + } else { + exit_bad_args(); + } + } + + resetinfo.cmd = ETHTOOL_RESET; + resetinfo.data = data; + fprintf(stdout, "ETHTOOL_RESET 0x%x\n", resetinfo.data); + + if (send_ioctl(ctx, &resetinfo)) { + perror("Cannot issue ETHTOOL_RESET"); + return 1; + } + + fprintf(stdout, "Components reset: 0x%x\n", data & ~resetinfo.data); + if (resetinfo.data) + fprintf(stdout, "Components not reset: 0x%x\n", resetinfo.data); + + return 0; +} + static int parse_named_bool(struct cmd_context *ctx, const char *name, u8 *on) { if (ctx->argc < 2) @@ -4737,6 +4850,84 @@ return err; } +static int fecmode_str_to_type(const char *str) +{ + int fecmode = 0; + + if (!str) + return fecmode; + + if (!strcasecmp(str, "auto")) + fecmode |= ETHTOOL_FEC_AUTO; + else if (!strcasecmp(str, "off")) + fecmode |= ETHTOOL_FEC_OFF; + else if (!strcasecmp(str, "rs")) + fecmode |= ETHTOOL_FEC_RS; + else if (!strcasecmp(str, "baser")) + fecmode |= ETHTOOL_FEC_BASER; + + return fecmode; +} + +static int do_gfec(struct cmd_context *ctx) +{ + struct ethtool_fecparam feccmd = { 0 }; + int rv; + + if (ctx->argc != 0) + exit_bad_args(); + + feccmd.cmd = ETHTOOL_GFECPARAM; + rv = send_ioctl(ctx, &feccmd); + if (rv != 0) { + perror("Cannot get FEC settings"); + return rv; + } + + fprintf(stdout, "FEC parameters for %s:\n", ctx->devname); + fprintf(stdout, "Configured FEC encodings:"); + dump_fec(feccmd.fec); + fprintf(stdout, "\n"); + + fprintf(stdout, "Active FEC encoding:"); + dump_fec(feccmd.active_fec); + fprintf(stdout, "\n"); + + return 0; +} + +static int do_sfec(struct cmd_context *ctx) +{ + char *fecmode_str = NULL; + struct ethtool_fecparam feccmd; + struct cmdline_info cmdline_fec[] = { + { "encoding", CMDL_STR, &fecmode_str, &feccmd.fec}, + }; + int changed; + int fecmode; + int rv; + + parse_generic_cmdline(ctx, &changed, cmdline_fec, + ARRAY_SIZE(cmdline_fec)); + + if (!fecmode_str) + exit_bad_args(); + + fecmode = fecmode_str_to_type(fecmode_str); + if (!fecmode) + exit_bad_args(); + + feccmd.cmd = ETHTOOL_SFECPARAM; + feccmd.fec = fecmode; + rv = send_ioctl(ctx, &feccmd); + if (rv != 0) { + perror("Cannot set FEC settings"); + return rv; + } + + return 0; +} + #ifndef TEST_ETHTOOL int send_ioctl(struct cmd_context *ctx, void *cmd) { @@ -4794,8 +4985,7 @@ " [rx-frames-high N]\n" " [tx-usecs-high N]\n" " [tx-frames-high N]\n" - " [sample-interval N]\n" - " [dmac N]\n" }, + " [sample-interval N]\n" }, { "-g|--show-ring", 1, do_gring, "Query RX/TX ring parameters" }, { "-G|--set-ring", 1, do_sring, "Set RX/TX ring parameters", " [ rx N ]\n" @@ -4885,7 +5075,7 @@ " [ tx N ]\n" " [ other N ]\n" " [ combined N ]\n" }, - { "--show-priv-flags" , 1, do_gprivflags, "Query private flags" }, + { "--show-priv-flags", 1, do_gprivflags, "Query private flags" }, { "--set-priv-flags", 1, do_sprivflags, "Set private flags", " FLAG on|off ...\n" }, { "-m|--dump-module-eeprom|--module-info", 1, do_getmodule, @@ -4904,6 +5094,31 @@ " [ downshift on|off [count N] ]\n"}, { "--get-phy-tunable", 1, do_get_phy_tunable, "Get PHY tunable", " [ downshift ]\n"}, + { "--reset", 1, do_reset, "Reset components", + " [ flags %x ]\n" + " [ mgmt ]\n" + " [ mgmt-shared ]\n" + " [ irq ]\n" + " [ irq-shared ]\n" + " [ dma ]\n" + " [ dma-shared ]\n" + " [ filter ]\n" + " [ filter-shared ]\n" + " [ offload ]\n" + " [ offload-shared ]\n" + " [ mac ]\n" + " [ mac-shared ]\n" + " [ phy ]\n" + " [ phy-shared ]\n" + " [ ram ]\n" + " [ ram-shared ]\n" + " [ ap ]\n" + " [ ap-shared ]\n" + " [ dedicated ]\n" + " [ all ]\n"}, + { "--show-fec", 1, do_gfec, "Show FEC settings"}, + { "--set-fec", 1, do_sfec, "Set FEC settings", + " [ encoding auto|off|rs|baser ]\n"}, { "-h|--help", 0, show_usage, "Show this help" }, { "--version", 0, do_version, "Show version number" }, {} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-4.13/ethtool.spec new/ethtool-4.15/ethtool.spec --- old/ethtool-4.13/ethtool.spec 2017-10-27 20:11:26.000000000 +0200 +++ new/ethtool-4.15/ethtool.spec 2018-02-01 19:36:30.000000000 +0100 @@ -1,5 +1,5 @@ Name : ethtool -Version : 4.13 +Version : 4.15 Release : 1 Group : Utilities diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-4.13/ixgbe.c new/ethtool-4.15/ixgbe.c --- old/ethtool-4.13/ixgbe.c 2016-08-24 21:47:26.000000000 +0200 +++ new/ethtool-4.15/ixgbe.c 2017-12-18 19:23:34.000000000 +0100 @@ -232,9 +232,9 @@ " Receive Priority Flow Control Packets: %s\n", reg, reg & IXGBE_MFLCN_RFCE ? "enabled" : "disabled", - reg & IXGBE_FCTRL_DPF ? "enabled" : "disabled", - reg & IXGBE_FCTRL_PMCF ? "enabled" : "disabled", - reg & IXGBE_FCTRL_RPFCE ? "enabled" : "disabled"); + reg & IXGBE_MFLCN_DPF ? "enabled" : "disabled", + reg & IXGBE_MFLCN_PMCF ? "enabled" : "disabled", + reg & IXGBE_MFLCN_RPFCE ? "enabled" : "disabled"); } reg = regs_buff[516]; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ethtool-4.13/sfpid.c new/ethtool-4.15/sfpid.c --- old/ethtool-4.13/sfpid.c 2017-06-02 19:27:13.000000000 +0200 +++ new/ethtool-4.15/sfpid.c 2017-12-06 16:40:27.000000000 +0100 @@ -40,10 +40,10 @@ "\tTransceiver type :"; printf("\t%-41s : 0x%02x 0x%02x 0x%02x " \ - "0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n", + "0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n", "Transceiver codes", id[3], id[4], id[5], id[6], - id[7], id[8], id[9], id[10]); + id[7], id[8], id[9], id[10], id[36]); /* 10G Ethernet Compliance Codes */ if (id[3] & (1 << 7)) printf("%s 10G Ethernet: 10G Base-ER" \ @@ -168,6 +168,27 @@ printf("%s FC: 200 MBytes/sec\n", pfx); if (id[10] & (1 << 0)) printf("%s FC: 100 MBytes/sec\n", pfx); + /* Extended Specification Compliance Codes from SFF-8024 */ + if (id[36] == 0x1) + printf("%s Extended: 100G AOC or 25GAUI C2M AOC with worst BER of 5x10^(-5)\n", pfx); + if (id[36] == 0x2) + printf("%s Extended: 100G Base-SR4 or 25GBase-SR\n", pfx); + if (id[36] == 0x3) + printf("%s Extended: 100G Base-LR4 or 25GBase-LR\n", pfx); + if (id[36] == 0x4) + printf("%s Extended: 100G Base-ER4 or 25GBase-ER\n", pfx); + if (id[36] == 0x8) + printf("%s Extended: 100G ACC or 25GAUI C2M ACC with worst BER of 5x10^(-5)\n", pfx); + if (id[36] == 0xb) + printf("%s Extended: 100G Base-CR4 or 25G Base-CR CA-L\n", pfx); + if (id[36] == 0xc) + printf("%s Extended: 25G Base-CR CA-S\n", pfx); + if (id[36] == 0xd) + printf("%s Extended: 25G Base-CR CA-N\n", pfx); + if (id[36] == 0x18) + printf("%s Extended: 100G AOC or 25GAUI C2M AOC with worst BER of 10^(-12)\n", pfx); + if (id[36] == 0x19) + printf("%s Extended: 100G ACC or 25GAUI C2M ACC with worst BER of 10^(-12)\n", pfx); } static void sff8079_show_encoding(const __u8 *id)