From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0064.outbound.protection.outlook.com [104.47.42.64]) by dpdk.org (Postfix) with ESMTP id 3CEA1FABF for ; Thu, 2 Mar 2017 12:40:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=VNmH6m/qMvI3hjQ6ZHIfbJ5ouom7NL1AqQRu/LxyIJA=; b=YAM9WfvgXG9xiR5S+jZw0IDSVfYlADX1iYxQg+Yw7iRYIMq5O0qyHTMqbZeYUoZJrL97nErcUXfER49wJqNpHGd6N7et9uD5x7tYY7IDuAXrk0X9BZ6EA+D9xDicMCDllcN7TdXS7zdhkrMduI9RiJNrdtruVosA8aWrhBihbEU= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from lio357.in.caveonetworks.com (14.140.2.178) by CY1PR07MB2277.namprd07.prod.outlook.com (10.164.112.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12; Thu, 2 Mar 2017 11:40:03 +0000 From: Shijith Thotton To: ferruh.yigit@intel.com Cc: dev@dpdk.org, Jerin Jacob , Derek Chickles , Venkat Koppula , Srisivasubramanian S , Mallesham Jatharakonda Date: Thu, 2 Mar 2017 17:02:46 +0530 Message-Id: <1488454371-3342-42-git-send-email-shijith.thotton@caviumnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1488454371-3342-1-git-send-email-shijith.thotton@caviumnetworks.com> References: <1487669225-30091-1-git-send-email-shijith.thotton@caviumnetworks.com> <1488454371-3342-1-git-send-email-shijith.thotton@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: BM1PR01CA0021.INDPRD01.PROD.OUTLOOK.COM (10.163.198.156) To CY1PR07MB2277.namprd07.prod.outlook.com (10.164.112.155) X-MS-Office365-Filtering-Correlation-Id: 90e76862-4773-4c83-1d50-08d46160df54 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR07MB2277; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 3:QRgvtbs0NHd6Gl7grOEjXVd9Tk5SOrAkeuLSCe1IJYqK/CG7hOQF1meD4bISL2dsVUppFJTq4GgswoVRwDKZHMThiBSadrTy2GSOZNpxTQaoXQqnTQEizXxQTUZyKOqKaQ1oBcl+ThyO/OpXjdRkf9YdbZmO2sxxmeuojS5xw8qgVs85V4u9yPFQXVX8ZrMeiF83xubkG1zo7j6ZqGfaGuiRFQvtTMJ/zmFUE0m20oode24pgTqJO+u5/Itv3rMDrzAxdbTE3g+YQx7wolxAlA==; 25:fybG/bKye6YrS0dxI7mdcJyJ2hKadvl9zv+XJ7Y5DeYT0hQCmUp95n5eO32oIzlcgI6pXFT+48Xhw8Bq6gZboJsxmg6dFHdAa65WgoIMZ4fib6CXMjvyL5xnqXJMr+F5Ryap6MQCaauuEj6IZsi/E/+4TQrZVypz9b3EgqWlUTn7IeoPNa2PHmzUs0LotRyX7D9pajj/gNs2lT1KTUyOrbgNAj9XRhQitiURwEQR18VGoWXvzAd9XXTsTngcXwCZRKZcbPltjXhVnLXQIFD4mJyGkYLhNkiYArPOi1enV2o3NiTiXWpGK3swhN7bCzdzPhl/aOUyiyR68UukIg2TawyWgIzZwIOqUwO72jikg7iC6vTP+WMRLbFpF5LNopQIOb8i3a0cMlpX42U3gy2YeAkPulTnzmfH+uhfl3cIeXurweO+uj7e5DQypJ/BL1wUvlBdBlv3ZXyQUlwIoSEVyQ== X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 31:z08J4r3OIFU8k/Imw4ZlZ78PN+JMFZDaZHWm5zA3uLSpBEz7eIsbd5s+J0g2kRtRahd6bm9i0McKwaRDx12FtikMH0+GuETEQI8A+jZWuvhuHK/ZfPzR7ltV8GimgWA0y9IvBwdoPjYqmDb3ej1AVxWGq0tWvfDMMdN+/K0Awbzy/zghO9xNkRkeifjY13XstoQxA6KAKrjnLaoGtVIkWlzzqfUfy4vkobpYYITmMDIAOND25oM7V3DvlClOceYI; 20:ZP6tNadvv7g8wmBznE+haI1uVsALHBavPUN6YkU2riXKbpG01TSMeS+vQHHRj4RBf/60rcNknYm45DFVqUhIPb7qkdL/svLofSg45FdykFKWs49O489vyc7TwLh0e80ujIZA0afkEi2GJl3EwPu7qTWyjmuV+dU6SJlzb2ypGRVkuq7fRnHehywcU056vYs6Sz59uYQC3/Efmar+ZYZQq2n4JrBE6pZmiwFepeI+MnA32rtaMOfsdCPMFQ1K1HUALNtKDSvapaWPYR6DCEiPzKAfXBUSx6RVn0+tVhURlDDwE2lnatlgcLc+UAT2Ib0VKMmuVoSfiUPAOhitFEm/haryPqSkBvn1HqP+wW3E8iezzPbRWPOoLA+hLprHmKxXbgkQBlTF+wywt6gdNELkRbD7jzcF7fihKLVvu0ykCY0GmAcNvTRpdxlg2aX0W27jawve63Zb6srBHBGQ4zP92PLjMf1BtGc/9XZPJguaNotIa9tN/m4ABk6usaEnDw1yvgVx8Hk/7nnyXssGOXTgHEp1UBaj1eHMYh3fDxba1ZvSxl+pcPqHp/0V7yrk+aCyQUYWcGgSWv1qKt1CJmAk30WH50fQJtmg8rMRiT4mlTs= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123558025)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(6072148); SRVR:CY1PR07MB2277; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2277; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 4:RxHrhP3kLQM1Fo1+s3Zt0bvcv/NBlP5T7tBdUmRlCiOFKwBxlhmciDykRceZGBhhAEk0bQ5nc7qoAM6xxBN75ahToSI+ZKWg8W/kg8Yn+IK/sTJc7UZ4yOKIHEVBcWMAN+TfTI5kxKpyDWNgOaypdeZ8O8fZ/tYDA+dzLcVD+Cg7lRvjR9qS0lTnzQyzXH6ayCt9Cxops1yTD1Cjt0kl+B3Y1KU1sZdyH0j60+trGc6jIIBIPqBy0gdp8VACFspQqdQ8n7/ziEbRz/BtEPlZjjLdIHIzlLcuIvi+x13v2easJRm+g0LMgF4M9S93sxjNBvlHu5hvpQ58pOzVpYn4uNJAEGVlB9KCGoKaI8sU6azpWM1KyS/YkTBYnHazCtkP7a2HH62lRhX4hWxN+w7F2TtopPhW8YHc3ogvpsHVDQ3r27PL6KmMT7pN0XR7q7KcU1BD5Y8k9kLbFwSN5rjX0TM+V3riYM4hm6ygB6CyGKQOgS+ZfnKSkpAlhgSIDvluFRrqLdjbr4fjrFv+X6IeSCFtFHUjir4BldNo92c3UwV21LbkvGTCdDEJX9saPXkGGti2LfoecKAq+0HGslrU686zGpLD34uFrvfeEqdo+9s= X-Forefront-PRVS: 023495660C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(2950100002)(6916009)(42882006)(575784001)(5660300001)(92566002)(4720700003)(33646002)(48376002)(50226002)(6666003)(2906002)(5003940100001)(36756003)(8676002)(50466002)(81166006)(110136004)(38730400002)(4326008)(305945005)(2361001)(53936002)(2351001)(25786008)(6512007)(189998001)(54906002)(47776003)(6506006)(6486002)(66066001)(6116002)(3846002)(50986999)(76176999)(5009440100003)(42186005)(7736002)(7099028)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR07MB2277; H:lio357.in.caveonetworks.com; FPR:; SPF:None; MLV:nov; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR07MB2277; 23:RBXAvspbNc648pUVj9I0mAvJFVgFlmXqWe2MQy7Lo?= =?us-ascii?Q?WdL1ipS8ebr38qOCzD7nuHYWnJwTXBJ4kP25tPg14/5LRuirb/TFjxj8C1N7?= =?us-ascii?Q?wj44mlhnIO+smHyvPCV2t501n04AU4dAAecrFHdeHyi05IqJHCqBl2XHe4Pp?= =?us-ascii?Q?oVgNZ7aXF+wOVtZeJfN4kZwU815p6IJLrQRYO9LUW3ixaTXLl007+rZSaX0N?= =?us-ascii?Q?9UxqV+ZsbWpd23pu0zje6/VLJ/3d33HwUd83ITyIFVZPqA2H2llvQwozP+2n?= =?us-ascii?Q?eXChfh6pACeZx0qDP1/sXE/r2xQ+fx73Axl42p0sezbruICh561RgK1SS0+0?= =?us-ascii?Q?t/RXcsB967qdA55StrCbUPYx0Qt6FKWeS1BWVdAuvRoh4N5xe1Oka2IEeYkf?= =?us-ascii?Q?908WORqBmLFd02XzjFkw/ruqBjPQHFTT8pITFjJ6bR29th2jbST4P59qx1g/?= =?us-ascii?Q?YgXtJc+rlUGr+rj1BC5wjGh+8M+Ri9eSI0uQG0z3Vor/Q2JFpc6CUvSCn06n?= =?us-ascii?Q?54JhzLRbTM5hnYB3LN9xc/Silpq+VLML/0zvCUKPygyPFii64FmCCUI4wpGd?= =?us-ascii?Q?L0zgGz/iiBHwwPjIJkl54sMm95VnsAqap01Tq78Seb2WPxhNxlDj+DOUQq6I?= =?us-ascii?Q?SKRp9BViXoFqQm0t7zj4BPTK5mbViDqTW/4nndujmZocSyQ/uUI83vUTchUw?= =?us-ascii?Q?IwNIRFcZSAQ//UqWJO/hsPffvNc88+g2y232kia0AaNw6JZaB4/1oBICso1U?= =?us-ascii?Q?WfCf90bDEyU9g2tMhvZGCByUc14rIcVij4CX1gDIdhE5W8+T7hzsEh72pqgc?= =?us-ascii?Q?PbNMu0zHdsJ4DJPj/QKNviYthcywUW/jM0G/O4SeJ0Yt9F5JiA+sJ1MWD0gK?= =?us-ascii?Q?abnBav+OIgVtmD2sf1Z7ko3SOpKGBamMcEh0HVUuT3lDhssd4317iOZJqDVJ?= =?us-ascii?Q?zXfoO97xRE04bckQ7WlNiRIpyIU04eLQ5/R6foYwxZ5IYmtFhhZyKT+N8YDN?= =?us-ascii?Q?uW3FX6d7q5UhmBzDDDlPF0I47I7wrRWkiNC1ZLuAzrs7uSyOZOaWQuxByis+?= =?us-ascii?Q?jduIf2fzS0giPOsMaWlpvWG7q4LnRq8cTsql0hdEUsoVo2osFWghbENdNXw1?= =?us-ascii?Q?hEqECMOKBc=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 6:uW4cWdzR6lC2/gKLtuIlIqGVHKBd6FlQPyJM3gluq8x4elCqAY594sbh2Qsbqx5Vu72eP8fVbuoHweo9cVALzJfsd/63DbhZ6EAdbBlnCGc2xul7GoP5omQXOGODB43Jj42u6yxC9u/hK61l+yunsTM8m7hvc/WvJaPf2Co8xvmaPENFQjh6x38IyAAvinLbCOHHVjETC5H0XbGsVscBX5LQLTwDeB1Zfn4Y8Cvg9+eCM9oQ9WGLTbYD+WSt3ymDCyClj5w72xHREuEuBT+1EKHJqzU4RA1kH+ZpNI5wY+ezWmTEft/4WEIB8Rl9krDrU5SKbsYtF8JECm66izwAsPeT/M/8hrdqd/iZKM+jcBOBZnPe1IOzBNgTnZH71ahk0/6a9sfqweDXEGXHVMIMBA==; 5:24T28Ar+SMqJmnsbRlJW24mxC++lJuU67tfz1m6Zyrs1H9nJYK/nfDqEOqDMlNfOedjyHDGFUK1zJsHqcQcsUvp7hwxQVd5OwwzY5lOyn05XPSythmHZZ3o7nNgn4IC5bsI/qn0Lktoo2mC/bFrYDA==; 24:bKBcPegzJuj4O1t9uJkIAmpwgHHF11SzEwjGLgyOVlt53i4hYzvrh/CfYXuGW35BHoMlhdM0u5Hixx8r6cMv18Ltd2tr7XcLrDjF5tPaGHY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 7:mX7r5uwuNsKrda2njMoYXERJZbRS3UA2BfUpRDbNfSd7sLAhhro7VzRD26QYb8pCLuA7S3GMjRszOwKYHvkePbgRg+N6RrMCkN3tvXVp654+A9+tklm49Uq8R1YPdaTWgtJ89yAbO33FrIWMdHsB15frK1nqtnUXhUyVEq0HXigKo3N/vRAIQC5GM4C7gBtEQF7CwtDK5VNZlbreRR2CtNEVH0Ud/e6szftCriklivPG+G+BJUMl82Ngvoq2MvSZy8vzR3u7EsVlSnf4Rs6Jpzj44zQCijz6JeYVvk/ysZZnUhLOfQzvcAe3Y9t8zx2ZTLJswd4IK3Z22NcvjczZuA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2017 11:40:03.3761 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2277 Subject: [dpdk-dev] [PATCH v2 41/46] net/liquidio: add support for Tx stats X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Mar 2017 11:40:07 -0000 Signed-off-by: Shijith Thotton Signed-off-by: Jerin Jacob Signed-off-by: Derek Chickles Signed-off-by: Venkat Koppula Signed-off-by: Srisivasubramanian S Signed-off-by: Mallesham Jatharakonda --- drivers/net/liquidio/lio_ethdev.c | 36 ++++++++++++++++++++++++++++++++++-- drivers/net/liquidio/lio_rxtx.c | 18 ++++++++++++++++-- drivers/net/liquidio/lio_rxtx.h | 3 +++ drivers/net/liquidio/lio_struct.h | 15 +++++++++++++++ 4 files changed, 68 insertions(+), 4 deletions(-) diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c index 794ec78..7f0e9f4 100644 --- a/drivers/net/liquidio/lio_ethdev.c +++ b/drivers/net/liquidio/lio_ethdev.c @@ -124,11 +124,32 @@ { struct lio_device *lio_dev = LIO_DEV(eth_dev); struct lio_droq_stats *oq_stats; + struct lio_iq_stats *iq_stats; + struct lio_instr_queue *txq; struct lio_droq *droq; + int i, iq_no, oq_no; uint64_t bytes = 0; uint64_t pkts = 0; uint64_t drop = 0; - int i, oq_no; + + for (i = 0; i < eth_dev->data->nb_tx_queues; i++) { + iq_no = lio_dev->linfo.txpciq[i].s.q_no; + txq = lio_dev->instr_queue[iq_no]; + if (txq != NULL) { + iq_stats = &txq->stats; + pkts += iq_stats->tx_done; + drop += iq_stats->tx_dropped; + bytes += iq_stats->tx_tot_bytes; + } + } + + stats->opackets = pkts; + stats->obytes = bytes; + stats->oerrors = drop; + + pkts = 0; + drop = 0; + bytes = 0; for (i = 0; i < eth_dev->data->nb_rx_queues; i++) { oq_no = lio_dev->linfo.rxpciq[i].s.q_no; @@ -152,8 +173,19 @@ { struct lio_device *lio_dev = LIO_DEV(eth_dev); struct lio_droq_stats *oq_stats; + struct lio_iq_stats *iq_stats; + struct lio_instr_queue *txq; struct lio_droq *droq; - int i, oq_no; + int i, iq_no, oq_no; + + for (i = 0; i < eth_dev->data->nb_tx_queues; i++) { + iq_no = lio_dev->linfo.txpciq[i].s.q_no; + txq = lio_dev->instr_queue[iq_no]; + if (txq != NULL) { + iq_stats = &txq->stats; + memset(iq_stats, 0, sizeof(struct lio_iq_stats)); + } + } for (i = 0; i < eth_dev->data->nb_rx_queues; i++) { oq_no = lio_dev->linfo.rxpciq[i].s.q_no; diff --git a/drivers/net/liquidio/lio_rxtx.c b/drivers/net/liquidio/lio_rxtx.c index adbd990..470131c 100644 --- a/drivers/net/liquidio/lio_rxtx.c +++ b/drivers/net/liquidio/lio_rxtx.c @@ -1113,8 +1113,10 @@ inst_processed = lio_process_iq_request_list(lio_dev, iq); - if (inst_processed) + if (inst_processed) { rte_atomic64_sub(&iq->instr_pending, inst_processed); + iq->stats.instr_processed += inst_processed; + } tot_inst_processed += inst_processed; inst_processed = 0; @@ -1130,7 +1132,7 @@ static int lio_send_command(struct lio_device *lio_dev, uint32_t iq_no, void *cmd, - void *buf, uint32_t datasize __rte_unused, uint32_t reqtype) + void *buf, uint32_t datasize, uint32_t reqtype) { struct lio_instr_queue *iq = lio_dev->instr_queue[iq_no]; struct lio_iq_post_status st; @@ -1141,7 +1143,13 @@ if (st.status != LIO_IQ_SEND_FAILED) { lio_add_to_request_list(iq, st.index, buf, reqtype); + LIO_INCR_INSTRQUEUE_PKT_COUNT(lio_dev, iq_no, bytes_sent, + datasize); + LIO_INCR_INSTRQUEUE_PKT_COUNT(lio_dev, iq_no, instr_posted, 1); + lio_ring_doorbell(lio_dev, iq); + } else { + LIO_INCR_INSTRQUEUE_PKT_COUNT(lio_dev, iq_no, instr_dropped, 1); } rte_spinlock_unlock(&iq->post_lock); @@ -1667,6 +1675,7 @@ struct lio_soft_command * struct lio_instr_queue *txq = tx_queue; union lio_cmd_setup cmdsetup; struct lio_device *lio_dev; + struct lio_iq_stats *stats; struct lio_data_pkt ndata; int i, processed = 0; struct rte_mbuf *m; @@ -1676,6 +1685,7 @@ struct lio_soft_command * lio_dev = txq->lio_dev; iq_no = txq->txpciq.s.q_no; + stats = &lio_dev->instr_queue[iq_no]->stats; if (!lio_dev->intf_open || !lio_dev->linfo.link.s.link_up) { PMD_TX_LOG(lio_dev, ERR, "Transmit failed link_status : %d\n", @@ -1697,6 +1707,7 @@ struct lio_soft_command * ndata.q_no = iq_no; if (lio_iq_is_full(lio_dev, ndata.q_no)) { + stats->tx_iq_busy++; if (lio_dev_cleanup_iq(lio_dev, iq_no)) { PMD_TX_LOG(lio_dev, ERR, "Transmit failed iq:%d full\n", @@ -1804,10 +1815,13 @@ struct lio_soft_command * lio_dev_cleanup_iq(lio_dev, iq_no); } + stats->tx_done++; + stats->tx_tot_bytes += pkt_len; processed++; } xmit_failed: + stats->tx_dropped += (nb_pkts - processed); return processed; } diff --git a/drivers/net/liquidio/lio_rxtx.h b/drivers/net/liquidio/lio_rxtx.h index 6835430..d5aed6a 100644 --- a/drivers/net/liquidio/lio_rxtx.h +++ b/drivers/net/liquidio/lio_rxtx.h @@ -670,6 +670,9 @@ enum { */ int lio_process_ordered_list(struct lio_device *lio_dev); +#define LIO_INCR_INSTRQUEUE_PKT_COUNT(lio_dev, iq_no, field, count) \ + (((lio_dev)->instr_queue[iq_no]->stats.field) += count) + static inline void lio_swap_8B_data(uint64_t *data, uint32_t blocks) { diff --git a/drivers/net/liquidio/lio_struct.h b/drivers/net/liquidio/lio_struct.h index 50d5e86..26f803f 100644 --- a/drivers/net/liquidio/lio_struct.h +++ b/drivers/net/liquidio/lio_struct.h @@ -56,6 +56,18 @@ struct lio_version { uint16_t reserved; }; +/** Input Queue statistics. Each input queue has four stats fields. */ +struct lio_iq_stats { + uint64_t instr_posted; /**< Instructions posted to this queue. */ + uint64_t instr_processed; /**< Instructions processed in this queue. */ + uint64_t instr_dropped; /**< Instructions that could not be processed */ + uint64_t bytes_sent; /**< Bytes sent through this queue. */ + uint64_t tx_done; /**< Num of packets sent to network. */ + uint64_t tx_iq_busy; /**< Num of times this iq was found to be full. */ + uint64_t tx_dropped; /**< Num of pkts dropped due to xmitpath errors. */ + uint64_t tx_tot_bytes; /**< Total count of bytes sent to network. */ +}; + /** Output Queue statistics. Each output queue has four stats fields. */ struct lio_droq_stats { /** Number of packets received in this queue. */ @@ -319,6 +331,9 @@ struct lio_instr_queue { /** Number of instructions pending to be posted to Octeon. */ uint32_t fill_cnt; + /** Statistics for this input queue. */ + struct lio_iq_stats stats; + /** DMA mapped base address of the input descriptor ring. */ uint64_t base_addr_dma; -- 1.8.3.1