summaryrefslogtreecommitdiff
path: root/src/shared/ethtool-util.c
Commit message (Collapse)AuthorAgeFilesLines
* tree-wide: use error codes in xxx_from_string()Yu Watanabe2021-02-121-1/+1
|
* ethtool: add two new link modesYu Watanabe2020-12-031-0/+2
|
* ethtool: make ethtool_get_driver() return -ENODATA if ioctl succeeds but ↵Yu Watanabe2020-11-101-0/+3
| | | | | | driver name is empty Inspired by #17532.
* ethtool: add several assertionsYu Watanabe2020-11-101-23/+77
|
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* Merge pull request #17185 from yuwata/ethtool-updateZbigniew Jędrzejewski-Szmek2020-10-231-15/+38
|\ | | | | ethtool: add several link modes
| * ethtool: add several new link modesYu Watanabe2020-09-281-0/+23
| |
| * ethtool: convert underscore to hyphenYu Watanabe2020-09-281-15/+15
| |
* | ethtool: constify arguments for ethtool_set_xxx()Yu Watanabe2020-09-151-4/+4
|/
* ethtool: downgrade log level when the error will be ignoredYu Watanabe2020-09-101-12/+14
|
* ethtool-util: don't pass error value that isn't used to log_syntaxLennart Poettering2020-09-091-1/+1
|
* Merge pull request #15762 from keszybz/gcc-10-buildZbigniew Jędrzejewski-Szmek2020-05-111-0/+10
|\ | | | | Fix build with -O3 with gcc 10
| * shared/ethtool-util: hush gcc warnings about array boundsZbigniew Jędrzejewski-Szmek2020-05-111-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [127/1355] Compiling C object 'src/shared/5afaae1@@systemd-shared-245@sta/ethtool-util.c.o' ../src/shared/ethtool-util.c: In function ‘ethtool_get_permanent_macaddr’: ../src/shared/ethtool-util.c:260:60: warning: array subscript 5 is outside the bounds of an interior zero-length array ‘__u8[0]’ {aka ‘unsigned char[]’} [-Wzero-length-bounds] 260 | ret->ether_addr_octet[i] = epaddr.addr.data[i]; | ~~~~~~~~~~~~~~~~^~~ In file included from ../src/shared/ethtool-util.c:5: ../src/shared/linux/ethtool.h:704:7: note: while referencing ‘data’ 704 | __u8 data[0]; | ^~~~ ../src/shared/ethtool-util.c: In function ‘ethtool_set_features’: ../src/shared/ethtool-util.c:488:31: warning: array subscript 0 is outside the bounds of an interior zero-length array ‘__u32[0]’ {aka ‘unsigned int[]’} [-Wzero-length-bounds] 488 | len = buffer.info.data[0]; | ~~~~~~~~~~~~~~~~^~~ In file included from ../src/shared/ethtool-util.c:5: ../src/shared/linux/ethtool.h:631:8: note: while referencing ‘data’ 631 | __u32 data[0]; | ^~~~ The kernel should not define the length of the array, but it does. We can't fix that, so let's use a cast to avoid the warning. For https://github.com/systemd/systemd/issues/6119#issuecomment-626073743. v2: - use #pragma instead of a cast. It seems the cast only works in some cases, and gcc is "smart" enough to see beyond the cast. Unfortunately clang does not support this warning, so we need to do a config check whether to try to suppress.
* | networkctl: use uint64_t for link speed throughoutнаб2020-05-091-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | format-table used size_t/uint64_t interchangeably for TABLE_BPS, and ethtool-util used SIZE_MAX to indicate SPEED_UNKNOWN, which worked only on ABIs with 64-bit pointers. For example, the tg3 driver returns SPEED_UNKNOWN with no link (cf. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/ethernet/broadcom/tg3.c?id=3eb2efbea193789397c36f52b17d8692ac79bf68#n12190) which on x32 (and other 32-bit ABIs, presumably) caused "networkctl status" to mark it with "Speed: 4Gbps": nabijaczleweli@szarotka:~$ networkctl --version systemd 245 (245.5-2) nabijaczleweli@szarotka:~$ file $(which networkctl) /bin/networkctl: ELF 32-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /libx32/ld-linux-x32.so.2, BuildID[sha1]=36d684cb1fc8fb5060050d32b969e5aa172fa607, for GNU/Linux 3.4.0, stripped nabijaczleweli@szarotka:~$ networkctl status onboard1 ● 4: onboard1 Driver: tg3 Model: NetXtreme BCM5755 Gigabit Ethernet PCI Express Speed: 4Gbps Whereas on 64-bit-pointer ABIs (here: amd64): nabijaczleweli@szarotka:~$ networkctl --version systemd 245 (245.5-2) nabijaczleweli@szarotka:~$ file $(which networkctl) /bin/networkctl: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=7a3e406e54968d7774ad467fc3f6a9d35ff7aea2, for GNU/Linux 3.2.0, stripped nabijaczleweli@szarotka:~$ networkctl status onboard1 ● 4: onboard1 Driver: tg3 Model: NetXtreme BCM5755 Gigabit Ethernet PCI Express Speed: n/a With this patch, networkctl returns, for x32: nabijaczleweli@szarotka:~$ networkctl --version systemd 245 (245.5-2.1~networkctl-4g-v2) nabijaczleweli@szarotka:~$ file $(which networkctl) /bin/networkctl: ELF 32-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /libx32/ld-linux-x32.so.2, BuildID[sha1]=36d684cb1fc8fb5060050d32b969e5aa172fa607, for GNU/Linux 3.4.0, stripped nabijaczleweli@szarotka:~$ networkctl status onboard1 ● 4: onboard1 Driver: tg3 Model: NetXtreme BCM5755 Gigabit Ethernet PCI Express Speed: n/a And for amd64: nabijaczleweli@szarotka:~$ file $(which networkctl) /bin/networkctl: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=7a3e406e54968d7774ad467fc3f6a9d35ff7aea2, for GNU/Linux 3.2.0, stripped nabijaczleweli@szarotka:~$ networkctl status onboard1 ● 4: onboard1 Driver: tg3 Model: NetXtreme BCM5755 Gigabit Ethernet PCI Express Speed: n/a
* link: Allow configuring RX mini and jumbo ring sizes, toonabijaczleweli2020-04-291-0/+16
| | | | | This now covers all ethtool_ringparam configurables (as of v5.6; https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/ethtool.h?h=v5.6#n488)
* link: Add units and fix typo in (Rx|Tx)BufferSize= manpage. Clean up the ↵nabijaczleweli2020-04-291-10/+6
| | | | implementation slightly
* udev: support to update flow control parameterYu Watanabe2020-03-071-0/+49
| | | | Closes #14770.
* udev: add {Receive,Transmit}ChecksumOffload= settingsYu Watanabe2020-02-031-24/+29
| | | | Closes #14661.
* network,udev: use uint64_t for bit rateYu Watanabe2020-01-211-2/+2
| | | | Fixes #14620.
* network: use automatic stack allocation and structured initZbigniew Jędrzejewski-Szmek2020-01-081-15/+13
|
* network: do not require ethtool_get_permanent_macaddr() to get an fdZbigniew Jędrzejewski-Szmek2020-01-081-1/+5
|
* network: rename *fd to *ethtool_fdZbigniew Jędrzejewski-Szmek2020-01-081-36/+36
|
* ethtool: introduce ethtool_get_permanent_macaddr()Yu Watanabe2020-01-081-0/+41
| | | | Will be used in later commits.
* udev: tiny update for log messagesYu Watanabe2019-11-261-1/+1
|
* tree-wide: drop double newlineYu Watanabe2019-11-041-1/+0
|
* tree-wide: drop missing.hYu Watanabe2019-10-311-1/+0
|
* shared: fix a copy-paste error in ethtool-utilFrantisek Sumsal2019-09-271-1/+1
| | | | CID#1405818
* link: Add support to configure NIC ring buffer sizeSusant Sahani2019-09-241-0/+90
|
* tree-wide: some more [static] related fixesLennart Poettering2019-07-121-0/+2
| | | | | | | | | | | let's add [static] where it was missing so far Drop [static] on parameters that can be NULL. Add an assert() around parameters that have [static] and can't be NULL hence. Add some "const" where it was forgotten.
* ethtool: reindent link mode tableYu Watanabe2019-06-251-52/+52
|
* ethtool: add missing link modeYu Watanabe2019-06-251-0/+15
|
* ethtool-util: fix returned value when ethtool_cmd_speed() is SPEED_UNKNOWNYu Watanabe2019-06-251-2/+7
|
* ethtool-util: introduce ethtool_get_link_info()Yu Watanabe2019-06-191-0/+38
| | | | Will be used in later commits.
* ethtool-util: make ethtool_connect() warn on failureYu Watanabe2019-06-191-14/+15
|
* ethtool-util: use structured initializersYu Watanabe2019-06-191-16/+19
|
* ethtool-util: move from src/udev/net/ to src/shared/Yu Watanabe2019-06-191-0/+796