Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp26747614rwd; Mon, 3 Jul 2023 14:28:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5IfdAsPZcyTKF2noJO1afvLiXLYFKmTHf0uGnik/UzWqwiDfSFCetoFLteRrTbPXJsm35k X-Received: by 2002:a05:6a21:33a9:b0:12d:5b6:7b32 with SMTP id yy41-20020a056a2133a900b0012d05b67b32mr12231822pzb.3.1688419682167; Mon, 03 Jul 2023 14:28:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688419682; cv=none; d=google.com; s=arc-20160816; b=LpnVgkQNzLQYLgqTGrHhQ7JOos7zIArgLPrazCZ2JC0Qlw/PDzmhNcySrkRidaqUCP z4EneqOifoaAZboHomB4q1MB15kbi+8l2Ln3EJ6oKHSskq8WSVEFkWAtr77hGrRhC+ug KTq8h9MiFhKv7eMSoDSg83ET/jW30QjggTikoJxzu5AapcTo8R8BuFvX9Lo9t4hsed10 nncSRDdtYbuEW0kXlDp2TI21gNjtnbKJVksPM1jm+pxO8WbF4qXCPZP17g7XDJh/gL8h 6ig3cT4jzUkbw0i7yLPEzc/HdQ2k1RlI5bX6O7L0Iw4yAqcYJ0xn/j0A5w+MfWEOMkLy Fpfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=27GIYsPSYheuZYjfnBgY9dY1AI+iDe9MGAyTUH7wAbw=; fh=f//ep1TkUt+II2QgjUHHWVgD3j8U4A5S6o+lU/Qb/AU=; b=wGMydU8Uye7KJJ9/0Bu1D2Ceyil84jlJg8RTPPDcoDwm7MtCUexB1fDsQuibpjRiBO z8SxKqJ7e6kKXQYwpywFBS3VaBD6Wh281iRcLgw9sZLWzYFlJUH3Xk7O3eTHGpXbMfqU PkcQdb0iPjqf1OOdIMNwtk9CAsk8Ilfsl6MRtTZ+d+F/lX81uNDaTjHahSsezQN4lTaT rdWhujekTzEZrU/raJNaTD9VxbWtATBa9vC4NXs0df/2XyZ1b6fsIYyOMq0PSsd8/M37 aDMhsO5Fq47igi7BPliR5KDqnBjzEkKRwk+wte5ZZriSsdnHq534Wo8IdiTuWnT7zkED NpKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20221208 header.b=IOcvgpL4; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i8-20020a17090332c800b001ac62935789si13192300plr.468.2023.07.03.14.27.50; Mon, 03 Jul 2023 14:28:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20221208 header.b=IOcvgpL4; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230295AbjGCVZk (ORCPT + 60 others); Mon, 3 Jul 2023 17:25:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229653AbjGCVZj (ORCPT ); Mon, 3 Jul 2023 17:25:39 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5F0EE59; Mon, 3 Jul 2023 14:25:34 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-991da766865so585994266b.0; Mon, 03 Jul 2023 14:25:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20221208; t=1688419533; x=1691011533; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=27GIYsPSYheuZYjfnBgY9dY1AI+iDe9MGAyTUH7wAbw=; b=IOcvgpL4lDSPZB0wS+KnFPsWFWxGPNIxVy4LTPW2eni5uV7iodZ8DZOwjd1wd5xLxQ MRSmMJTnNP8IIlAafI8k0DHKDsDnT145qNImdENmUzLPwX1WGDhZVSdGf/Q6WSzcVztV qzq1QbK8dm2ZVh2dYiV7p4OPFE15989TIzHRAsahrOBQqJWoNCERfNAkpnnd4bzVYmJC l/EAgeNDZgmxB7rEgT9I4Zxwf5EnmYunyfBl6QuiQrXATQ1Aju8gzxktBwJZIXacdIyW 6WsGe3T21oddbLJiaHpHPAKlw8KWtW2CWxKDzfdR1Ws1WVPeutqciT4tMOhNz5DjekUb otUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688419533; x=1691011533; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=27GIYsPSYheuZYjfnBgY9dY1AI+iDe9MGAyTUH7wAbw=; b=YFFTTripa6EwE8wQ7AjX+isH87filkQZVidcUV5VPJ/xXh+ISdu2lruB0U5LYqbsBC rTHDuwmOEy1xdAhbOBp7ohM8Xg/RP1sGQZ5oq4piGE6tkivlHG81la4IA086LP0X3Weg JvzmimlTMbGM6cTCBizeUeI+f7pnNwwshBe9FeZOqWHDyIgu0MoUXqEponsd1LMn5yXA nhynXyvcY7HHGtJAZK/qAQPiDwvWkylMTx38RHORpYAJwiYq0VPexKuxHu4mDVBL9ItB VKMVhOZ8hHTy8pbxCJriCPqUCd2eKkotZkxwvvleB6W4BiKKfS+6nz/1svA69XYToyw7 fUWg== X-Gm-Message-State: ABy/qLb/XwLSsyoNApcijKnqXRNvLekiw1h1iZD7bqAfJ2RKdBrH5d4/ 17YGwyKgKydxnkqJSLzQDddGGKhXogHU93y42Uc= X-Received: by 2002:a17:906:5e4b:b0:991:cd1f:e67a with SMTP id b11-20020a1709065e4b00b00991cd1fe67amr7901290eju.29.1688419533205; Mon, 03 Jul 2023 14:25:33 -0700 (PDT) MIME-Version: 1.0 References: <9ab8cc85d4d440bfa63dcade4e4f9ecf@realtek.com> In-Reply-To: From: Martin Blumenstingl Date: Mon, 3 Jul 2023 23:25:22 +0200 Message-ID: Subject: Re: wifi: rtw88: question about SDIO RX aggregation limiting To: Ping-Ke Shih Cc: "linux-wireless@vger.kernel.org" , "Lukas F. Hartmann" , "linux-kernel@vger.kernel.org" , "tony0620emma@gmail.com" , "jernej.skrabec@gmail.com" Content-Type: multipart/mixed; boundary="000000000000824ae805ff9bcecc" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org --000000000000824ae805ff9bcecc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello Ping-Ke, sorry again for the long waiting time. I'll be quicker next time. On Tue, Jun 20, 2023 at 7:26=E2=80=AFAM Ping-Ke Shih w= rote: [...] > > > The unit of BIT_RXDMA_AGG_PG_TH is 1k bytes, so I think you can > > > set mmc_host->max_req_size/1024. > > I tried this but I got a result that I don't understand. > > I've been testing with three BIT_RXDMA_AGG_PG_TH values on a SoC that > > can handle 255 * 1024 bytes. Each time I connected to the same AP and > > downloaded a bigger file over http(s). > > BIT_RXDMA_AGG_PG_TH: biggest observed rx_len in rtw_sdio_rxfifo_recv() > > 255: 20968 > > 6: 5122 > > 1: 1602 > > Please also print out number of packets you receive, and then we can see = how > many packets aggregate. sure - here are the results: BIT_RXDMA_AGG_PG_TH: biggest observed rx_len in rtw_sdio_rxfifo_recv() / number of (aggregated) packets 255: 20824 / 12 6: 5128 / 4 1: 3132 / 1 (these were a few exceptions and I'm not able to reliably reproduce it, 1602 / 1 is what I can easily reproduce) > > The biggest rx_len I have observed for BIT_RXDMA_AGG_PG_TH 1 looks susp= icious: > > My understanding is that I shouldn't be seeing rx_len larger than > > BIT_RXDMA_AGG_PG_TH * 1024. > > BIT_RXDMA_AGG_PG_TH =3D 6 is within this limit but BIT_RXDMA_AGG_PG_TH = =3D > > 1 isn't (I'm seeing 578 extra bytes in addition to the 1024 bytes that > > I was expecting). > > Assume threshold is 1k, and single one packet is larger than 1k. Hardware > will not split it into two. Also, please make sure 0x280[29] BIT_EN_PRE_C= ALC > is 1. Otherwise, it will possibly aggregate additional one packet to over > the threshold. From the numbers above it seems most likely that we're hitting the "one packet is larger than 1k" case. Also I'm seeing: wlan0: mtu 1500 qdisc noqueue state UP group default qlen 1000 My interface's MTU is 1500 bytes. Seeing 1602 bytes rx_len with one packet is already odd (that would mean 102 bytes for overhead like RX descriptor and other headers/metadata). But 3132 bytes rx_len is very odd. BIT_EN_PRE_CALC is set, see also the attached diff (it's not meant to be applied anywhere - it's just so you understand what I've been testing with). > 0x280[15:8] is timeout time in unit of 1us for SDIO interface. When set > threshold to 255, you can enlarge this to see if it can aggregate more as > expected. I did not experiment with this yet as I'd like to understand the above findings first. Best regards, Martin --000000000000824ae805ff9bcecc Content-Type: text/x-patch; charset="US-ASCII"; name="rtw88-rx-agg-test.diff" Content-Disposition: attachment; filename="rtw88-rx-agg-test.diff" Content-Transfer-Encoding: base64 Content-ID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