From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0071.outbound.protection.outlook.com [104.47.36.71]) by dpdk.org (Postfix) with ESMTP id 8C832D326 for ; Sat, 25 Mar 2017 07:28:58 +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=ivz8LXcWHw1m38gAlaTbtHA2YaLJRuaNvV9AcHs0vTc=; b=VkT7WICOPHKlyMqv/aKjwQOCM4BuBvBZHgN6gGohyXQHU97sq8lZoI2wuzhWEA8G87ZO5Y6goWyH/mfgVayEuHiMzol47k9qa0kCfdm7y1tAcoV7zRPo2KIdMeDhf5b9B2DFAhirwa+u5AXg2u/obx4N83t70xHNuiyPMiw9uIE= 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:54 +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:51 +0530 Message-Id: <1490423097-6797-41-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: a5262044-c40e-46f0-e010-08d473483778 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR07MB2280; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 3:CbLAl/giKT9xLyLHxw+24TDYdbE68f3XY8OVS2mQisziowlTLEGE0YeEex0nlNz+XH7UVvMykYOzoRgMGMK1jTvQXflNN9mmYFezs5tVjwkAL00gRW+QouhVBk2dEbrbqR165xL0kX//oxUxs03iW4K45EYALrL0D5uMUZRQ4jTJFLKNlwtUe9QLAnhQz2h5SI7fEKLIqYoJOCIsXzauoy1GB/UgYkUngdU7+9lYzvEBIaBhioEbmbryzQuFox6z5ynY6KaTQE+ESN2PCm/7Eg==; 25:pjPOCYvddFWRtYOMt4ehFjymfbA0naPQ4I6Pur4hIvDmiz0GyIYKFWhxlIUxeSrEh5FEY4bwHFdvHWyKflDVcj8UlxatZ/xW4fqhB5IrC68QmEMNbPAD3GbLjcGZmYLbtSU5wS4FDPRuPXCSVtPLZ8yEk8NFMdO5XS9yjpkbgd2Z9YsioPmPolinD+dHNcCzO1Ahg96JW2zcPZs9VqVH897/+UBB0fv/X5dnQZblIuuHiXEEX07uriu26J3FjVlg5pnmxYwP+RWcBsqzai1NkHeReOaEoXxzwz3c3hzwGaVuHpP6kxdb+m5JoknD88o6FrfjDRNxyVExRUmKiwa7oC0pCvnV1wHfJzO8XZNih/ltuTPjNydnQhFRSqt9aENROOK1vOHav8hwCoWFeEN4KuHD1ecfainr7z8tScijiVZPO9YqbnRpERPuUyeBlfsQDSsoW01VvKb5C2U9dlHQ+A== X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 31:qnmmvuu8bvmpjdnPbMAkSEjxoMHX6TDvfmB5K2EitzVZqFpuTPsabEnK9X2ITH0F0pKPTow7ExpQoEQ+0t74ukyQYWlYGZOQ7GpgNRTRlzW2KrW7P5i17Hx4froHYV0sbYNNhdm+A1dbNx0xfLjUwkgfAvYOecmDEYxqNz5fxcQm0dZ2LAKJxNPX7EXTWTxVFn39GUTcm3Jwsm6y/cLm0LGIrzRHK/dup00WVCaha7dEevnncbFbQZG6ETCPZAOB; 20:9BE2LRQDCoy0DoM0aMF0FTGa68QWCvXvwNqG7uarubhP9s3FGrMCEPVYgt7wJFMNVoBmq7lWqDdQWGhjqSmT2ZpZKdTXPAWJ6BVKuqouy7+qsWvrLNSskj70pxGCDeRfXb09nQG4RIhLL4ZyXRY4/hPq7MftMY+0pkHnnbrixr2MkU1rqCI+a+6CuAL13bBIM8IP9X+G7dVv6OBCorJT5guBs+5UsWfKTD3w//+WwoDZeXyCThCgMtSLXmsEgHV+mGWpx4BpucAqjO6iTjlwwjdYyjkz0SzAKRL303ERxbfJTvgeSe4GjI9LqhYlsvXIBQFH+Z4QIPl5lvWwLrgAsy+u++SsYpqIhZdGacrCjBX9IBMlagE4EbQn4Pkg3uTIS25U/7hnPLkyXKZmDguGGWLX/874MezSdG/UvT7ZAZlapA25x49jEVdEySo0RFp/9HsLONhUOzHYxkO1tKIhyh3mHOnfX4tzZV4HS0UoePzqzRFYgTKmThFyqy/q0iNzf9WdiJ0ltA/XTfqZX3XzN1zbF0ufvTrby6s46VY8iXAHy2gKpZ/qqCZaMcxJtWLNaGMXdpN+u+/ez1izOFglt7MntWcwdzDlp/9n7g4r0J4= 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:QnXUJyKN2OFRKVRNvJtZALIksDLuxxqlscEeA3HFLdwhOieDMiC0cETlPEueY3hyt1FaJSjM4pGsB+lxeuCBtVyDjGBKj0YnOnfypaIRx4mtAwlpgD0tHBEk08Gcw76zl2tLlz1duHt1IqhQMG0TBvxgNxnlS1J/6xvksEa4xZ677W+rI5yoE9lCXepQmFlJgMWQTi8vIKOJYj+OvFN6dmnPqXsdMyrG0okNJ7OzVvf1XFRQfpRzgzww8DMv/nfOTwt9rfk42zY3oSzGxjw5P5OIME9r04mfH+hcmWcVoSOKCykF6xrc2mGjolkV38M87951L7WEBRG7RDRDnJgNL6Fye4143m5Cwj4TCEwTILaHShE2JjT+JENSbQ3sM9f5TIB8LcJDkJMTToIZHNd7+YzzdXFIFR/DeK3+Q9hCC8FVUnLNBb7DNzuoxDDlaRw75fOTgDoz1aWSihjds/pzJp2XD8u20TkOpiwz/htAp0+jhdek08GnFf3/bRHiCHDhEYeSoDsP1GDAccpm53EhJ8rYaDTblUBHTP1N5w7qS8j9lajs1cdl2URNI0hjV7bQrYfu8JN3PQlaf9r7n0ExHxuh01MjsnzzlVJ17aOOuVs= 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:1P0+OJGWxmAltobPJ48J2lkEDwz035Wa4hPSJ59jh?= =?us-ascii?Q?GegIIRmvpUTlxL19F1kOZWa8CNYK2I815663xJQUcNPlDuQJtKo0MvpcaRha?= =?us-ascii?Q?HecWf0vfxJreSlJshsH7x+AbrK7g68L8OnFCwqK+6g52b5OATaIGao8akwC0?= =?us-ascii?Q?XcRYJcZD2ZxBOmYmBfQKKfKoVAT9+Lh6L0zTHzrqFmo1Wfzs5CXBYDjP3MUv?= =?us-ascii?Q?fwvIVJcYd9Df9Qmj6DsbsWe9RH2CW2VHYl+E68EzxUwaUbPefEUKSvSATU35?= =?us-ascii?Q?XbzzkuVQ4YQIfWAFMnPNRmePZN1Un0eW5ztMkttvkV1F+B3qwUbA5nu9kO5h?= =?us-ascii?Q?hjq6Q+yxhWSY6/Hfjzdx5CLiq5g+liNusqLumW0CMr5UNp0Gp+qzGhpXPVAk?= =?us-ascii?Q?s+H75OGHF5LdqHpZ5dGyfOXOoolyAuruDw660M/CIuZK9brJin/cd/7hmump?= =?us-ascii?Q?+y+lFRvc/rB95guUhrf020xdug373/GcazFinnEviJlBQdCFgTeeBmhasPIs?= =?us-ascii?Q?yR4e6jN8zYP7Is+8QCb3L+q3az9rfgu3L+2SJARUY327XERzEJ9EzvaYgXvg?= =?us-ascii?Q?kqZBdGfPFqarKXpl0Ofwl3iDtKm6gs0w36bkccpKH78VgGL7V/AjsaCrUw+P?= =?us-ascii?Q?aS3NohwBbM1QZweTrlH2AEuLH76hNG696kIt4eJdTeS3wk1GnVrZXQbWo9u+?= =?us-ascii?Q?bW1VniLwrFm4armavO17KOiN74s1Pecp/vvnxq8wKp8XBJ9p1/c6n4N/dw8M?= =?us-ascii?Q?UD1Yn90JormiNA8FdQmM9Pd/CdZf0IFJc77pcD/11ks1J5325mPQAvwGVdNB?= =?us-ascii?Q?Xww4k5GgX8Q7oH9Q/XwKkCIVaup9B3osCqdRDHuxj5/HuQYKBte+fnwHVDP3?= =?us-ascii?Q?A6ceTtzkwcwc/AsQC3C4wi45YgXrKQdBGGjolhIUDNll5ITSkXc8laVgxiMV?= =?us-ascii?Q?c3PdyJgi471lB2tGGUDFpeuhopEQgHtwAG4OoL19PuspxbILZ7E5ORyUYkxu?= =?us-ascii?Q?aL/996CJ4jI7Cl+ctfPkR7/Uif9jtSA05JvoGqEuNYpZtV3uTWfERde08jD8?= =?us-ascii?Q?kQlAoSbtTNwkDr4Mg8j9jjxVEdGklbUo/E3MBh6ePqLqSlOqA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 6:O1Uke83BTWXaaCRzyW14XghuloM3iy5BS3K3aWJurDF1PtJKsvz08MosvHbpLBJq1Sd7bMfDMxWIe7pte0Q2BF86C+HdWkoHQ7XkTffkDEU2jWPHedZxUBKMb6GSbeV9W0IiavCzhzHJ4nNtq0SMk8qNtdYHH1q6sAI9iX5clVl1HHilyr/JO0/sanlV8eMA7CdsGjZBMEKbcZRN4yOC/TueWXwRJZJ3ydF1X0ihbzLm8MMUYqFzvM82LsiecgFVJVqGnRN5nPb35eWWO/PA7p7FstlROydj1Jd+iB7v0p31THvCOB34h/Vn64mZT/HwvB0J72rLgT5PZa0UAYq7wrKqRnGkuCW+MaSK8SmNM3Ywyvk39pnzaWcml2H/laXO3hGkPVVLM3FZ8T5jZSgDcw==; 5:quTjPRuzaejrxOcZ5xaGERXlSu3rQWdYK4Klo5xMSjjpILNKKKTXKlZ8wkgcWrYqTxvRY5OBM7TwF30A8vgTIphXDZM8jZIbeVOf0wYFVMJFBTnV+6r8cE0QijRKDLHrfj2eAzWe1Aa3V6vATNtzRg==; 24:dbmfpr6Y9x16pLQQl65LCUVQuSM3meiTlHTvDJkA4dknT9TP71n8vGpUo2htBdvNuxd5LMXQZSvusFPkWvtWgS3cz+eQweyPoPYT8DMXuvA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 7:kFVQxjNXeSLOCtVu2M1zZXaaAVO4Z/Z34SPZaAY7Nw8udnho3jhiS04TZ/RzzExoYgncR1yKC4Wj5GeDM6O3vmI0AipdljP7kpsdiyWKkTeBnpqEd+eXYMt272Tw9AU0AgMul0Lt/1QxRsjTpIG4E51b6oDvWMRT1LICvmyr08fTaTHm5cpSjZzjUJtDN9k1JuU1cDTtZ1fIeOOcdG3I4qXxtSxZ10cqw3MQWBQP1PuAPzdxijhIPWae5qFoZXwE765eoiFbYsQs45kyvQMb56neOSGJmpQ2GDq4DXoZL1lBatbIiolKRLAzob7oGPbMXFzl7bwppuc9PscY/ukp5Q== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2017 06:28:54.7441 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2280 Subject: [dpdk-dev] [PATCH v3 40/46] net/liquidio: add support for Rx 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:28:59 -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 --- doc/guides/nics/features/liquidio.ini | 1 + drivers/net/liquidio/lio_ethdev.c | 50 +++++++++++++++++++++++++++++++++++ drivers/net/liquidio/lio_rxtx.c | 10 ++++++- drivers/net/liquidio/lio_struct.h | 34 ++++++++++++++++++++++++ 4 files changed, 94 insertions(+), 1 deletion(-) diff --git a/doc/guides/nics/features/liquidio.ini b/doc/guides/nics/features/liquidio.ini index 2d6a49e..3195515 100644 --- a/doc/guides/nics/features/liquidio.ini +++ b/doc/guides/nics/features/liquidio.ini @@ -17,6 +17,7 @@ L3 checksum offload = Y L4 checksum offload = Y Inner L3 checksum = Y Inner L4 checksum = Y +Basic stats = Y Multiprocess aware = Y Linux UIO = Y Linux VFIO = Y diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c index 3911864..adf0db2 100644 --- a/drivers/net/liquidio/lio_ethdev.c +++ b/drivers/net/liquidio/lio_ethdev.c @@ -117,6 +117,54 @@ return 0; } +/* Retrieve the device statistics (# packets in/out, # bytes in/out, etc */ +static void +lio_dev_stats_get(struct rte_eth_dev *eth_dev, + struct rte_eth_stats *stats) +{ + struct lio_device *lio_dev = LIO_DEV(eth_dev); + struct lio_droq_stats *oq_stats; + struct lio_droq *droq; + uint64_t bytes = 0; + uint64_t pkts = 0; + uint64_t drop = 0; + int i, oq_no; + + for (i = 0; i < eth_dev->data->nb_rx_queues; i++) { + oq_no = lio_dev->linfo.rxpciq[i].s.q_no; + droq = lio_dev->droq[oq_no]; + if (droq != NULL) { + oq_stats = &droq->stats; + pkts += oq_stats->rx_pkts_received; + drop += (oq_stats->rx_dropped + + oq_stats->dropped_toomany + + oq_stats->dropped_nomem); + bytes += oq_stats->rx_bytes_received; + } + } + stats->ibytes = bytes; + stats->ipackets = pkts; + stats->ierrors = drop; +} + +static void +lio_dev_stats_reset(struct rte_eth_dev *eth_dev) +{ + struct lio_device *lio_dev = LIO_DEV(eth_dev); + struct lio_droq_stats *oq_stats; + struct lio_droq *droq; + int i, oq_no; + + for (i = 0; i < eth_dev->data->nb_rx_queues; i++) { + oq_no = lio_dev->linfo.rxpciq[i].s.q_no; + droq = lio_dev->droq[oq_no]; + if (droq != NULL) { + oq_stats = &droq->stats; + memset(oq_stats, 0, sizeof(struct lio_droq_stats)); + } + } +} + static void lio_dev_info_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *devinfo) @@ -1390,6 +1438,8 @@ static int lio_dev_configure(struct rte_eth_dev *eth_dev) .allmulticast_enable = lio_dev_allmulticast_enable, .allmulticast_disable = lio_dev_allmulticast_disable, .link_update = lio_dev_link_update, + .stats_get = lio_dev_stats_get, + .stats_reset = lio_dev_stats_reset, .dev_infos_get = lio_dev_info_get, .rx_queue_setup = lio_dev_rx_queue_setup, .rx_queue_release = lio_dev_rx_queue_release, diff --git a/drivers/net/liquidio/lio_rxtx.c b/drivers/net/liquidio/lio_rxtx.c index f105457..adbd990 100644 --- a/drivers/net/liquidio/lio_rxtx.c +++ b/drivers/net/liquidio/lio_rxtx.c @@ -115,6 +115,7 @@ buf = lio_recv_buffer_alloc(lio_dev, droq->q_no); if (buf == NULL) { lio_dev_err(lio_dev, "buffer alloc failed\n"); + droq->stats.rx_alloc_failure++; lio_droq_destroy_ring_buffers(droq); return -ENOMEM; } @@ -410,8 +411,10 @@ /* If a buffer could not be allocated, no point in * continuing */ - if (buf == NULL) + if (buf == NULL) { + droq->stats.rx_alloc_failure++; break; + } droq->recv_buf_list[droq->refill_idx].buffer = buf; } @@ -629,6 +632,11 @@ info->length = 0; info->rh.rh64 = 0; + droq->stats.pkts_received++; + droq->stats.rx_pkts_received += data_pkts; + droq->stats.rx_bytes_received += data_total_len; + droq->stats.bytes_received += total_len; + return data_pkts; } diff --git a/drivers/net/liquidio/lio_struct.h b/drivers/net/liquidio/lio_struct.h index c2293f7..50d5e86 100644 --- a/drivers/net/liquidio/lio_struct.h +++ b/drivers/net/liquidio/lio_struct.h @@ -56,6 +56,37 @@ struct lio_version { uint16_t reserved; }; +/** Output Queue statistics. Each output queue has four stats fields. */ +struct lio_droq_stats { + /** Number of packets received in this queue. */ + uint64_t pkts_received; + + /** Bytes received by this queue. */ + uint64_t bytes_received; + + /** Packets dropped due to no memory available. */ + uint64_t dropped_nomem; + + /** Packets dropped due to large number of pkts to process. */ + uint64_t dropped_toomany; + + /** Number of packets sent to stack from this queue. */ + uint64_t rx_pkts_received; + + /** Number of Bytes sent to stack from this queue. */ + uint64_t rx_bytes_received; + + /** Num of Packets dropped due to receive path failures. */ + uint64_t rx_dropped; + + /** Num of vxlan packets received; */ + uint64_t rx_vxlan; + + /** Num of failures of lio_recv_buffer_alloc() */ + uint64_t rx_alloc_failure; + +}; + /** The Descriptor Ring Output Queue structure. * This structure has all the information required to implement a * DROQ. @@ -117,6 +148,9 @@ struct lio_droq { */ void *pkts_sent_reg; + /** Statistics for this DROQ. */ + struct lio_droq_stats stats; + /** DMA mapped address of the DROQ descriptor ring. */ size_t desc_ring_dma; -- 1.8.3.1