linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: madalin.bucur@freescale.com
Cc: netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	linux-kernel@vger.kernel.org, scottwood@freescale.com,
	igal.liberman@freescale.com, ppc@mindchasers.com,
	pebolle@tiscali.nl, joakim.tjernlund@transmode.se
Subject: Re: [PATCH 02/10] dpaa_eth: add support for DPAA Ethernet
Date: Wed, 22 Jul 2015 10:37:45 -0700	[thread overview]
Message-ID: <1437586665.20787.24.camel@perches.com> (raw)
In-Reply-To: <1437581806-17420-2-git-send-email-madalin.bucur@freescale.com>

On Wed, 2015-07-22 at 19:16 +0300, Madalin Bucur wrote:
> This introduces the Freescale Data Path Acceleration Architecture
> (DPAA) Ethernet driver (dpaa_eth) that builds upon the DPAA QMan,
> BMan, PAMU and FMan drivers to deliver Ethernet connectivity on
> the Freescale DPAA QorIQ platforms.

trivia:

> +static void __hot _dpa_tx_conf(struct net_device	*net_dev,
> +			       const struct dpa_priv_s	*priv,
> +			       struct dpa_percpu_priv_s	*percpu_priv,
> +			       const struct qm_fd	*fd,
> +			       u32			fqid)
> +{
[]
> +static struct dpa_bp * __cold
> +dpa_priv_bp_probe(struct device *dev)

Do the __hot and __cold markings really matter?
Some of them may be questionable.

> +static int __init dpa_load(void)
> +{
[]
> +	err = platform_driver_register(&dpa_driver);
> +	if (unlikely(err < 0)) {
> +		pr_err(KBUILD_MODNAME
> +			": %s:%hu:%s(): platform_driver_register() = %d\n",
> +			KBUILD_BASENAME ".c", __LINE__, __func__, err);
> +	}
> +
> +	pr_debug(KBUILD_MODNAME ": %s:%s() ->\n",
> +		 KBUILD_BASENAME ".c", __func__);

Perhaps these should use pr_fmt

> +static void __exit dpa_unload(void)
> +{
> +	pr_debug(KBUILD_MODNAME ": -> %s:%s()\n",
> +		 KBUILD_BASENAME ".c", __func__);

dynamic debug has __func__ available and perhaps
the function tracer might be used instead.

> diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h
[]
> +#define __hot

curious.

Maybe it'd be good to add a real __hot to compiler.h

> +struct dpa_buffer_layout_s {
> +	u16	priv_data_size;
> +	bool		parse_results;
> +	bool		time_stamp;
> +	bool		hash_results;
> +	u16	data_align;
> +};

> +struct dpa_fq {
> +	struct qman_fq		 fq_base;
> +	struct list_head	 list;
> +	struct net_device	*net_dev;

some inconsistent indentation here and there

> +struct dpa_bp {
> +	struct bman_pool		*pool;
> +	u8				bpid;
> +	struct device			*dev;
> +	union {
> +		/* The buffer pools used for the private ports are initialized
> +		 * with target_count buffers for each CPU; at runtime the
> +		 * number of buffers per CPU is constantly brought back to this
> +		 * level
> +		 */
> +		int target_count;
> +		/* The configured value for the number of buffers in the pool,
> +		 * used for shared port buffer pools
> +		 */
> +		int config_count;
> +	};

Anonymous unions are relatively rare

> +	struct {
> +		/**

Maybe the /** style should be avoided

> +		 * All egress queues to a given net device belong to one
> +		 * (and the same) congestion group.
> +		 */
> +		struct qman_cgr cgr;
> +	} cgr_data;

[]

> +int dpa_stop(struct net_device *net_dev)
> +{
[]
> +	err = mac_dev->stop(mac_dev);
> +	if (unlikely(err < 0))
> +		netif_err(priv, ifdown, net_dev, "mac_dev->stop() = %d\n",
> +			  err);

Some of the likely/unlikely uses may not
be useful/necessary.
> +
> +	for_each_port_device(i, mac_dev->port_dev) {
> +		error = fm_port_disable(
> +				fm_port_drv_handle(mac_dev->port_dev[i]));
> +		err = error ? error : err;

		if (error)
			err = error;

is more obvious to me.

  parent reply	other threads:[~2015-07-22 17:37 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-22 16:16 [PATCH 01/10] devres: add devm_alloc_percpu() Madalin Bucur
2015-07-22 16:16 ` [PATCH 02/10] dpaa_eth: add support for DPAA Ethernet Madalin Bucur
2015-07-22 16:16   ` [PATCH 03/10] dpaa_eth: add configurable bpool thresholds Madalin Bucur
2015-07-22 16:16     ` [PATCH 04/10] dpaa_eth: add support for S/G frames Madalin Bucur
2015-07-22 16:16       ` [PATCH 05/10] dpaa_eth: add driver's Tx queue selection mechanism Madalin Bucur
2015-07-22 16:16         ` [PATCH 06/10] dpaa_eth: add ethtool functionality Madalin Bucur
2015-07-22 16:16           ` [PATCH 07/10] dpaa_eth: add sysfs exports Madalin Bucur
2015-07-22 16:16             ` [PATCH 08/10] dpaa_eth: add debugfs counters Madalin Bucur
2015-07-22 16:16               ` [PATCH 09/10] dpaa_eth: add debugfs entries Madalin Bucur
2015-07-22 16:16                 ` [PATCH 10/10] dpaa_eth: add trace points Madalin Bucur
2015-07-22 17:47     ` [PATCH 03/10] dpaa_eth: add configurable bpool thresholds Joe Perches
2015-07-24 15:49       ` Madalin-Cristian Bucur
2015-07-26 23:35         ` David Miller
2015-07-27 12:54           ` Madalin-Cristian Bucur
2015-07-22 17:37   ` Joe Perches [this message]
2015-07-24 15:45     ` [PATCH 02/10] dpaa_eth: add support for DPAA Ethernet Madalin-Cristian Bucur
2015-07-27 18:59       ` Scott Wood
2015-07-29 14:15   ` Joakim Tjernlund

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1437586665.20787.24.camel@perches.com \
    --to=joe@perches.com \
    --cc=igal.liberman@freescale.com \
    --cc=joakim.tjernlund@transmode.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=madalin.bucur@freescale.com \
    --cc=netdev@vger.kernel.org \
    --cc=pebolle@tiscali.nl \
    --cc=ppc@mindchasers.com \
    --cc=scottwood@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).