Received: by 10.223.185.116 with SMTP id b49csp2628177wrg; Mon, 5 Mar 2018 06:15:45 -0800 (PST) X-Google-Smtp-Source: AG47ELvzqnSRB914e8LDIWnfBKPGD61Dx8075AZ964x/zsYmLAQSMqm2QN34K0xJi2J6aJL1OihU X-Received: by 10.99.136.195 with SMTP id l186mr11689820pgd.427.1520259345033; Mon, 05 Mar 2018 06:15:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520259344; cv=none; d=google.com; s=arc-20160816; b=vw2bxJTxk5d5ZSCdo7Q00k1d/pfmEU6hbbwyCcUIEG2ZWDkZvMxaWlBaVwQPuwVZqz urLXs9r27PXNaIKH5gaGmz12kXGKulD3EIfrjpAej13BY1RkS5kx7ZdgT+uUzNxhUBSt WroQkHqKQNc4R40vQLJ8lXhe3TFHjqtCDrAPwdpRaOAeSMqIa3v9OFiAsE/vsnYPSaIk PSHMSatrjT58Zpnf8KuqZUswkVseMYSbzp5Z2Az7hHhepQeYHBoCWvnUHIEL7Sd39egi DBhsuB4EO7MR45MZVX2Zl+sPLWSD/6555CZEs8ofndhOJvVGMthWo+tfmLCbcMYT9xcm cziQ== 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=36qgK5+pSEihRLwt207Ftv43/KNRKaaJo2wu2W3EaDU=; b=xmKu/xjeL0fIgyAh/III2hCs4c81ZQ9U8SATbYnf3Yho6K+baHvNu4n+K70YPEVqZw KEQ76VuFWLlktBLhckatF0J6jcCvHM5dYn6Z3GheHZD02ibq32Js+iGJs6FsgRBiVsFa fpUSUEJ41N0rqIi1XLjuLdyBOQfvErUsyv0t3ZJTj/Ofj3MdBcc/eDeojx4Ixr3TT9mL aKWnady2QYCxRLbOhrwkxEElZgwMOrsiGLOottJAtp8/pWj90b0uUUN64M0d7sIZnP4V 2ZLmx+U5L/+vZnkJuanh34qYfXWH4XjnGHISf6phjMFM+z1Z3d1QSqlcJ1t/aziU0E1M bFAg== 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 p3-v6si9289677pls.238.2018.03.05.06.15.30; Mon, 05 Mar 2018 06:15:44 -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 S934576AbeCEMmD (ORCPT + 99 others); Mon, 5 Mar 2018 07:42:03 -0500 Received: from mail.bootlin.com ([62.4.15.54]:55840 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933014AbeCEMmB (ORCPT ); Mon, 5 Mar 2018 07:42:01 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 9069B20784; Mon, 5 Mar 2018 13:41:58 +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 (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id 166DE20379; Mon, 5 Mar 2018 13:41:48 +0100 (CET) Date: Mon, 5 Mar 2018 13:41:48 +0100 From: Thomas Petazzoni To: Antoine Tenart Cc: davem@davemloft.net, Stefan Chulski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, maxime.chevallier@bootlin.com, gregory.clement@bootlin.com, miquel.raynal@bootlin.com, nadavh@marvell.com, ymarkman@marvell.com, mw@semihalf.com Subject: Re: [PATCH net-next 1/5] net: mvpp2: use the same buffer pool for all ports Message-ID: <20180305134148.3bbba514@windsurf.home> In-Reply-To: <20180305104813.GI1156@kwain> References: <20180302154044.25204-1-antoine.tenart@bootlin.com> <20180302154044.25204-2-antoine.tenart@bootlin.com> <20180302170159.258bcdbc@windsurf.lan> <20180305104813.GI1156@kwain> 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 Mon, 5 Mar 2018 11:48:13 +0100, Antoine Tenart wrote: > > > +static void mvpp2_setup_bm_pool(void) > > > +{ > > > + /* Short pool */ > > > + mvpp2_pools[MVPP2_BM_SHORT].buf_num = MVPP2_BM_SHORT_BUF_NUM; > > > + mvpp2_pools[MVPP2_BM_SHORT].pkt_size = MVPP2_BM_SHORT_PKT_SIZE; > > > + > > > + /* Long pool */ > > > + mvpp2_pools[MVPP2_BM_LONG].buf_num = MVPP2_BM_LONG_BUF_NUM; > > > + mvpp2_pools[MVPP2_BM_LONG].pkt_size = MVPP2_BM_LONG_PKT_SIZE; > > > +} > > > > ? > > I wanted to do this, but it's no possible as MVPP2_BM_SHORT_PKT_SIZE and > MVPP2_BM_LONG_PKT_SIZE use a core definition which expands at some point > to __max(...) which has to be called from within a function. Hum, weird: #define MVPP2_BM_LONG_PKT_SIZE MVPP2_RX_MAX_PKT_SIZE(MVPP2_BM_LONG_FRAME_SIZE) #define MVPP2_BM_LONG_FRAME_SIZE 2048 #define MVPP2_RX_MAX_PKT_SIZE(total_size) \ ((total_size) - NET_SKB_PAD - MVPP2_SKB_SHINFO_SIZE) #define MVPP2_SKB_SHINFO_SIZE \ SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) #define SKB_DATA_ALIGN(X) ALIGN(X, SMP_CACHE_BYTES) I don't really see a __max(...) call. And if this value really expands depending on other values, then it isn't really a constant, and should be considered as a constant, no? Thomas -- Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering http://bootlin.com