Received: by 10.223.185.116 with SMTP id b49csp2434660wrg; Mon, 5 Mar 2018 02:50:46 -0800 (PST) X-Google-Smtp-Source: AG47ELvAjADhhrGFyNMjAnM4SwRKs16OzM3k8y/z59MEt7yR/H5B9bVpwgC5yFPgDNs15eQqzI18 X-Received: by 2002:a17:902:ab8c:: with SMTP id f12-v6mr12554145plr.171.1520247046863; Mon, 05 Mar 2018 02:50:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520247046; cv=none; d=google.com; s=arc-20160816; b=JQpGgUxraBjn8vmze2SkB8vL5KzsV+h9mH07Hu6UCsSh6mInzgvb/fFK0Y/JuTrGbB eN3eId5GyaysJB2AYiupdeuSy6jvKKPqCp1dibHEOTnQzkln6hSpKyv4dqSytrB7fo2J scsDFpClaK4qUH6+OGlUZkP1yqFnYWasPG+vaqrnzlltoLrmL96j215PmgJh+tU+CPhT JQPxX4saXGUxwBbT8LA6yivgB158yXN5BwrAzIJDX+eQjRdnksou4WFaBou9/jIZzXrm +d+T9qvTSEB+gILEmVZ823N5dljurkJB4hOcQzDIQwftXAhD5IBGXvZNjkzsCNI9Xr5d cVbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=e4ipXYAehjRCjLQeOcUS0d0Rv3szlDLX7QirCpdoxJg=; b=Gg9b/y9NUKz5CnN9RlEr5Pyzn6iUOqiAAK9pj+g14PtY6tzXoMj5Y+mfkDpnA0yJ71 uUzAAd4xTdbWCtFgS53p2ea9i8rIaAbkeHShKeD4dqRHDEEKEj5LHBGEZVcZZ6NIqmG5 XK4rzmRK5ZWMSsuANAoy5kXbL46IKknnSSflgtZ0G9p9ExmkkBlsOiVkF9aCb80I3RV6 ZT/Y+jf2UBn1LwQ0DexhrQGjUWWjFCpeyXbbQ9HA+vMHXRycemx1ysRUProKSO/SWF+r qgIkL4bfANVCQMtiveWgUYmTVoW1TnGtka5tC97mtrO81VqdonXPocF6B4ZkATO9Fz7q /lFg== 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 a26si10041568pfj.267.2018.03.05.02.50.32; Mon, 05 Mar 2018 02:50:46 -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 S934344AbeCEKs3 (ORCPT + 99 others); Mon, 5 Mar 2018 05:48:29 -0500 Received: from mail.bootlin.com ([62.4.15.54]:52947 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933135AbeCEKsZ (ORCPT ); Mon, 5 Mar 2018 05:48:25 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id B81A720710; Mon, 5 Mar 2018 11:48:22 +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 localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id 64F392043E; Mon, 5 Mar 2018 11:48:12 +0100 (CET) Date: Mon, 5 Mar 2018 11:48:13 +0100 From: Antoine Tenart To: Thomas Petazzoni Cc: Antoine Tenart , 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: <20180305104813.GI1156@kwain> References: <20180302154044.25204-1-antoine.tenart@bootlin.com> <20180302154044.25204-2-antoine.tenart@bootlin.com> <20180302170159.258bcdbc@windsurf.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180302170159.258bcdbc@windsurf.lan> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Thomas, On Fri, Mar 02, 2018 at 05:01:59PM +0100, Thomas Petazzoni wrote: > On Fri, 2 Mar 2018 16:40:40 +0100, Antoine Tenart wrote: > > +static struct { > > + int pkt_size; > > + int buf_num; > > +} mvpp2_pools[MVPP2_BM_POOLS_NUM]; > > Any reason for not doing: > > } mvpp2_pools[MVPP2_BM_POOLS_NUM] = { > [MVPP2_BM_SHORT] = { > .pkt_size = MVPP2_BM_SHORT_PKT_SIZE, > .buf_num = MVPP2_BM_SHORT_BUF_NUM > }, > [MVPP2_BM_LONG] = { > .pkt_size = MVPP2_BM_LONG_PKT_SIZE, > .buf_num = MVPP2_BM_LONG_BUF_NUM, > }, > }; > > And get rid of: > > > +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. That's why I kept mvpp2_setup_bm_pool(). Thanks! Antoine -- Antoine T?nart, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com