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 49AACC3DA4A for ; Thu, 1 Aug 2024 14:31:26 +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=C1zAq2A8tIjO2hNDIqGfuwyFl2KKWufIdH/9uRMO7aA=; b=lxJgcLSG+hZELgXreGXcxmQrZa /fziHShcV4EdELEmjb9jArdVXe8x6yz9XW+fCq6gH4nxeDIKCyPXKhkPj+X51zDBRtdqQOPk2QJ4J JorSwEv0ML3gs90QSYM75dyBCCytuytxFaYhfIrLjC9V1TKX63VAufL/LN6qi4BTO6GLv/0ED3gUh StRHMQARKdf855OSuYhQZOD1daSfI3M+1GiUoPs96vTJZuwp9TLF0EW2cp5hTD5yw74GVZs7xFCVr SA4AYrckWjN+kkNP/Id6N2brVsaVFXn8UyaQIjoYnbVJmP2h4dfU8s1h9iyY06225itWS0ytBLW3H a5FIcyVQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZWpl-00000005flH-3QOK; Thu, 01 Aug 2024 14:31:13 +0000 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZVdC-00000005RGr-1XjN for linux-arm-kernel@lists.infradead.org; Thu, 01 Aug 2024 13:14:12 +0000 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-368313809a4so1246169f8f.0 for ; Thu, 01 Aug 2024 06:14:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1722518048; x=1723122848; 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=C1zAq2A8tIjO2hNDIqGfuwyFl2KKWufIdH/9uRMO7aA=; b=AO0+kmIj+pZKauDzwa76QmKBaswybqZIWBaJyYO1aAfF8v2fYzoF2evoEosiSjJiDV y2VtFRdyNXZFEzKV3BlE60qFE354T4mkOYhlIivVoyGtd+4vzytRTOHFQxiFXk0OOS+u je43NN8lDUVN4VUQ46NXNidDkGiar4CAvKZTY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722518048; x=1723122848; 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=C1zAq2A8tIjO2hNDIqGfuwyFl2KKWufIdH/9uRMO7aA=; b=hRNPM06s+ea3QTqIR8+9y+4bkMT7vgx7GOcIYyru1NEW5iIMv7TqZSpGOhpEUl3JAL TdYtblEyakvj/iwKjfhHRr0lyXC1Ikog2u+P58BOKpLtEvfRJnXV5ccavpZokdNfJCzO QuDXpVWWIqjdoFRgssEtX/7vNXn7OGquMGTUZZt8Y1L8mHcfjePXYKHq1ZMvx4Ye8Rkk CtB71Jy3KfBVocOSO5rZpgiRGQSHlMaatYODz9iawM/C2pUUxrY/0IViEgvHHowLDNFw 64Rr36zyFR5Jj3VJoI8Uelb7QR9gxUQUWHB3lJlY6jPPT1mYOTUvKlTblkMRqJDG/6K0 eh/g== X-Forwarded-Encrypted: i=1; AJvYcCVf7JheOppyEXM1lEN0KX74FxCfP1NG8soQR7A3GUR2RYacs9s3oW3wBjixQxtfEO9C1ZLWFbf90ju2gF7w3DLeOUu5PBO41c8LuMFDLtVFEsM+qzM= X-Gm-Message-State: AOJu0Yzhd0pRBDSolsNp51HJl2JuN4ljzHl5qZfksOgzVqa79f+1D35a cEC349z9KNQXv//2AevvtoI54MQZwvUJaukKgnI+blklTlxtApyqQbYxyGxkimQ= X-Google-Smtp-Source: AGHT+IGY6C6HxMfYIEbuN5skOyWJua94QhKtVofdw583XyL2PipegA2/E/h1+XhGjqNYBfKRCf4SUQ== X-Received: by 2002:a5d:4251:0:b0:367:9048:e952 with SMTP id ffacd0b85a97d-36bb35c63f5mr1373341f8f.18.1722518048015; Thu, 01 Aug 2024 06:14:08 -0700 (PDT) Received: from LQ3V64L9R2 ([80.208.222.2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4282bb1dfd6sm56904175e9.42.2024.08.01.06.14.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Aug 2024 06:14:07 -0700 (PDT) Date: Thu, 1 Aug 2024 14:14:06 +0100 From: Joe Damato To: Stefan Roese Cc: Elad Yifee , Felix Fietkau , Sean Wang , Mark Lee , Lorenzo Bianconi , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Daniel Golle Subject: Re: [PATCH net-next v2 1/2] net: ethernet: mtk_eth_soc: use prefetch methods Message-ID: Mail-Followup-To: Joe Damato , Stefan Roese , Elad Yifee , Felix Fietkau , Sean Wang , Mark Lee , Lorenzo Bianconi , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Daniel Golle References: <20240729183038.1959-1-eladwf@gmail.com> <20240729183038.1959-2-eladwf@gmail.com> <17deb48c-6148-4e3d-aa0b-6c840f55302d@denx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <17deb48c-6148-4e3d-aa0b-6c840f55302d@denx.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240801_061410_560570_543FEB79 X-CRM114-Status: GOOD ( 32.24 ) 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 Thu, Aug 01, 2024 at 09:09:27AM +0200, Stefan Roese wrote: > On 7/30/24 20:35, Elad Yifee wrote: > > On Tue, Jul 30, 2024 at 11:59 AM Joe Damato wrote: > > > > > > Based on the code in mtk_probe, I am guessing that only > > > MTK_SOC_MT7628 can DMA to unaligned addresses, because for > > > everything else eth->ip_align would be 0. > > > > > > Is that right? > > > > > > I am asking because the documentation in > > > Documentation/core-api/unaligned-memory-access.rst refers to the > > > case you mention, NET_IP_ALIGN = 0, suggesting that this is > > > intentional for performance reasons on powerpc: > > > > > > One notable exception here is powerpc which defines NET_IP_ALIGN to > > > 0 because DMA to unaligned addresses can be very expensive and dwarf > > > the cost of unaligned loads. > > > > > > It goes on to explain that some devices cannot DMA to unaligned > > > addresses and I assume that for your driver that is everything which > > > is not MTK_SOC_MT7628 ? > > > > I have no explanation for this partial use of 'eth->ip_align', it > > could be a mistake > > or maybe I'm missing something. > > Perhaps Stefan Roese, who wrote this part, has an explanation. > > (adding Stefan to CC) > > Sorry, I can't answer this w/o digging deeper into this driver and > SoC again. And I didn't use it for a few years now. It might be a > mistake. I asked about it because it was added in v2 of the patch, see the changelog from the patch: - use eth->ip_align instead of NET_IP_ALIGN as it could be 0, depending on the platform It seemed like from the changelog some one decided adding that made sense and I was just confirming the reasoning above.