From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F16CC61DA4 for ; Sat, 18 Feb 2023 09:42:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229619AbjBRJml convert rfc822-to-8bit (ORCPT ); Sat, 18 Feb 2023 04:42:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229460AbjBRJmk (ORCPT ); Sat, 18 Feb 2023 04:42:40 -0500 Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 099B131E1C for ; Sat, 18 Feb 2023 01:42:36 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 80FDC6226244; Sat, 18 Feb 2023 10:42:34 +0100 (CET) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id bcR6KKwu6TyN; Sat, 18 Feb 2023 10:42:34 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 1028D642ECDA; Sat, 18 Feb 2023 10:42:34 +0100 (CET) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 8_2rq167ME_T; Sat, 18 Feb 2023 10:42:33 +0100 (CET) Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lithops.sigma-star.at (Postfix) with ESMTP id E77F56226244; Sat, 18 Feb 2023 10:42:33 +0100 (CET) Date: Sat, 18 Feb 2023 10:42:33 +0100 (CET) From: Richard Weinberger To: wei fang Cc: Andrew Lunn , David Laight , netdev , shenwei wang , xiaoning wang , linux-imx Message-ID: <130183416.146934.1676713353800.JavaMail.zimbra@nod.at> In-Reply-To: References: <1422776754.146013.1676652774408.JavaMail.zimbra@nod.at> Subject: Re: high latency with imx8mm compared to imx6q MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Originating-IP: [195.201.40.130] X-Mailer: Zimbra 8.8.12_GA_3807 (ZimbraWebClient - FF97 (Linux)/8.8.12_GA_3809) Thread-Topic: high latency with imx8mm compared to imx6q Thread-Index: KX6nItb3xzzXXgLsKrBE7F/dfPfNJbU33POAgABHTYCAAAZaMMtWSb1c Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org ----- Ursprüngliche Mail ----- > Von: "wei fang" >> > Is it just interrupt latency caused by interrupt coalescing to avoid >> > excessive interrupts? >> >> Just adding to this, it appears imx6q does not have support for changing the >> interrupt coalescing. imx8m does appear to support it. So try playing with >> ethtool -c/-C. >> > Yes, I agree with Andrew, the interrupt coalescence feature default to be > enabled > on i.MX8MM platforms. The purpose of the interrupt coalescing is to reduce the > number of interrupts generated by the MAC so as to reduce the CPU loading. > As Andrew said, you can turn down rx-usecs and tx-usecs, and then try again. Hm, I thought my settings are fine (IOW no coalescing at all). Coalesce parameters for eth0: Adaptive RX: n/a TX: n/a stats-block-usecs: n/a sample-interval: n/a pkt-rate-low: n/a pkt-rate-high: n/a rx-usecs: 0 rx-frames: 0 rx-usecs-irq: n/a rx-frames-irq: n/a tx-usecs: 0 tx-frames: 0 tx-usecs-irq: n/a tx-frames-irq: n/a rx-usecs-low: n/a rx-frame-low: n/a tx-usecs-low: n/a tx-frame-low: n/a rx-usecs-high: n/a rx-frame-high: n/a tx-usecs-high: n/a But I noticed something interesting this morning. When I set rx-usecs, tx-usecs, rx-frames and tx-frames to 1, *sometimes* the RTT is good. PING 192.168.0.52 (192.168.0.52) 56(84) bytes of data. 64 bytes from 192.168.0.52: icmp_seq=1 ttl=64 time=0.730 ms 64 bytes from 192.168.0.52: icmp_seq=2 ttl=64 time=0.356 ms 64 bytes from 192.168.0.52: icmp_seq=3 ttl=64 time=0.303 ms 64 bytes from 192.168.0.52: icmp_seq=4 ttl=64 time=2.22 ms 64 bytes from 192.168.0.52: icmp_seq=5 ttl=64 time=2.54 ms 64 bytes from 192.168.0.52: icmp_seq=6 ttl=64 time=0.354 ms 64 bytes from 192.168.0.52: icmp_seq=7 ttl=64 time=2.22 ms 64 bytes from 192.168.0.52: icmp_seq=8 ttl=64 time=2.54 ms 64 bytes from 192.168.0.52: icmp_seq=9 ttl=64 time=2.53 ms So coalescing plays a role but it looks like the ethernet controller does not always obey my settings. I didn't look into the configured registers so far, maybe ethtool does not set them correctly. Thanks, //richard