From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 80A071B206 for ; Mon, 2 Oct 2017 13:08:44 +0200 (CEST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Oct 2017 04:08:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,469,1500966000"; d="scan'208";a="155621977" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.221.37]) by orsmga005.jf.intel.com with SMTP; 02 Oct 2017 04:08:40 -0700 Received: by (sSMTP sendmail emulation); Mon, 02 Oct 2017 12:08:39 +0100 Date: Mon, 2 Oct 2017 12:08:39 +0100 From: Bruce Richardson To: Stephen Hemminger Cc: Tomasz Duszynski , dev@dpdk.org, mw@semihalf.com, dima@marvell.com, nsamsono@marvell.com, Jianbo.liu@linaro.org, Jacek Siuda Message-ID: <20171002110839.GB1132@bricha3-MOBL3.ger.corp.intel.com> References: <1506418805-12117-1-git-send-email-tdu@semihalf.com> <1506594158-15721-1-git-send-email-tdu@semihalf.com> <1506594158-15721-3-git-send-email-tdu@semihalf.com> <20170929083800.3a71c9a2@xeon-e3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170929083800.3a71c9a2@xeon-e3> Organization: Intel Research and Development Ireland Ltd. User-Agent: Mutt/1.8.3 (2017-05-23) Subject: Re: [dpdk-dev] [PATCH v2 2/4] net/mrvl: add mrvl net pmd driver X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 11:08:45 -0000 On Fri, Sep 29, 2017 at 08:38:00AM -0700, Stephen Hemminger wrote: > On Thu, 28 Sep 2017 12:22:36 +0200 > Tomasz Duszynski wrote: > > > + > > +struct mrvl_rxq; > > +struct mrvl_txq; > > These forward decl should not be nececessary > > +static inline int > > +mrvl_get_bpool_size(int pp2_id, int pool_id) > No tab here please > > Why does this need to be inlined? Is it in critical path? > > > > +{ > > + int i; > > + int size = 0; > > + > > + for (i = mrvl_lcore_first; i <= mrvl_lcore_last; i++) > > + size += mrvl_port_bpool_size[pp2_id][pool_id][i]; > > + > > + return size; > > +} > > + > > Also, I prefer that the following restrictions from the kernel be > also applied to DPDK code. > +1 for LINE_SPACING (multiple blank lines), MULTILINE_DEREFERENCE and SPLIT_STRING. [Is split string not already enforced?] I'm a bit ambivilant about forcing a blank line after definitions, I think it's a good idea in most cases, but I'm not sure it needs to be enforced in all cases. /Bruce > ### [dpdk-dev] [PATCH v2 2/4] net/mrvl: add mrvl net pmd driver > > CHECK:LINE_SPACING: Please don't use multiple blank lines > #452: FILE: drivers/net/mrvl/mrvl_ethdev.c:180: > + > + > > WARNING:LINE_SPACING: Missing a blank line after declarations > #457: FILE: drivers/net/mrvl/mrvl_ethdev.c:185: > + int n = sizeof(*bitmap) * 8 - __builtin_clz(*bitmap); > + if (n >= max) > > CHECK:LINE_SPACING: Please don't use multiple blank lines > #562: FILE: drivers/net/mrvl/mrvl_ethdev.c:290: > + > + > > WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'priv->ppio_params.inqs_params.tcs_params[i].inqs_params' > #880: FILE: drivers/net/mrvl/mrvl_ethdev.c:608: > + rte_free(priv->ppio_params.inqs_params. > + tcs_params[i].inqs_params); > > WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'priv->ppio_params.inqs_params.tcs_params[i].inqs_params' > #882: FILE: drivers/net/mrvl/mrvl_ethdev.c:610: > + priv->ppio_params.inqs_params. > + tcs_params[i].inqs_params = NULL; > > WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'priv->ppio_params.inqs_params.tcs_params[tc].inqs_params[inq].size' > #1330: FILE: drivers/net/mrvl/mrvl_ethdev.c:1058: > + qinfo->nb_desc = priv->ppio_params.inqs_params. > + tcs_params[tc].inqs_params[inq].size; > > WARNING:SPLIT_STRING: quoted string split across lines > #1476: FILE: drivers/net/mrvl/mrvl_ethdev.c:1204: > + RTE_LOG(ERR, PMD, "Mbuf size must be increased to %u bytes" > + " to hold up to %u bytes of data.\n", > > WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'priv->ppio_params.inqs_params.tcs_params[priv->rxq_map[rxq->queue_id].tc' > #1500: FILE: drivers/net/mrvl/mrvl_ethdev.c:1228: > + priv->ppio_params.inqs_params. > + tcs_params[priv->rxq_map[rxq->queue_id].tc]. > > WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'q->priv->ppio_params.inqs_params.tcs_params[q->priv->rxq_map[q->queue_id].tc' > #1532: FILE: drivers/net/mrvl/mrvl_ethdev.c:1260: > + num = q->priv->ppio_params.inqs_params. > + tcs_params[q->priv->rxq_map[q->queue_id].tc]. > > WARNING:SPLIT_STRING: quoted string split across lines > #1902: FILE: drivers/net/mrvl/mrvl_ethdev.c:1630: > + RTE_LOG(DEBUG, PMD, "\nport-%d:%d: bpool %d oversize -" > + " remove %d buffers (pool size: %d -> %d)\n", > > WARNING:SPLIT_STRING: quoted string split across lines > #2094: FILE: drivers/net/mrvl/mrvl_ethdev.c:1822: > + "No room in shadow queue for %d packets!!!" > + "%d packets will be sent.\n", > > CHECK:LINE_SPACING: Please don't use multiple blank lines > #2294: FILE: drivers/net/mrvl/mrvl_ethdev.c:2022: > + > + > > CHECK:LINE_SPACING: Please don't use multiple blank lines > #2595: FILE: drivers/net/mrvl/mrvl_ethdev.h:40: > + > + > > WARNING:LINE_SPACING: Missing a blank line after declarations > #3253: FILE: drivers/net/mrvl/mrvl_qos.c:577: > + uint8_t idx = port_cfg->tc[tc].inq[i]; > + priv->rxq_map[idx].tc = tc; >