Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965479AbbGVQSY (ORCPT ); Wed, 22 Jul 2015 12:18:24 -0400 Received: from mail-bl2on0139.outbound.protection.outlook.com ([65.55.169.139]:30896 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965444AbbGVQSV (ORCPT ); Wed, 22 Jul 2015 12:18:21 -0400 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; From: Madalin Bucur To: CC: , , , , , , , , Madalin Bucur Subject: [PATCH 08/10] dpaa_eth: add debugfs counters Date: Wed, 22 Jul 2015 19:16:44 +0300 Message-ID: <1437581806-17420-8-git-send-email-madalin.bucur@freescale.com> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <1437581806-17420-7-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> <1437581806-17420-3-git-send-email-madalin.bucur@freescale.com> <1437581806-17420-4-git-send-email-madalin.bucur@freescale.com> <1437581806-17420-5-git-send-email-madalin.bucur@freescale.com> <1437581806-17420-6-git-send-email-madalin.bucur@freescale.com> <1437581806-17420-7-git-send-email-madalin.bucur@freescale.com> Reply-To: X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11FD019;1:qaeqSN7T2HjTEh6o/1B4LWoRccg8rw1+xGtC9GPR6MCH+6Vqo0KggNg7RebsD4Szu3QwJzT+XP0DWgPp2RYO70WkvD9iYY9efG5eQWRRQa+XwKycOhSf29wWVNJG081MdPYhT4QhNvQ+lSFFmLhGHupBFVFwWjP0amR2aj0c0zgKtPaZe4G0BLk82cv8OyMJnkaRszHSm5kW+48r+1Fi5T3gmPK6MdVZZAffNGg3Nd8J8f68FCGUdBri6ZqR4Jb1blGpwCpX8aA6drSGZQT0HFU1cnXreVfFYupv3uU1gnH+TekLlABLfiDAQX5GN/PyY0oj2k/fZwEM04u9zwv3h0VhK7EakZqD+CRZVxazTQwMuMESd8ESgzFkSvhkVwogVRzTDnWZVHg6f1dA7y9K42+RTTJy8dT8NvUUuahfTdhc+RO43r4/jybynVsHEoBk X-Forefront-Antispam-Report: CIP:192.88.158.2;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(339900001)(189002)(199003)(229853001)(33646002)(5003940100001)(85426001)(2351001)(47776003)(6806004)(46102003)(19580395003)(19580405001)(87936001)(5001960100002)(110136002)(107886002)(36756003)(189998001)(104016003)(2950100001)(86362001)(48376002)(77156002)(43066003)(93886004)(77096005)(62966003)(105606002)(49486002)(50226001)(106466001)(53806999)(76176999)(50466002)(50986999)(4001430100001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM2PR03MB383;H:az84smr01.freescale.net;FPR:;SPF:Fail;MLV:sfv;MX:1;A:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;DM2PR03MB383;2:9DWxNJWS4aZsUsdshK3khJiypoh38cbjnH/hlhx+ix2f1d+oz/22FLU30iPJ3xu5jMdaavQfI/0jdq8T25ecLIwhdYdDn58EoXjCgAPHiQDPvO1V3ToY+tZACaCfkIMPyxcnTInhqBwUMyaDTZZFa+iXShNpvTOnTW8VMXPZubw=;3:2mC9wHLcFQ8C+WUd28KXhYFUsufbC8C3FpQQCYKb72bon1OkZqrOX4+h24YFWN5jtEb1w0RIy0Gvf4/xQCnXL06V8I9lKti4gTB3acP4b8DBRxcB/5u8BB6tKAK7czddqu5lirKx76kLsoLnA1kcdERz7PzbuTWAf5ysQS9Dh941erOuvtbl+33lOxhnikP2eTk3MYKGnQ7rTYVrrezi64GASXUqwfYFK1J08mhV+3A=;25:DH1kz8OLoa8kFeaXD8esNsv0Prfjz0YcBbKpCS+a9/DrBGb1pi++m0bOtBOSN/YVqKjct1JPXTeF9+de2lxu0oCvphH7aRDDI3IP/5C5lW140TZ0l/s+WTkYe8Giq4q+TKKK69eP8NU8pRG8k3+h/pFZ0rdj2MTYfhdz5wrjI7stuDwrk3v2LlzYQfwbCsi0+XXDpjTXxIP9OGEQv3tGJBD41PMnHmr2im2W8KY2ng1k20c8u0PHJMXmQ+v9Za5qcjU213tkFKUilSl7AbQVsw== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB383; X-Microsoft-Exchange-Diagnostics: 1;DM2PR03MB383;20:6qadeUXjgJ6B5SX5K9TCxW+s93kv6f0SJfSV0X2X6Q+D7D1+uKyE1AGm5pYLZD8cDknh6xCebgDxVezW9bI7No6DYVMUq3AA6OPZFbHfqwcA/alh4a5gcuMI77/7W1bA0mJmBj/G0vmcAVu0dKSqKldxC0mZuK0t2gMnVfZzcmheMmMrTvmxVAWy80P02v2YPL1kOQixny6C0mnUFBxHJGgCTrsaV7yo3m1IcsSdK5dHReIOFFdlvIqjGcj9SH7DZbBC0VcLkDN8dkUlkP6YUzDoiCFKucrdQ/6SRWUSZVlxDW8RY7aSGhqC/xr8929sTnwitXipwMWNAvzSwOt0AoeLg/wod6/J89g/9ZXSwXQ=;4:ue7+np+aXPo8atZF0Esg/3Zdtcav+jvbzbiOAf2Ho74sWxeNvmcoai+t5OtJ0hqYZFzUrXpB/NzInEesNo6NOOlEJKKJpRR5kkAgZNIEC9dL9Q2X1JSzxTnaaIC3FZ4EPatAQ9BNbNgEw0xO3T0o+hjiSyUuKytKc3kowJDv5S/WjQZCJzN7zXvNOwKTA7rKvLtCT+5Cvlf63odSI1poRlslx0XeX/1iWagsp90GjmyLunBHGqlptmMOVVxsgNPMSgkzzmQ7gOXkr+4NUG1BS/bqyD0ImlScdZSG1jvO8Y8= DM2PR03MB383: X-MS-Exchange-Organization-RulesExecuted 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:DM2PR03MB383;BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB383; X-Forefront-PRVS: 0645BEB7AA X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM2PR03MB383;23:zOQYnOGRmf5MvuU2cvuG0aXN8+O4ss7r3aVbEOC2sy?= =?us-ascii?Q?GkNgSR/d3QKWMOShwbMs5hcOKXkqAj7GrM6rNk5lsTdikjgGrKiwPGcMywry?= =?us-ascii?Q?VD7Ibbe8aipdh4aqaHhOrkyfJ0poa+7JXoz+mzIT3dd4RuZIcuEV5hxuxGpX?= =?us-ascii?Q?jdw3ym3Aatvfs7yoPH7yMAs8GjDvnKxh2yN6o3//YP56msdDMGZRyaYaLW+A?= =?us-ascii?Q?Kea4XCdMZSE2VchM2lf+AfjpVJVgmUcyAufyBqLY30LnrrdG0ITqvmjsxQ9F?= =?us-ascii?Q?FU/ZH+jXdQTCtwxGjfWVqw+/oVL69U/DR8SMN2srmJ9KGeT27SAFnjEHJg4m?= =?us-ascii?Q?72m9atxOuKgaQQoO4wpsoOj78tjXlNXaj0ZYsmdN2ydyxPsclVgKVm85hKI5?= =?us-ascii?Q?7sMjRLW1likUXnumc3tLIkEzKGF5Rb84Lf8w/We8GQVDzV8xBhUXWOuDca7E?= =?us-ascii?Q?kN0HzCz5DbRAnuZmyRUkfUJK0uO7VC0qPrXhWkzviNi+sRleco5c8BscWSeW?= =?us-ascii?Q?C9sXt8vrReLFI4nVZBgX4T0I6I4EIv6+wqBv1s1wplc/0KSaWzcQwIistm7p?= =?us-ascii?Q?Qee99M6tVsOPR8/GrBupE1hkZmZPSCk6NJIPcDB+6Ujv90N/dIsTHWxquNPG?= =?us-ascii?Q?SEpSiS1ztqMzSzPFSOPbxuqbVpw7TzXdlmioRwjWaLGEw9GjgIkBbF41lZfL?= =?us-ascii?Q?lSB3P59IMi2oMrW2AM6k/W+9d7eJMtMldWEOpAncgG95UKECwfryPXf2IRQM?= =?us-ascii?Q?BzHf8Dw5dETOPm+TXA0H3ff6Yu/xcTJkEXB7ISfTXCZ8m/6Een38V5IxYDEu?= =?us-ascii?Q?jelCewwPWylJ7u7YBHMdmrD1/exxXCvO40NNo+0vqzUZ9i4dntLYoFPuIZci?= =?us-ascii?Q?CF6EPiKHxBOSQQBuC2xXSrcgA1yrfbkv2SVcKBURqnMrt7+VG8Or65LZhHxI?= =?us-ascii?Q?iPypbCPBhuabReC2th12aEklCJDHCy0/MAjsWPw60GqJIeyJ7tREKq1K0Tdw?= =?us-ascii?Q?/AX81U1MErT11qftTQt0dVeByl5eTgnxNfOj99SUnU41Uwhyf9nsnlJtjcOc?= =?us-ascii?Q?UYR3s=3D?= X-Microsoft-Exchange-Diagnostics: 1;DM2PR03MB383;5:F+ALnbufDaCu5FCqK2zQG8Cye68YkyhoGvTh9Jtwy8PMbeEJe/V8f/k/P6vXiLn9qi1rRfEYcd2NRQid0KR0lOiL9BtHCf9EokcFV1JEAWyhDB/mEHQbIVTFqJCFBjdpeKwu93a7PO0IwlluRAnUPg==;24:TfjQsCb74XtY87wIgn1J2EnG5eMofmpVNBoMITlmlehnFX++uPw2B20ejx8beroBa/JW246kXFwZiqOw1cWrqj+3GRT6SAf0oHncFDs9gAs=;20:y6A2g9C5tD6HR6wfNyYRA2Rrm1cZKq6e8BBYgrWw1YIiAGAWfliYq5VTI9RORTxgBsbH4WpgYw5t+quG4O72tw== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2015 16:18:18.3894 (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.158.2];Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR03MB383 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 7603 Lines: 215 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 | 35 +++++++++++++++++++ .../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, 88 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index dbd8a70..926a740 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 __hot _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 7160eda..0fab7240 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.h @@ -199,6 +199,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; @@ -207,7 +226,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 { @@ -235,6 +260,15 @@ 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; @@ -296,6 +330,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 bcd4c4f..4085f14 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.c @@ -754,10 +754,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) @@ -1208,6 +1213,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 diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.h b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.h index 49dc8d4..d376317 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.h +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth_common.h @@ -121,6 +121,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 87f2798..4a33a59 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 __hot 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/