ip: drop unnecessary fallback to ioctl for tx queue length
Subsystems (2)
PATCH 1/1 ip: drop unnecessary fallback to ioctl for tx queue length
Kernel has been reporting TxQ length with netlink since the 2.5 so the ioctl path is dead code.
Signed-off-by Stephen Hemminger <[email protected]>
--- ip/ipaddress.c | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-)
ip/ipaddress.c +3 -22
@@ -159,30 +159,11 @@ int get_operstate(const char *name)static void print_queuelen (FILE *f,struct rtattr *tb[IFLA_MAX +1 ]) { -int qlen; +if (tb[IFLA_TXQLEN ]) { +__u32 qlen =rta_getattr_u32 (tb[IFLA_TXQLEN ]); -if (tb[IFLA_TXQLEN ]) - qlen =rta_getattr_u32 (tb[IFLA_TXQLEN ]); -else { -struct ifreq ifr = {}; -int s =socket (AF_INET ,SOCK_STREAM ,0 ); - -if (s <0 ) -return ; - -strcpy (ifr.ifr_name,rta_getattr_str (tb[IFLA_IFNAME ])); -if (ioctl (s,SIOCGIFTXQLEN , &ifr) <0 ) { -fprintf (stderr, -"ioctl(SIOCGIFTXQLEN) failed: %s\n" , -strerror (errno)); -close (s); -return ; - } -close (s); - qlen = ifr.ifr_qlen; +print_uint (PRINT_ANY ,"txqlen" ,"qlen %u" , qlen); } -if (qlen) -print_int (PRINT_ANY ,"txqlen" ,"qlen %d" , qlen); }static const char *link_modes[] = {
Signature · 1 line
2.53.0
This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:
Hello:
This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:
Quoted 7 lines · On Tue, 28 Jul 2026 14:38:43 -0700 you wrote:
Kernel has been reporting TxQ length with netlink since the 2.5 so the ioctl path is dead code.
Signed-off-by Stephen Hemminger <[email protected]>--- ip/ipaddress.c | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-)
Here is the summary with links:
- [iproute2] ip: drop unnecessary fallback to ioctl for tx queue length
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=faceb3260ab2
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html