From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0053.outbound.protection.outlook.com [104.47.36.53]) by dpdk.org (Postfix) with ESMTP id F31ACD326 for ; Sat, 25 Mar 2017 07:29:01 +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=tfsNGPCbY9ctX1yGNJQluBeMzPm4bt743dDkEifdVZA=; b=Apfro/8mgHu040VicwDsK1QQBvalsBJuzcNgFjPH2DevYcMXcZdn7N3KXpfRQVndNDnE9CG7eXXF9Ypsi1fGpL6esjh1uSEFKMfy+8v9qjHbgjC64kQ/lGwgLWokN77NxzjiPqwigYP8HdBBmXLpHemLm3pbIXYIABNtpc84rFo= 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 CY1PR07MB2280.namprd07.prod.outlook.com (10.164.112.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.977.11; Sat, 25 Mar 2017 06:28:57 +0000 From: Shijith Thotton To: Ferruh Yigit Cc: dev@dpdk.org, Jerin Jacob , Derek Chickles , Venkat Koppula , Srisivasubramanian S , Mallesham Jatharakonda Date: Sat, 25 Mar 2017 11:54:52 +0530 Message-Id: <1490423097-6797-42-git-send-email-shijith.thotton@caviumnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1490423097-6797-1-git-send-email-shijith.thotton@caviumnetworks.com> References: <1488454371-3342-1-git-send-email-shijith.thotton@caviumnetworks.com> <1490423097-6797-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: BM1PR01CA0117.INDPRD01.PROD.OUTLOOK.COM (10.174.208.33) To CY1PR07MB2280.namprd07.prod.outlook.com (10.164.112.158) X-MS-Office365-Filtering-Correlation-Id: dd6f3993-3010-4849-ebfb-08d473483943 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR07MB2280; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 3:kqK+vxm+vTmTb+IT/646icqGyaEGML/BR6K9SWxy5BktN5ysgpbtqMWf8cEro3qAVBr4qIwJOKDUw3mJwl1c6Iw1UC2HJQ+OkJ+zmgd6ZZLQuYV+Osta/f22sauqVej3n6v7MFFhQ1egCbj96cJNexn5w8unDcNyTA4Sv3T81K+tbxA83RvVMyhaEWf8hDqnhKdSwZpkaHnvT+SdceK6I3SAzOy1LCz007tNmd+5jUxu0IIOBoUGXt1t+LsSKf0MKMOyB55ZhaUkgQs/C1m4yA==; 25:jwf45uqn8Qstk2Y8P/byw0Urwc/CQGzCNgZPgl/nRfBOiA1XbtCy3gWW/Zza9NJVtN++b3kI6pwlNmLXgLgtTEdQ3NxeCoMfo6Xe7bcINKcFZAkTKgunhb0PF9aWnuLdIMH6WA9iPcK38i/A4Mjax5w2AZcEpVGz44Pkk7o79VB0/wW/C6s12z1270Zywi630+VqLbP5tDYUPfmXAA3GDsbvdSs/c5hdXv1Yl08tmCTfApnU3d7wemQVv4Jjf0b9XrxlGQDXE8OLWO3RqIrjY+YqlGQBz53OQ9+6XTuXF1Y+vwk8h3F7iRFrP1OSJexxaPZgKr+OgxlLGhAx+0m20rO5yZlQ4y1muPVlC+r0kAwOSTBr9hAiDBah/KNy0bY+Z4JZKuS0txh8RDA1RTSXbI0uQMXA5YJZMyZHG5Wu896ZD6ntinm/RWHIXq5wYTjS3VpmzULccpIiH+yv3z2Hzw== X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 31:fFAP8BeJj/k543YJRyc27twBCl9bodBzu43LfhuNx0+H+G5bO/wUIBkVK9jtpYQVebX993Bnwt//ky2QrPno5IzWS19uwCbEOuIvcdxjZsnee2iRuwnStCylSDiBkxmrByR+EDJqXArAMAkENHvH14latkbQsSsy2oBCcYttibfZmixwDYxSKIkaC0BkxDoec/98s0XD0jUJ9qlXfFVBzMCGEJJRqgYQ4Zli/9Xn2oLXpm4pflEZqNyP/MqEDNOx; 20:XoCyFWXcvVvb6vnUWvoTW3q0QSGUbSIDAlkVud9NdlaIx3OoxFzufmsgn+h1VnB1FLUW6OUdtnsVxpVT/0vwOxItI2ndJRlI0CKfiyOJ+UGl0tn7iGTUPFZGGm+TLWHKVSCPgzzPZt+yQ7xEeLpGjmBC2W6U7uPv/LzdfNPSqW7PpVLOYMMvkZ2c3aYrwcMB5l1ikFVDb4uw2hUheVFRjjbvKhguFgu06RbVjqeeoX4zloDygmtHT1j21mNEL9UNx7bZ7qmVximCvYRx5cCtaM17M4kunRN5T+v4UT25IDYqj0g1Mo5BYAW8Mq+UujT1OHqCDyngw6xsoMM0P1xE1+n/vFbHXOw/4OvXaus0DO78VMF/UEs9BBZLYKKZWG74lX0ey/917AfeCWijAcgf8qgKgFFtZkSn9Xc5PYiqxBY6+nVn8OyTbnA8U/6TYggVyKp7qMRtxjT6TPYPXDsRxY5+LmqrVWhGHls7+APsYHjmCFQroDpH1QGOckv3KEQxCzNIPUq69XPmYI1CSBFukPWm+p33T/+z8TRL88rjB2gGn5v95d0mEchsfGKn7+mVaIJ9DxIV7NWf9SG9AIVd1W5/lEpZu1/+BwmLQVznLSs= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123564025)(20161123560025)(20161123562025)(20161123558025)(20161123555025)(6072148); SRVR:CY1PR07MB2280; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2280; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 4:G1jFJmG+8MG977JgNjFPNUeyGcGKiqJARX9ZjdInKmEzVOWXOoyuv8/KMbrr57xPk6BVFki3dPTawmVCRu5aG6kYxtGA0I/HEXLbsGmzDzhQFu4PlwroEXGF77QKJhXmwBWFZirnwNC9FjhyP1G3NX/5K6GgSXW+0e4eek4RaYlZaBAz1oP8M+FPjnW0+YLrsP0uMT8oNZ1KeWsPt87YCPQOYOqtJ9y8vd4G5DKL92FO/X6VBUd+/OK/F1Hrg8V/8zj1h3PGvDGQD+WwPkHAmfqTUWW2ENVopDT3xWKJ6iII2bWyHFsS6a7+SXyp+PuGJEvpt/WR/rjKwLfMpzMLnepv3VxHZ714dEhikrwCv82O1E9xTDcFLs3xyy6MfTg1sDyfutmLKtOIJEoKpY3xBttIDG6IsCtlsDeBnIl3oMV9hdVucOIgzhiHFleobhcfy+p3kSZ8ABUvrJ/23uR2sBxwtw03UbO9AHYX5/64kvVEDToNOsI3fXWWF0tEKngwn5Ust7TtNZCvjMpWiyGkil/6CCzJWxJ/38IHeWIaPiEppL7S6zwLErY1GWQIip5ZTaGKDbgjE2O9DBfZqNQlq/rgHHkPO44z7WKqyQRELXI= X-Forefront-PRVS: 025796F161 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(39410400002)(39830400002)(2906002)(2950100002)(5003940100001)(66066001)(575784001)(42882006)(6916009)(50466002)(48376002)(47776003)(42186005)(53936002)(6512007)(68736007)(5009440100003)(54906002)(50226002)(38730400002)(6486002)(6666003)(25786009)(305945005)(81166006)(7736002)(6116002)(3846002)(4326008)(8676002)(6506006)(189998001)(36756003)(50986999)(76176999)(33646002)(4720700003)(5660300001)(110136004)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR07MB2280; H:lio357.in.caveonetworks.com; FPR:; SPF:None; MLV:nov; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR07MB2280; 23:rW0rRrpPfOE/Xy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Q?GLSnH1wU2PckYqxMn8BoG1RAhIKGuH6urclHw4vIhStZPT5oWbAzVBNPKYx5?= =?us-ascii?Q?HFburI3CItvh5H76+0m0W9iXSDRpnicVXS63dDM7XQxtEzmaIBapYipLDE6Q?= =?us-ascii?Q?UPcTqozBvWE3FVwzDvg1s4VHbpsML2QM2UtqIeuXT2BKTktCXfWQPmwfjDH8?= =?us-ascii?Q?b3t0ew/94Ph37ilfIhOEpw2lbleogeVxcpng3O5HAMdVKVxug=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 6:/7G7a/4VEFKHBybYFjRSx4/w31HxQOzZYGtzr2eTDrmaVq7FqHkiPK2wsD+o7pyOtJ/A0KJTK0ZYHj0jP2x3OmX4WmG06NdxN5cod0tE2HH5pjJjXl7L3uBKm5kWr3oGgIEaHsdL+DVe2J8oTSnWgnKjRnWACjLCZYMrUb2I/CWRJJyBOEWKXETzHQu4jPOxaD/Fz0DdE21MtfIb3r6h9KjgBmyLR+DiDKgoAWyaML7LV5plweqjsXrNPqDwPFoMgnnZMInb6y+vfree6MMBSCvt+jIgvRh7NQdkRreNBndHvLSBXrFLzga/dkV/AIDichz9oVh4AD5C8BODrZeO9aG2RzNVMS12yWVw/KsYm8D9I7AXV+GPSPKy6qDOuTRBZ32WWJ1UEDsrSxMGbcvcKw==; 5:m9sSAxKCr4tNAll2wNqLN1iWO/1SUtLW1LtPE48HbVZBDrt0gvgLTC4CZHT8OSnyrQw50VI687niNRZJ4t9D28ETFNMtGyiyZIGN9FZpVYIPaOppkgLIDL57UmB8MqBEYDXFT90y2PSE8nK71VdBbw==; 24:8cT2eshMzKukRt6+Gyz6Uk2XREHvDWgkX7lkVPsGmtyNpm57YspXTd4Gr9LSgof33wSiG+s0bk2iX2WY18ObjmqtvI57vxRWFSHsXSEPHrI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 7:CnYRxprhFv2LExWj0QPLTIdpadQ50snA0SmB2SkDz3CzLCKCoqeXKIpWAA9phixiLyCUzsYXFgDT7OB7jZeOvSrUbzrw+NixHPOhRwSQIFSvkBweE3ISYdAQ0eiMIJ8oUY5mBKSCSvVQ9VjBWTpBPAor0Kgd4nGSuFv8SY6V9FcFVQUSwO0b41o1L3ODB2eW9t/v/gXjQdG1BLxMyLqbkPofau9yMf56qq8+StqhNLniYOS5dpPEjcOlIl1x97Be+tsoZ/C2xTwNbTiAUfH2O61ct2cTXAT0O5zpcxEcbwArBXZ3uv7PaqHbweMiX17cwWkPr6RgL84Fy+px2Auhww== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2017 06:28:57.7975 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2280 Subject: [dpdk-dev] [PATCH v3 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: Sat, 25 Mar 2017 06:29:02 -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 adf0db2..2f3bb3d 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