Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2158080lqb; Mon, 27 May 2024 09:34:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUynU8fgVdiFxvn+e+6NgTFI2FwBdpf7ElIF5mgojgDFUhBmwsx51ERaUW8WstTtT/ztGM2XLhYDUfSudtgfUjm8/lYdlGLwspDekXCWg== X-Google-Smtp-Source: AGHT+IEaEVu2B766ByWiXvACXPir+gbTSS3mRlgtv73TmiU1+oQs1Zlo5gyy9vdl6BJS75gb/L6I X-Received: by 2002:ae9:f807:0:b0:792:91e1:2c52 with SMTP id af79cd13be357-794ab1100a4mr1029708385a.63.1716827694191; Mon, 27 May 2024 09:34:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716827694; cv=pass; d=google.com; s=arc-20160816; b=smLxIvr/ahQEHMqxffm7PqyqecMoT8CBZ+tFCzvEZ5HCywQ5WqFA9sYoknRm19mfCU /WDhokA2nhGRuWf114hlw90lfH6J541cwdsiDpzpojP4z/8a+armPtS8rZjsnhm5oseo OUMPOcQAIFv4sX5DCPbV8Iwk0SxXHWw3/4hb0ND8KCgfqkentWj61WP0fEKb24fjg86m nfcZ5ez6BcCy3x/SkUVT+fnc8eYqKqkZg2e4Hxj/SxTJG4Rtdtr75v81BXVh8fdWKbQP 35BPIM/m2p8PD6Ye8PM7sDYFVHHN88wApFzNeatsp6/SvHlxbmncbEGC2QDHGMORjrT2 +Tbg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=GLtPNS2jldkvChLLBZmBdFhCDLFJuWcDZglJtWyDICU=; fh=NgnuGhagdRE2yOg+Umj99sBepGOMtd+eNxmPQ6wdwcU=; b=av+sESIUqArYgljSssT9llxm0iGdvTi4jynjtIYk/SG2pzC9eEKwQDJKBL5s3hBrJS VVZdUjAZJtzpz7mr+GBsZeT5xR1m7s+okNK/kExTabHs+GjxVl4wnbiBRAhz9QsFb2Vi GCguHq21li8YycE2jIxvsHoMdHEsfT5RyUnkOz3UmSfTblq+MN+0TVWGo1vdETfZ+IgK Tnz5tM4CkqlIXwPIS2mXft/3wnXKvJpgJn+coVq0P2ETbCL3sgnjjBLUT7WZudXQKbs5 pRTVeabAkfgqucoi096oZqtX/QwfaoSf8P5hR4HSsUUH9TyWm0v2vXgQusFiYP8hHMU1 iMSA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=makrotopia.org); spf=pass (google.com: domain of linux-kernel+bounces-191253-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191253-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-794abcc6b1csi815949985a.217.2024.05.27.09.34.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 09:34:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191253-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=makrotopia.org); spf=pass (google.com: domain of linux-kernel+bounces-191253-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191253-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E2B551C21A84 for ; Mon, 27 May 2024 16:34:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D7DBC73472; Mon, 27 May 2024 16:34:41 +0000 (UTC) Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF5E861FE1; Mon, 27 May 2024 16:34:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.142.180.65 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716827681; cv=none; b=RnH2PesfDUpGQuaTfl/c/WCgWnOmoYnZ+PSJu3cLRDn4rwuasOmo/uLf555+A2fmFVzm7xZyeUK7mq/aaGImtWNA/cTYsfAZMhtZ9Hc6AtQX/Xd5v5Vi67Eg+9vlCbKCthvlNZmObjMdvtbIUjVoH131NdkPCnSCT0FqtcLgrz0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716827681; c=relaxed/simple; bh=YnPCfmPlSjFb9s0kuzVRNjS5wB0T6GQWiLt+H7w4WXk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Yq8nqOJb8hL7ffbkeuhfUrEmKxuJ976E13DxmU5Z0ALJ7penz2ZC//rB4bRE1fy3UYwY5jt6kTdZp2ihzI7bU2S2b//fD+/w2rZGqiQO6h8Iw79u60SaE0JOMEqrW643hPLrcvjKuKGEYOphGTqv2rfqaoqRuDTXD2JMShSx44M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org; spf=pass smtp.mailfrom=makrotopia.org; arc=none smtp.client-ip=185.142.180.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.97.1) (envelope-from ) id 1sBcyu-000000007MD-3VgY; Mon, 27 May 2024 16:13:52 +0000 Date: Mon, 27 May 2024 17:13:42 +0100 From: Daniel Golle To: Sunil Kovvuri Goutham Cc: Sam Shih , SkyLake Huang , Steven Liu , Frank Wunderlich , Felix Fietkau , Sean Wang , Mark Lee , Lorenzo Bianconi , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Frank Wunderlich , John Crispin , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-mediatek@lists.infradead.org" Subject: Re: [net v2] net: ethernet: mtk_eth_soc: handle dma buffer size soc specific Message-ID: References: <20240527142142.126796-1-linux@fw-web.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, May 27, 2024 at 03:55:55PM GMT, Sunil Kovvuri Goutham wrote: > > > > -----Original Message----- > > From: Frank Wunderlich > > Sent: Monday, May 27, 2024 7:52 PM > > To: Felix Fietkau ; Sean Wang ; > > Mark Lee ; Lorenzo Bianconi > > ; David S. Miller ; Eric Dumazet > > ; Jakub Kicinski ; Paolo Abeni > > ; Matthias Brugger ; > > AngeloGioacchino Del Regno > > Cc: Frank Wunderlich ; John Crispin > > ; netdev@vger.kernel.org; linux-kernel@vger.kernel.org; > > linux-arm-kernel@lists.infradead.org; linux-mediatek@lists.infradead.org; > > Daniel Golle > > Subject: [net v2] net: ethernet: mtk_eth_soc: handle dma buffer size soc specific > > > > From: Frank Wunderlich > > > > The mainline MTK ethernet driver suffers long time from rarly but annoying tx > > queue timeouts. We think that this is caused by fixed dma sizes hardcoded for > > all SoCs. > > > > Use the dma-size implementation from SDK in a per SoC manner. > > > > Fixes: 656e705243fd ("net-next: mediatek: add support for MT7623 > > ethernet") > > Suggested-by: Daniel Golle > > Signed-off-by: Frank Wunderlich > > .............. > > > > diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c > > b/drivers/net/ethernet/mediatek/mtk_eth_soc.c > > index cae46290a7ae..f1ff1be73926 100644 > > --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c > > +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c > > ............. > > @@ -1142,40 +1142,46 @@ static int mtk_init_fq_dma(struct mtk_eth *eth) > > cnt * soc->tx.desc_size, > > ð->phy_scratch_ring, > > GFP_KERNEL); > > .............. > > - for (i = 0; i < cnt; i++) { > > - dma_addr_t addr = dma_addr + i * MTK_QDMA_PAGE_SIZE; > > - struct mtk_tx_dma_v2 *txd; > > + dma_addr = dma_map_single(eth->dma_dev, > > + eth->scratch_head[j], len * > > MTK_QDMA_PAGE_SIZE, > > + DMA_FROM_DEVICE); > > > > As per commit msg, the fix is for transmit queue timeouts. > But the DMA buffer changes seems for receive pkts. > Can you please elaborate the connection here. *I guess* the memory window used for both, TX and RX DMA descriptors needs to be wisely split to not risk TX queue overruns, depending on the SoC speed and without hurting RX performance... Maybe someone inside MediaTek (I've added to Cc now) and more familiar with the design can elaborate in more detail.