Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752219AbbKBTvv (ORCPT ); Mon, 2 Nov 2015 14:51:51 -0500 Received: from smtprelay0196.hostedemail.com ([216.40.44.196]:60783 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752063AbbKBTvo (ORCPT ); Mon, 2 Nov 2015 14:51:44 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:960:966:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1535:1543:1593:1594:1711:1730:1747:1777:1792:2194:2196:2199:2200:2393:2559:2562:2693:2729:2737:2828:3138:3139:3140:3141:3142:3355:3622:3865:3866:3867:3868:3870:3871:3872:3874:4225:4250:4321:4384:4385:4395:4559:5007:6261:6742:9010:10004:10400:10848:11026:11232:11473:11657:11658:11914:12043:12291:12296:12438:12517:12519:12555:12683:12740:13095:14093:14097:21067:21080:30012:30046:30054:30070:30075:30089:30091,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,LFtime:4,LUA_SUMMARY:none X-HE-Tag: space51_82fae639cae26 X-Filterd-Recvd-Size: 5088 Message-ID: <1446493898.24485.59.camel@perches.com> Subject: Re: [net-next v4 2/8] 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, davem@davemloft.net, scottwood@freescale.com, igal.liberman@freescale.com, roy.pledge@freescale.com, ppc@mindchasers.com, pebolle@tiscali.nl, joakim.tjernlund@transmode.se, gregkh@linuxfoundation.org Date: Mon, 02 Nov 2015 11:51:38 -0800 In-Reply-To: <1446485500-9782-3-git-send-email-madalin.bucur@freescale.com> References: <1446485500-9782-1-git-send-email-madalin.bucur@freescale.com> <1446485500-9782-3-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: 4112 Lines: 108 On Mon, 2015-11-02 at 19:31 +0200, 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. [] > diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c [] > +static void _dpa_rx_error(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) > +{ > + /* limit common, possibly innocuous Rx FIFO Overflow errors' > + * interference with zero-loss convergence benchmark results. > + */ > + if (likely(fd->status & FM_FD_ERR_PHYSICAL)) > + pr_warn_once("non-zero error counters in fman statistics (sysfs)\n"); > + else > + if (net_ratelimit()) > + netif_err(priv, hw, net_dev, "Err FD status = 0x%08x\n", > + fd->status & FM_FD_STAT_RX_ERRORS); It's a bit of a pity the logging message code is a mix of pr_, dev_, netdev_ and netif_ Perhaps netif__ratelimited macros should be added. Something like: --- include/linux/netdevice.h | 54 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 210d11a..555471d 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -4025,6 +4025,60 @@ do { \ }) #endif +#define netif_level_ratelimited(level, priv, type, dev, fmt, args...) \ +do { \ + if (netif_msg_##type(priv) && net_ratelimit()) \ + netdev_##level(dev, fmt, ##args); \ +} while (0) + +#define netif_emerg_ratelimited(priv, type, dev, fmt, args...) \ + netif_level_ratelimited(emerg, priv, type, dev, fmt, ##args) +#define netif_alert_ratelimited(priv, type, dev, fmt, args...) \ + netif_level_ratelimited(alert, priv, type, dev, fmt, ##args) +#define netif_crit_ratelimited(priv, type, dev, fmt, args...) \ + netif_level_ratelimited(crit, priv, type, dev, fmt, ##args) +#define netif_err_ratelimited(priv, type, dev, fmt, args...) \ + netif_level_ratelimited(err, priv, type, dev, fmt, ##args) +#define netif_warn_ratelimited(priv, type, dev, fmt, args...) \ + netif_level_ratelimited(warn, priv, type, dev, fmt, ##args) +#define netif_notice_ratelimited(priv, type, dev, fmt, args...) \ + netif_level_ratelimited(notice, priv, type, dev, fmt, ##args) +#define netif_info_ratelimited(priv, type, dev, fmt, args...) \ + netif_level_ratelimited(info, priv, type, dev, fmt, ##args) + +#if defined(CONFIG_DYNAMIC_DEBUG) +/* descriptor check is first to prevent flooding with "callbacks suppressed" */ +#define netif_dbg_ratelimited(priv, type, dev, fmt, args...) \ +do { \ + DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ + if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT) && \ + netif_msg_##type(priv) && net_ratelimit()) \ + __dynamic_netdev_dbg(&descriptor, dev, fmt, ##args); \ +} while (0) +#elif defined(DEBUG) +#define netif_dbg_ratelimited(priv, type, dev, fmt, args...) \ +do { \ + if (netif_msg_##type(priv) && net_ratelimit()) \ + netif_printk(priv, type, KERN_DEBUG, dev, fmt, ##args); \ +} while (0) +#else +#define netif_dbg_ratelimited(priv, type, dev, fmt, args...) \ +do { \ + if (0) \ + netif_printk(priv, type, KERN_DEBUG, dev, fmt, ##args); \ +} while (0) +#endif + +#if defined(VERBOSE_DEBUG) +#define netif_vdbg_ratelimited netif_dbg_ratelimited +#else +#define netif_vdbg(priv, type, dev, fmt, args...) \ +do { \ + if (0) \ + netif_printk(priv, type, KERN_DEBUG, dev, fmt, ##args); \ +} while (0) +#endif + /* * The list of packet types we will receive (as opposed to discard) * and the routines to invoke. -- 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/