Received: by 10.223.185.116 with SMTP id b49csp1437402wrg; Sun, 4 Mar 2018 01:43:22 -0800 (PST) X-Google-Smtp-Source: AG47ELsvuhVNB70hE6/qCY/r6zJDr6uFAyrTqYS2tkWN/MxcVO/74jZ3Se3L2YxTdMbHPI6FxEnm X-Received: by 10.98.160.90 with SMTP id r87mr11439725pfe.151.1520156602566; Sun, 04 Mar 2018 01:43:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520156602; cv=none; d=google.com; s=arc-20160816; b=easdK6cM9yIN+yK5Nwe2zftBvnHCBm+fpw/M5+AH886feqJr5tfJnmjx7b0z5LIHq9 5vU3sq/6mT6+Uf1Myx9j1X0x9qRINQFL1G9yohjUOAi6es9UsMvvPCvANW9o/flgYtVG UyXguwXATYsAu1pJUCdd1DeLut4xvEQYWkTIpoW4jk0sCr6QlEtSj3eq5iy/dg3EccTp X5gbIH2sRgocRlLRol2FZOO8WmWs4HnWq1TG/pPg+5iifxsuPeYX/sOELo8dUW3IV8XE GGmnnt63S4U6sbVB+z/RYSonnhjgBQXpJVBNBTnyEYl3Bn4lnJzj2hn1dlEeSTRi9SnB JpaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=zk4PHzxfcG/htVSTCWNjXYJAC+NNxciZCQvwh42IPR0=; b=qX3qEl1yDuOQ34PcwM+/xRNgF2umjYlHF+nNz56Nw9uTUpDBREv0aw24Ve3H7bAmLN bWbOR+BLix+7dMbiC9+z8tDWrhUoPKJ6Gnyjiz/1Yhe33zID7KZMs7e7UVLO9V4hCSvh HG3XV12UA78o0V38vF6R+a6JCfIP6oNait8xGlVTF6g+1S0gMnR/SbhsmElrFIj5u6Ja M3xxwohY0INKhxNUMzlCmtGl044HHDN0GXslOqJttrNwcPeIrcPaL/K49KeCUVLyUUla PzE1jgh2E4WAC1o+/U1pKB3kiDf16dEw9ww+9841EKdowr6ORfEm6S4gQBaw+t8bUy4e 9pfQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z19si8168938pfd.397.2018.03.04.01.42.54; Sun, 04 Mar 2018 01:43:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752614AbeCDJ2c (ORCPT + 99 others); Sun, 4 Mar 2018 04:28:32 -0500 Received: from mail.bootlin.com ([62.4.15.54]:37896 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751844AbeCDJ2a (ORCPT ); Sun, 4 Mar 2018 04:28:30 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id E75D720715; Sun, 4 Mar 2018 10:28:27 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from windsurf.home (LFbn-TOU-1-408-85.w86-206.abo.wanadoo.fr [86.206.234.85]) by mail.bootlin.com (Postfix) with ESMTPSA id 66CED2036E; Sun, 4 Mar 2018 10:28:27 +0100 (CET) Date: Sun, 4 Mar 2018 10:28:28 +0100 From: Thomas Petazzoni To: Stefan Chulski Cc: Antoine Tenart , "davem@davemloft.net" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "maxime.chevallier@bootlin.com" , "gregory.clement@bootlin.com" , "miquel.raynal@bootlin.com" , Nadav Haklai , Yan Markman , "mw@semihalf.com" Subject: Re: [PATCH net-next 5/5] net: mvpp2: jumbo frames support Message-ID: <20180304102828.1437fbc3@windsurf.home> In-Reply-To: <31a2c6c988bd4d5190e1fb3332f3bc35@IL-EXCH01.marvell.com> References: <20180302154044.25204-1-antoine.tenart@bootlin.com> <20180302154044.25204-6-antoine.tenart@bootlin.com> <20180302171713.54beaad0@windsurf.lan> <31a2c6c988bd4d5190e1fb3332f3bc35@IL-EXCH01.marvell.com> Organization: Bootlin (formerly Free Electrons) X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Sun, 4 Mar 2018 06:56:02 +0000, Stefan Chulski wrote: > > > + if (port->pool_long->id == MVPP2_BM_JUMBO && port->id != 0) { > > > > Again, all over the place we hardcode the fact that Jumbo frames can only be > > used on port 0. I know port 0 is the only one that can do 10G, but are there > > possibly some use cases where you may want Jumbo frame on another port > > ? > > > > This all really feels very hardcoded to me. > > > > All ports support Jumbo frames. > But only port 0 can do TX HW checksum offload(due to TX FIFO size). > > Packet processor 2.2 has only 19KB TX FIFO size. > So in TX FIFO config code assign for Port 0 - 10KB, Port 1 - 3KB and Port 1 - 3KB. Yes, but I was also questioning whether hardcoding this configuration was correct. > To perform checksum in HW, HW obviously should work in store and forward mode. Store all frame in TX FIFO and then check checksum. > If mtu 1500B, everything fine and all port can do this. > > If mtu is 9KB and 9KB frame transmitted, Port 0 still can do HW checksum. But ports 1 and 2 doesn't has enough FIFO for this. > So we cannot offload this feature and SW should perform checksum. So perhaps the real check should not be "port 0", but whether the MTU is higher or lower than the TX FIFO size assigned to the current port. This would express in much better way the reason why HW checksum can be used or not. > > > + /* 9704 == 9728 - 20 and rounding to 8 */ > > > + dev->max_mtu = MVPP2_BM_JUMBO_PKT_SIZE; > > > > Is this correct for all ports ? Shouldn't the maximum MTU be different > > between port 0 (that supports Jumbo frames) and the other ports ? > > This is correct for all ports. All ports can support Jumbo frames. OK. With your explanation above, I understand better. Best regards, Thomas -- Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering http://bootlin.com