Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753212AbbHEPox (ORCPT ); Wed, 5 Aug 2015 11:44:53 -0400 Received: from mail-bl2on0114.outbound.protection.outlook.com ([65.55.169.114]:64928 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753359AbbHEPny (ORCPT ); Wed, 5 Aug 2015 11:43:54 -0400 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; From: Madalin Bucur To: CC: , , , , , , , , , Madalin Bucur Subject: [v2 7/9] dpaa_eth: add debugfs counters Date: Wed, 5 Aug 2015 18:41:27 +0300 Message-ID: <1438789289-16304-8-git-send-email-madalin.bucur@freescale.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1438789289-16304-1-git-send-email-madalin.bucur@freescale.com> References: <1438789289-16304-1-git-send-email-madalin.bucur@freescale.com> Reply-To: X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11FD041;1:XCUGyBOohhwoqvWYWU4O2TvnChwfBrvG9EewVjbkedfwD/9uchmg0thFR2BD+LTFT6/ZWAE4LUC5d5fmzO5kDjyKuk7qEi6QR8IyHWFTEAi22Qob6u4MRTtbeWLpyIg1RsR9kXVUSlaCBHchvv7SNBkRBdQ7G0tVl4n3HjEsy7JRB+SggBpG60vpwVxVmbANSLtri1tZaPIIWETNO+29VAlnWwKB99gwzD80FEiZsC2XM3/ryeZD2v5T1X4zOMHHQWC8fUGX11OvI6ZZ60imVgF2kwVYDZrF2Axb0KfCjB6ZM8sqxdagUEr12i90dZtpb3KBc+ghXEE6xlD4mdOVSw== X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(339900001)(199003)(189002)(62966003)(87936001)(107886002)(2351001)(86362001)(68736005)(575784001)(19580405001)(2950100001)(81156007)(5001830100001)(5001960100002)(5001860100001)(48376002)(229853001)(97736004)(110136002)(189998001)(36756003)(6806004)(106466001)(77156002)(19580395003)(50466002)(77096005)(76176999)(50226001)(85426001)(47776003)(50986999)(53806999)(105606002)(64706001)(5001920100001)(4001540100001)(5003940100001)(104016003)(46102003)(33646002)(43066003)(4001430100001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR03MB1483;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;BY1PR03MB1483;2:YqCnC54fTjPxfu5EjS2f6j0AhvrHD1C9io2PmaN2mu2l71CmX+q5apkrOdISusVzObDTqDre/M3oB+cSJbDJjL4yzawABuD3uNzTcJiZg3lXmjCFbeJPU2jjl69X3YbMDvMPfLHYndXJvWdibK0DQElAEd4YUuzmycHNNjDJqWo=;3:IqkZk7gcbeS7M44uUXka2xpdt7Di6gH2lp+iJe4zyPrqvPuZ44p4axAUyVY6K/CTCVerJYpn2Q44FHR9Jg5630zYf1SZ88LkF5z3fmRmaThlkrJf50LdBgZz7M0HjswZMUpEZdNX9blYXBHexgAgk0lemloG4KZryv2kE4BzKj3rcZjr/KdXPjuito7bqYW3UWdwd4q6xufX8ZPNm/ywyaDXJPpVr2SBo1W2kaPqOBE=;25:zo1POMc72kfr0sWwddCUscS2tvv4CwF8fpOAo/2K47MBN1eA5bkkEpXNQHTri9m8Qa9CfaQ9m5GzoJbeQh2UkzTWI+T9C/fTmsWo5ntg3+fllyLv1hLu3m+I7kj1/t/zlURUGUP08Hes+RgiPEPZ7PcRhP7StqccXqqs94F5lzGdR7nE3AH5duJFK5H16uduNTEqJTKurOC8fPNz9jcpLJBgj0SQlAHGtRQHjB9tZvDI7VLWtM0Z73uKpZfVedDhYgfN5dBvfrWsBptBODOHqw== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1483; X-Microsoft-Exchange-Diagnostics: 1;BY1PR03MB1483;20:E/rVSKGtZeKfwo8o0M7SYvfHGqrLwrSC0fW3MlSLfZXL8GuW3ON6Z7lkzdkbLCPBDrDzBVbGwG1192QaOQPDgHW1ZKaur6mjIk63Ua+7xGuj2e+HO2x7/5sAVGt5p3/nAF1XCB7bmir4Lj0DitsNN1TH2oxzdWXS1RymzHjqSdhDn7aU6wv5Y9NEKuOqO0whdzRtexwAjQdbOdsX8SW4AQEeZVeT+3fo8yCw11zrPQ8qYMASushC1hAjb5NeUZsWV9UIjgazdwmtZyNoKYcb0Xe0Ix+EVLwNGf5jFXotNdj3DULok+pST0CULsNZwMHQuVXcN07Spnqdy86uEDer7siB5oKwhoyeAwVt0kWVEgM=;4:ixOA4S6br6n8ySH/+AxLl9jAtux5CIIH+eAo/alWoZv1p66Somx8zjNCzc099WXJ1vf0CMp0KScqAuB5NQFFmnPBEmaACfRAEeIyhABuAE3GwZFoeUpO9ZcwV2Y+Nklz1okRS3JMbyVoGvYDtDbmp+C6E9pWQpj4TR/FfT58rBXnUOzj+XU3eHqssmU5LLZ68gFc0QdvpHz29I+f2xtVif7gedRzDK/JAa3iSIC+uAbBd9KPmlyIx0AjDJUcgnCrD+bg4sqElp2yKVcKQiAuZC9ErcMngBtaZmdDM546Y/8= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BY1PR03MB1483;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1483; X-Forefront-PRVS: 06592CCE58 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY1PR03MB1483;23:wXlzzovdBjymPn84zw05x6VWKgrA470a0XWaALZQi?= =?us-ascii?Q?B3niuGnP0+Eh1HWk2O4MrwREC745kraVZJZzjTzYoD2ULa7ykZVa5KQG76a0?= =?us-asc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BOnGTV9Pr/yjJm58VK7P/1zArs?= =?us-ascii?Q?QaufSfncKdPh3jkEvvqm/HdPHjRlUjcP3uf2Poy8C2Jnu310vm5yHXi33znK?= =?us-ascii?Q?uKay1qzb73M/M+bZGAJZXE9HQDx8iBD3wevX4ZkEO9peZDKgZe00OyyCkt7j?= =?us-ascii?Q?6wxFkgus6MEGj03rQmovoCdX6l0mM5L87hkt1oyW8GFfBeD7Kzt1hDXYZejw?= =?us-ascii?Q?w8ssE25O18YGEEgEaDSH0JWNabTXHAvMOZZ7gVVI9GnZTuSnmaFpw7nFQ=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1;BY1PR03MB1483;5:kNKQL/5/69gPjho0lUM+RQCC8owK6ct3Hc03F/nb3VhPPI+oqRRQSPAcUfhxQjrxV6XvGdLALGj0qJp94MoM/WgiK3u9fwGf7JBX5c0Tl7F7+aPlbBjHg5YAA/DnXUUD38DWfa37Ixm1CEVKYxhMbw==;24:fuyItActpkcmMIUywFs21oq4m2MhUydqKHKDvHVSTWrsymaVXMkItqCHJ/qCoX2+jO2zlJcJIS5nFM8/Q8f1A6LpyEn9mtgOzlANEtD/njk=;20:1nrtvwOit6o9owm/AXj/P9JFZuZ7Wp/xHxwaT2MKbRHQViXyEteKeG4brYGLJmHTt5q3dUXZLQvvLOibY5yUGQ== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2015 15:43:49.9585 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR03MB1483 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 7651 Lines: 214 Add a series of counters to be exported through debugfs: - add detailed counters for reception errors; - add detailed counters for QMan enqueue reject events; - count the number of fragmented skbs received from the stack; - count all frames received on the Tx confirmation path; - add congestion group statistics; - count the number of interrupts for each CPU. Signed-off-by: Madalin Bucur --- drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 12 +++++++ drivers/net/ethernet/freescale/dpaa/dpaa_eth.h | 34 ++++++++++++++++++ .../net/ethernet/freescale/dpaa/dpaa_eth_common.c | 40 ++++++++++++++++++++-- .../net/ethernet/freescale/dpaa/dpaa_eth_common.h | 2 ++ drivers/net/ethernet/freescale/dpaa/dpaa_eth_sg.c | 1 + 5 files changed, 87 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index a1183f4..008562b 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -98,6 +98,15 @@ static void _dpa_rx_error(struct net_device *net_dev, percpu_priv->stats.rx_errors++; + if (fd->status & FM_PORT_FRM_ERR_DMA) + percpu_priv->rx_errors.dme++; + if (fd->status & FM_PORT_FRM_ERR_PHYSICAL) + percpu_priv->rx_errors.fpe++; + if (fd->status & FM_PORT_FRM_ERR_SIZE) + percpu_priv->rx_errors.fse++; + if (fd->status & FM_PORT_FRM_ERR_PRS_HDR_ERR) + percpu_priv->rx_errors.phe++; + dpa_fd_release(net_dev, fd); } @@ -161,6 +170,8 @@ static void _dpa_tx_conf(struct net_device *net_dev, percpu_priv->stats.tx_errors++; } + percpu_priv->tx_confirm++; + skb = _dpa_cleanup_tx_fd(priv, fd); dev_kfree_skb(skb); @@ -296,6 +307,7 @@ static void priv_ern(struct qman_portal *portal, percpu_priv->stats.tx_dropped++; percpu_priv->stats.tx_fifo_errors++; + count_ern(percpu_priv, msg); /* If we intended this buffer to go into the pool * when the FM was done, we need to put it in diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h index 2a0ecf3..c66140e 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h @@ -194,6 +194,25 @@ struct dpa_bp { void (*free_buf_cb)(void *addr); }; +struct dpa_rx_errors { + u64 dme; /* DMA Error */ + u64 fpe; /* Frame Physical Error */ + u64 fse; /* Frame Size Error */ + u64 phe; /* Header Error */ +}; + +/* Counters for QMan ERN frames - one counter per rejection code */ +struct dpa_ern_cnt { + u64 cg_tdrop; /* Congestion group taildrop */ + u64 wred; /* WRED congestion */ + u64 err_cond; /* Error condition */ + u64 early_window; /* Order restoration, frame too early */ + u64 late_window; /* Order restoration, frame too late */ + u64 fq_tdrop; /* FQ taildrop */ + u64 fq_retired; /* FQ is retired */ + u64 orp_zero; /* ORP disabled */ +}; + struct dpa_napi_portal { struct napi_struct napi; struct qman_portal *p; @@ -202,7 +221,13 @@ struct dpa_napi_portal { struct dpa_percpu_priv_s { struct net_device *net_dev; struct dpa_napi_portal *np; + u64 in_interrupt; + u64 tx_confirm; + /* fragmented (non-linear) skbuffs received from the stack */ + u64 tx_frag_skbuffs; struct rtnl_link_stats64 stats; + struct dpa_rx_errors rx_errors; + struct dpa_ern_cnt ern_cnt; }; struct dpa_priv_s { @@ -233,6 +258,14 @@ struct dpa_priv_s { * (and the same) congestion group. */ struct qman_cgr cgr; + /* If congested, when it began. Used for performance stats. */ + u32 congestion_start_jiffies; + /* Number of jiffies the Tx port was congested. */ + u32 congested_jiffies; + /* Counter for the number of times the CGR + * entered congestion state + */ + u32 cgr_congested_count; } cgr_data; /* Use a per-port CGR for ingress traffic. */ bool use_ingress_cgr; @@ -294,6 +327,7 @@ static inline int dpaa_eth_napi_schedule(struct dpa_percpu_priv_s *percpu_priv, np->p = portal; napi_schedule(&np->napi); + percpu_priv->in_interrupt++; return 1; } } diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.c index 1e43fe5..459132b 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.c @@ -746,10 +746,15 @@ static void dpaa_eth_cgscn(struct qman_portal *qm, struct qman_cgr *cgr, struct dpa_priv_s *priv = (struct dpa_priv_s *)container_of(cgr, struct dpa_priv_s, cgr_data.cgr); - if (congested) + if (congested) { + priv->cgr_data.congestion_start_jiffies = jiffies; netif_tx_stop_all_queues(priv->net_dev); - else + priv->cgr_data.cgr_congested_count++; + } else { + priv->cgr_data.congested_jiffies += + (jiffies - priv->cgr_data.congestion_start_jiffies); netif_tx_wake_all_queues(priv->net_dev); + } } int dpaa_eth_cgr_init(struct dpa_priv_s *priv) @@ -1200,6 +1205,37 @@ dpa_fd_release(const struct net_device *net_dev, const struct qm_fd *fd) cpu_relax(); } +void count_ern(struct dpa_percpu_priv_s *percpu_priv, + const struct qm_mr_entry *msg) +{ + switch (msg->ern.rc & QM_MR_RC_MASK) { + case QM_MR_RC_CGR_TAILDROP: + percpu_priv->ern_cnt.cg_tdrop++; + break; + case QM_MR_RC_WRED: + percpu_priv->ern_cnt.wred++; + break; + case QM_MR_RC_ERROR: + percpu_priv->ern_cnt.err_cond++; + break; + case QM_MR_RC_ORPWINDOW_EARLY: + percpu_priv->ern_cnt.early_window++; + break; + case QM_MR_RC_ORPWINDOW_LATE: + percpu_priv->ern_cnt.late_window++; + break; + case QM_MR_RC_FQ_TAILDROP: + percpu_priv->ern_cnt.fq_tdrop++; + break; + case QM_MR_RC_ORPWINDOW_RETIRED: + percpu_priv->ern_cnt.fq_retired++; + break; + case QM_MR_RC_ORP_ZERO: + percpu_priv->ern_cnt.orp_zero++; + break; + } +} + /* Turn on HW checksum computation for this outgoing frame. * If the current protocol is not something we support in this regard * (or if the stack has already computed the SW checksum), we do nothing. diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.h b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.h index a940561..5039af0 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.h +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.h @@ -120,6 +120,8 @@ void dpaa_eth_init_ports(struct mac_device *mac_dev, void dpa_release_sgt(struct qm_sg_entry *sgt); void __attribute__((nonnull)) dpa_fd_release(const struct net_device *net_dev, const struct qm_fd *fd); +void count_ern(struct dpa_percpu_priv_s *percpu_priv, + const struct qm_mr_entry *msg); int dpa_enable_tx_csum(struct dpa_priv_s *priv, struct sk_buff *skb, struct qm_fd *fd, diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_sg.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_sg.c index 6050448..a39faec 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_sg.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_sg.c @@ -671,6 +671,7 @@ int dpa_tx(struct sk_buff *skb, struct net_device *net_dev) likely(skb_shinfo(skb)->nr_frags < DPA_SGT_MAX_ENTRIES)) { /* Just create a S/G fd based on the skb */ err = skb_to_sg_fd(priv, skb, &fd); + percpu_priv->tx_frag_skbuffs++; } else { /* If the egress skb contains more fragments than we support * we have no choice but to linearize it ourselves. -- 1.7.11.7 -- 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/