Bug #110163 IPTOS_THROUGHPUT enabling code is bypassed on Linux
Submitted: 22 Feb 2023 7:22 Modified: 22 Feb 2023 7:55
Reporter: Cai Yibo (OCA) Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: Compiling Severity:S5 (Performance)
Version:8.0 OS:Linux
Assigned to: CPU Architecture:Any
Tags: tcpip, vio

[22 Feb 2023 7:22] Cai Yibo
vio_fastsend() tris to enable IPTOS_THROUGHPUT option, copied from below code.

    int tos = IPTOS_THROUGHPUT;
    r = mysql_socket_setsockopt(vio->mysql_socket, IPPROTO_IP, IP_TOS,
                                (void *)&tos, sizeof(tos));

This code is not compiled on Linux as the macro IPTOS_THROUGHPUT is defined in <netinet/ip.h>, but this file is not included in the source code. Only <netinet/in.h> is included, which doesn't contain the macro.

Run "man 7 ip" to see related info.

How to repeat:

Suggested fix:
Include <netinet/ip.h> to viosocket.cc.
[22 Feb 2023 7:25] Cai Yibo
Test environment:
- mysql-8.0.32 tag
- ubuntu-20.04
- gcc-10.3, libc6
[22 Feb 2023 7:55] MySQL Verification Team
Hello Cai Yibo,

Thank you for the report and feedback.