Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756078AbbGVRhu (ORCPT ); Wed, 22 Jul 2015 13:37:50 -0400 Received: from smtprelay0004.hostedemail.com ([216.40.44.4]:51181 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752110AbbGVRht (ORCPT ); Wed, 22 Jul 2015 13:37:49 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::,RULES_HIT:41:355:379:541:599:960:966:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1543:1593:1594:1711:1730:1747:1777:1792:2196:2199:2393:2553:2559:2562:2737:2828:3138:3139:3140:3141:3142:3355:3622:3865:3866:3867:3868:3870:3871:3872:3874:4250:4321:4385:4559:4605:5007:6261:9010:10004:10400:10848:11026:11232:11233:11657:11658:11914:12043:12294:12296:12438:12517:12519:12740:13161:13229:13972:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: leaf68_60f7403c6373b X-Filterd-Recvd-Size: 4204 Message-ID: <1437586665.20787.24.camel@perches.com> Subject: Re: [PATCH 02/10] dpaa_eth: add support for DPAA Ethernet From: Joe Perches 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 Date: Wed, 22 Jul 2015 10:37:45 -0700 In-Reply-To: <1437581806-17420-2-git-send-email-madalin.bucur@freescale.com> References: <1437581806-17420-1-git-send-email-madalin.bucur@freescale.com> <1437581806-17420-2-git-send-email-madalin.bucur@freescale.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3288 Lines: 126 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/