Received: by 10.223.185.116 with SMTP id b49csp8827942wrg; Fri, 2 Mar 2018 08:37:04 -0800 (PST) X-Google-Smtp-Source: AG47ELu/fY6Bpm54HQvzIRy96TzJpgn0rKr9txVtr0MDq0YCOD7nzVnCQommuvupHyoG5OQ0jfbW X-Received: by 10.99.116.25 with SMTP id p25mr5033098pgc.109.1520008624415; Fri, 02 Mar 2018 08:37:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520008624; cv=none; d=google.com; s=arc-20160816; b=RfXzfEmlihnYVEv9kmLaw3XlTL1AehMAP4xViAnyDAz3DSvJcIAnay9zpBBtz33Sb8 dtUjQ3LOLUjUZ6y8uBWPThAJt9PeoOPHE/ok0HBBvICKdxBhd6T1xDbVVf7AWHoqwiZT u1FWJIbnVNaG5wRN8ZdxOx976s8yw0J7yaQvxUAhPHw+UlJnr/2f/rNYVkFoT3KAqlUS LxWJOag3Ncc4StiJ/EdhAoLgV/EKH4j3CZEuFiotUbzMlu+GVcQGDQVH2Cao4eEJ2lbI NclJqUtfuWubhGqAW6FgyKnDCbxgoehwhc1XvHpxgy4d34BJkYrVHlJOboY9g2CCqJ4Z pazw== 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=ywigBjpNvjcR7R0MLnDs7l8ioQfBePd4QPGBqizJXAQ=; b=vXAQ0V+DtAzc62Zi1rZKdKACi0fOofw/GsewI4oJCnff7v4L7eEK5Di0rCteuatd8D vMfHdoPYj3mmiSOPalY8pyT2kSsdw25FOnDxuXpziU00kNiEzHWL4Dz93RYvlxIZgPxG 4Tzh6fLOtSeRm8ac4MLwd3OL++ysGRFGglnvTmEuweb6UhKxdQ0/WIfuTFJrPu/qM62c boJ8NXgXTEoO4MenvrWCvKmOiN1HYfFMp4C7sj3p63pAsu/V+Ur6r9GkmFaRakZEY+rW N/Czq5CZrkVspOjZKEwZOdipZgvZaiqw5fWDMaYho+TTB5oqriwJKymM19ZAu7neOZmo LGQg== 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 a61-v6si4986380pla.689.2018.03.02.08.36.49; Fri, 02 Mar 2018 08:37:04 -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 S1946705AbeCBQCE (ORCPT + 99 others); Fri, 2 Mar 2018 11:02:04 -0500 Received: from mail.bootlin.com ([62.4.15.54]:37188 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946678AbeCBQCB (ORCPT ); Fri, 2 Mar 2018 11:02:01 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id BD1B6207E9; Fri, 2 Mar 2018 17:01: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.lan (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id 6508520715; Fri, 2 Mar 2018 17:01:58 +0100 (CET) Date: Fri, 2 Mar 2018 17:01:59 +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: <20180302170159.258bcdbc@windsurf.lan> In-Reply-To: <20180302154044.25204-2-antoine.tenart@bootlin.com> References: <20180302154044.25204-1-antoine.tenart@bootlin.com> <20180302154044.25204-2-antoine.tenart@bootlin.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 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; > +} ? Best regards, Thomas -- Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering http://bootlin.com