From 3e6165db2d272819764e213661b06646f9072e37 Mon Sep 17 00:00:00 2001 From: Kazuki Hashimoto Date: Mon, 26 Jun 2023 08:10:41 +0900 Subject: [PATCH 1/2] mt7921: Disable mib stats Adds a lot of overhead. Signed-off-by: Kazuki Hashimoto --- drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c index 1675bf52048126..717384a221943e 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c @@ -957,6 +957,7 @@ void mt7921_mac_update_mib_stats(struct mt7921_phy *phy) int i, aggr0 = 0, aggr1; u32 val; + return; mib->fcs_err_cnt += mt76_get_field(dev, MT_MIB_SDR3(0), MT_MIB_SDR3_FCS_ERR_MASK); mib->ack_fail_cnt += mt76_get_field(dev, MT_MIB_MB_BSDR3(0), From 56c670e79e5e28208787a2935b1196ba7e41073a Mon Sep 17 00:00:00 2001 From: Panchajanya1999 Date: Thu, 29 Sep 2022 12:47:41 +0530 Subject: [PATCH 2/2] ipv4/tcp: Force applications to use TCP_NODELAY to improve network latency `TCP_NODELAY` will disable Nagle's algorithm, which basically collects small outgoing packets to send all at once. Thus `TCP_NODELAY` will send the data whenever it is available without waiting for any period to collect packets. It will basically optimize network video games and applications using chatty protocols (source: ExtraHop[1], RedHat[2]) [1]: https://www.extrahop.com/company/blog/2016/tcp-nodelay-nagle-quickack-best-practices/#:~:text=The%20TCP_NODELAY%20socket%20option%20allows,buffer%2C%20whatever%20the%20packet%20size. [2]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux_for_real_time/7/html/tuning_guide/tcp_nodelay_and_small_buffer_writes Signed-off-by: Panchajanya1999 [Rasenkai: forward-port to 5.4] Signed-off-by: Rasenkai Change-Id: I2518d04969975c69c61d5e0acab7295702190b0d --- net/ipv4/tcp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 8ed52e1e3c99a3..72a7178f4ff02b 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -3463,6 +3463,9 @@ int do_tcp_setsockopt(struct sock *sk, int level, int optname, sockopt_lock_sock(sk); + /* Hack optname to use TCP_NODELAY for everything */ + optname=TCP_NODELAY; + switch (optname) { case TCP_MAXSEG: /* Values greater than interface MTU won't take effect. However