History

ethtool: clarify the ethtool FEC interface

The definition of the FEC driver interface is quite unclear. Improve the documentation. This is based on current driver and user space code, as well as the discussions about the interface: RFC v1 (24 Oct 2016): https://lore.kernel.org/netdev/1477363849-36517-1-git-send-email-vidya@cumulusnetworks.com/ - this version has the autoneg field - no active_fec field - none vs off confusion is already present RFC v2 (10 Feb 2017): https://lore.kernel.org/netdev/1486727004-11316-1-git-send-email-vidya@cumulusnetworks.com/ - autoneg removed - active_fec added v1 (10 Feb 2017): https://lore.kernel.org/netdev/1486751311-42019-1-git-send-email-vidya@cumulusnetworks.com/ - no changes in the code v1 (24 Jun 2017): https://lore.kernel.org/netdev/1498331985-8525-1-git-send-email-roopa@cumulusnetworks.com/ - include in tree user v2 (27 Jul 2017): https://lore.kernel.org/netdev/1501199248-24695-1-git-send-email-roopa@cumulusnetworks.com/

Jakub Kicinski committed 5 years ago

Commit 6dbf94b1 parent 42ce1271 file · +30 −7Browse files

Showing the changes to include/uapi (1 of 1 file). Show all

Unified · Split

include/uapi/linux/ethtool.h+30−7
@@ -1376,11 +1376,29 @@ struct ethtool_per_queue_op { · 1375 unmodified lines
13761376 };
13771377
13781378 /**
1379− * struct ethtool_fecparam - Ethernet forward error correction(fec) parameters
1379+ * struct ethtool_fecparam - Ethernet Forward Error Correction parameters
13801380 * @cmd: Command number = %ETHTOOL_GFECPARAM or %ETHTOOL_SFECPARAM
1381− * @active_fec: FEC mode which is active on the port, GET only.
1382− * @fec: Bitmask of supported/configured FEC modes
1381+ * @active_fec: FEC mode which is active on the port, single bit set, GET only.
1382+ * @fec: Bitmask of configured FEC modes.
13831383 * @reserved: Reserved for future extensions, ignore on GET, write 0 for SET.
1384+ *
1385+ * FEC modes supported by the device can be read via %ETHTOOL_GLINKSETTINGS.
1386+ * FEC settings are configured by link autonegotiation whenever it's enabled.
1387+ * With autoneg on %ETHTOOL_GFECPARAM can be used to read the current mode.
1388+ *
1389+ * When autoneg is disabled %ETHTOOL_SFECPARAM controls the FEC settings.
1390+ * It is recommended that drivers only accept a single bit set in @fec.
1391+ * When multiple bits are set in @fec drivers may pick mode in an implementation
1392+ * dependent way. Drivers should reject mixing %ETHTOOL_FEC_AUTO_BIT with other
1393+ * FEC modes, because it's unclear whether in this case other modes constrain
1394+ * AUTO or are independent choices.
1395+ * Drivers must reject SET requests if they support none of the requested modes.
1396+ *
1397+ * If device does not support FEC drivers may use %ETHTOOL_FEC_NONE instead
1398+ * of returning %EOPNOTSUPP from %ETHTOOL_GFECPARAM.
1399+ *
1400+ * See enum ethtool_fec_config_bits for definition of valid bits for both
1401+ * @fec and @active_fec.
13841402 */
13851403 struct ethtool_fecparam {
13861404 __u32 cmd;
@@ -1392,11 +1410,16 @@ struct ethtool_fecparam { · 5 unmodified lines
13921410
13931411 /**
13941412 * enum ethtool_fec_config_bits - flags definition of ethtool_fec_configuration
1395− * @ETHTOOL_FEC_NONE: FEC mode configuration is not supported
1396− * @ETHTOOL_FEC_AUTO: Default/Best FEC mode provided by driver
1413+ * @ETHTOOL_FEC_NONE: FEC mode configuration is not supported. Should not
1414+ * be used together with other bits. GET only.
1415+ * @ETHTOOL_FEC_AUTO: Select default/best FEC mode automatically, usually based
1416+ * link mode and SFP parameters read from module's EEPROM.
1417+ * This bit does _not_ mean autonegotiation.
13971418 * @ETHTOOL_FEC_OFF: No FEC Mode
1398− * @ETHTOOL_FEC_RS: Reed-Solomon Forward Error Detection mode
1399− * @ETHTOOL_FEC_BASER: Base-R/Reed-Solomon Forward Error Detection mode
1419+ * @ETHTOOL_FEC_RS: Reed-Solomon FEC Mode
1420+ * @ETHTOOL_FEC_BASER: Base-R/Reed-Solomon FEC Mode
1421+ * @ETHTOOL_FEC_LLRS: Low Latency Reed Solomon FEC Mode (25G/50G Ethernet
1422+ * Consortium)
14001423 */
14011424 enum ethtool_fec_config_bits {
14021425 ETHTOOL_FEC_NONE_BIT,