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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B0A6BC3DA5D for ; Mon, 22 Jul 2024 18:27:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9biYfsdlWUFfa2uPahdEjhFynqs7UpMUrewmhcvPcXA=; b=HWtPNge97SJ2ENztiX1rtLH/ck HOyPJ7x/iSgPlnOEaUF25f2Ci8nGHs7h9Xz3lozAPFe8VbeXyg87JQrrWuwwB3PKWmlKmaNH1Bav7 fBzROHHj5vY1kTRLciChZM9AqLzVWwBbnuXfNijelhbK4A07iRR7g5I8VwNzU4ZfTmDg9AlU/CdXY ++Y82Cf0/gcJ1wopOuKe85iWa1SmNUjLcmTIXjK0T3658miU8IrWENb6EM32MjRwY58/VHEmRI4e9 N7TeYfCvPNDejjPnRmKc8jsHmpbGeM1N3BU2G42EtJLB25/WmBUdyME7wlMcTXr8sqeuAjZY9QB8H XlcAemkQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sVxkW-0000000AH7t-3ccu; Mon, 22 Jul 2024 18:27:04 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sVxkA-0000000AH2F-25T9 for linux-arm-kernel@lists.infradead.org; Mon, 22 Jul 2024 18:26:44 +0000 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-70d399da0b5so321024b3a.3 for ; Mon, 22 Jul 2024 11:26:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1721672801; x=1722277601; darn=lists.infradead.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:from:to:cc:subject:date:message-id:reply-to; bh=9biYfsdlWUFfa2uPahdEjhFynqs7UpMUrewmhcvPcXA=; b=wdcu6p6ps/eKPY8iFRz2srp9MoZkVBRMDv0fSxhIDONEHRoGYHWkCQV8Qeiu21a7vQ gZYS1Ip8RXZn/cc7PXYGGJU7NCF0obz7Rta8U3zoY/7gpKwjv8TEBv970llI8FGuL3PY Bej6rFl5I28Jfv5yJrI20GA0tCJZ1NShhgjDU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721672801; x=1722277601; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9biYfsdlWUFfa2uPahdEjhFynqs7UpMUrewmhcvPcXA=; b=HNNjTgN+cYtUKZPqdMlB3zLQDjlfcV73sMQJh9e1FXfTwN59QdjfsDaLq5FlqhNn5c CCOhtJecrHJZiwS6PVajVW+Sj2uTLh1UxXSVCLt1F4rVUMJkbQ0I2DO8hPgJxGQRB0GL cd4YnmYpD8GSa9J6tE0rwxczEkToUvVWzxDCyUb72UNOSjC1UOSf1TBJd5RwfM51kyxE x1/1na+nm2bbx7RhQ9i6EElFlHOqTvsNqZ9YZOx5fnZ6FQfXVGlRoRnewAGwB+jPh06a 8Dckf+LEZs+kLV0nrl0mWpAdIQp6jytyipDueRAInD9Cy1PsKyaZ/tfoXgyUUbuvPagw ytvw== X-Forwarded-Encrypted: i=1; AJvYcCUI6T+U53mMYgkOnQMhr06C60GmOJFNfICnT4yzjFYdxCVgBi2USYrHnTJrKfXqSHiLXifP76BlZb33t8UN+YB7KGd9uQVJmFcQvYKzwH/SF83oIV0= X-Gm-Message-State: AOJu0YyK+sLISqrJPAcriW1FAfwpPi5D9XWfI94rDoU2LLu4XGr82dUT UBST5K3jqZt1oElfEcKdrLnuuz5GX5pm3yQyu5SwBQGcpfyLNuhvbY4ed7Knvd4= X-Google-Smtp-Source: AGHT+IHHHCDBMnxogaNQNY0v9bDW89ARG24TCy7ngJQcYGVhGfiHTIWN+aI+488Iott9h8yr0vfjFA== X-Received: by 2002:a05:6a20:cfa7:b0:1c3:b239:83e2 with SMTP id adf61e73a8af0-1c4285b767bmr9863586637.12.1721672800827; Mon, 22 Jul 2024 11:26:40 -0700 (PDT) Received: from LQ3V64L9R2 (c-24-6-151-244.hsd1.ca.comcast.net. [24.6.151.244]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fd6f48f3ffsm57826685ad.285.2024.07.22.11.26.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 11:26:40 -0700 (PDT) Date: Mon, 22 Jul 2024 11:26:37 -0700 From: Joe Damato To: Elad Yifee Cc: daniel@makrotopia.org, Felix Fietkau , Sean Wang , Mark Lee , Lorenzo Bianconi , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, bpf@vger.kernel.org Subject: Re: [PATCH net-next RFC] net: ethernet: mtk_eth_soc: use prefetch methods Message-ID: Mail-Followup-To: Joe Damato , Elad Yifee , daniel@makrotopia.org, Felix Fietkau , Sean Wang , Mark Lee , Lorenzo Bianconi , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, bpf@vger.kernel.org References: <20240720164621.1983-1-eladwf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240722_112642_673725_F65602B8 X-CRM114-Status: GOOD ( 20.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jul 22, 2024 at 09:04:06PM +0300, Elad Yifee wrote: > On Mon, Jul 22, 2024 at 7:17 PM Joe Damato wrote: > > > > On Sat, Jul 20, 2024 at 07:46:18PM +0300, Elad Yifee wrote: > > > Utilize kernel prefetch methods for faster cache line access. > > > This change boosts driver performance, > > > allowing the CPU to handle about 5% more packets/sec. > > > > Nit: It'd be great to see before/after numbers and/or an explanation of > > how you measured this in the commit message. > Sure, I'll add iperf3 results in the next version. Thanks, that'd be helpful! [...] > > > @@ -2039,7 +2040,7 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget, > > > idx = NEXT_DESP_IDX(ring->calc_idx, ring->dma_size); > > > rxd = ring->dma + idx * eth->soc->rx.desc_size; > > > data = ring->data[idx]; > > > - > > > + prefetch(rxd); > > > > Maybe net_prefetch instead, as mentioned above? > This is the only case where I think prefetch should be used since it's > only the descriptor. I think you are implying that the optimization in the case of L1_CACHE_BYTES < 128 is unnecessary because because the mtk_rx_dma_v2 descriptors will be too far (i * eth->soc->rx.desc_size) apart to get any benefit from prefetching more data ? If my understanding is correct, then yes: I agree. > Thank you for your suggestions No problem!