From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0067.outbound.protection.outlook.com [104.47.38.67]) by dpdk.org (Postfix) with ESMTP id 6A69F4CA7 for ; Mon, 26 Feb 2018 06:16:59 +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=s17qupMnHyehSVv32IkLAhNbMGWAx2uybpaVIn7v+z8=; b=fBiQ7LHKuldgG4QDk42hpPdlNiJjrhEJQ21Xv99NftM3CcbBvRD6a8n+JccQO2VyEKvslxRU8yrDccM0p22uYL1bHZbzx/FI2mmqnc30PBTuFcDyNVp7H8RxuAMd23MbJyED09I+Glldmn8WCz9nX48C3YXX/P3mB2Uby4WSbfU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Rasesh.Mody@cavium.com; Received: from cavium.com (198.186.0.2) by CY4PR0701MB3666.namprd07.prod.outlook.com (2603:10b6:910:93::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.527.15; Mon, 26 Feb 2018 05:16:58 +0000 From: Rasesh Mody To: stable@dpdk.org Cc: Rasesh Mody Date: Sun, 25 Feb 2018 21:16:13 -0800 Message-Id: <1519622173-14087-2-git-send-email-rasesh.mody@cavium.com> X-Mailer: git-send-email 1.7.10.3 In-Reply-To: <1519622173-14087-1-git-send-email-rasesh.mody@cavium.com> References: <1519622173-14087-1-git-send-email-rasesh.mody@cavium.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [198.186.0.2] X-ClientProxiedBy: CY4PR15CA0024.namprd15.prod.outlook.com (2603:10b6:910:14::34) To CY4PR0701MB3666.namprd07.prod.outlook.com (2603:10b6:910:93::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 133c22e2-3cec-45f0-bd0e-08d57cd828fc X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:CY4PR0701MB3666; X-Microsoft-Exchange-Diagnostics: 1; CY4PR0701MB3666; 3:5l+gBAsrIPeWZn7l/g6Q9CJBZ5n5+uYTFYFsJqgSBr0y+l5R23oYBn2cx4h7BnzxMdWzJ2Iri2sAP3+XTzG7UczURuEcM1aO3JIvCWOgIZKGOZ+ylPfncfSFOln6WaKGs0AYWrYhu5fgGvZD5FOJ5hj7qk0UmP7ehLbVZrhgFDcBPFkroszGFvj6t3IiuiVelu3KdAiz6SDG8YbxydbzqqTx5sUCoYm1ZPiA6PhJUyPYRCcbKCwwk1ZkNe5RbeDq; 25:YE7XVJnhX/hMyemkUFP63XUPwXCmYeBuxEzA/LK+tQ1cGPwv05eutRT3+csdcTVoW+U/W+MbmKkZ4iETc1DVszpDDoGmf+TXxVjji7zJoezTmzdtHJ51VEnByZOCSUaszUSelpPD5A37ccJwLlgy+gqlhm5DYdMN7nxgCaf5j2SJWm3eS+dzImubl/QQvcRhGbTPjL807jKrNaUs4KaewZvQGixhMTw2MwNVcuBacdT7K3dJltqLkUtAfxH/8AsMsOiHWQUgTo6FhQTOKSGefWoK8+3GNjvQYtSv/fjco/jThdmsqQm7oQyMsHeUdml8X9cSUcx2fu7Ae0Ebt27grQ==; 31:KGLJkj9ou+A5Syq0SDcA7k5opYS5DsgAx37Qarr/1L3ndxdVAilatXjslP62RdLZV3LixJW9iAilpsYyHHcwLo/b/aA5tiTNSiwZlbHK5f+dNRUt4s4xRu5yv/NFws99X7IC6eZcYj5ghGtwUZQTecqnX28eQk4/47/BgwdmssSLQWP2Wq8A58KiOzA5zWzP9o5z/cI+NAuIEbzGX3Q4BYymRqkYTgsWQturuus5g7k= X-MS-TrafficTypeDiagnostic: CY4PR0701MB3666: X-Microsoft-Exchange-Diagnostics: 1; CY4PR0701MB3666; 20:qCaN3Bulm/AQ7f/MQuSZ+69dA1aflE/3ym4hvk3gqemaC797Z4yAMdtnVEwQxwZyE1m/1dcORE4fgtg+U9Sg2Jbm7WWAw2G4UuNCr9rD3wDFHcw6N6NGXmscBpL4g7m5mT2qVTEYBIMlBp7g8qzSBNMESLfdPW9Ycx1iaW4lWEhfyQmqEkq9pH0Rjp6wQtiguzgpspduzLATyX0WZpQ0VZLjMrgxmYpsK2gBRkNJaqfmHkYyot38TAbVZQiZ0p5UDIf2BcBCdEiGDb7bddXf9j1s8WT5xzWSko+mOTSCmlOV82dxsIH2wuvTf1F7GwNjZfJVKoiI4lxU3HCRULywQgs0l661C0c1+V2l/QobPZjGFQdKye0fsZ5aexl0zaf1XX1gkjmwWzWZ+pqHN7OajAv9LXBLRAdO4yzhwTDwf9PSsFUYkQTPsDkriipZKpoHyqGG2iTCpDFAhcCxMystpwbeY+H47VqKDYUC/N1bVg5y7q59SAlK4IfAF2FwabOr; 4:kHhgJQq16Wh0VuweLnIIxnzybs3fL6JkY7hzh+7aJ+QJjZr39PNQIJKGeyfmB6chJcBND413wQzqomMQaTHVASrL5xSCid4gQ8jzcY1tfSBEaZLW+XunEtIBm4hmp8HMCU0W+p374xp22CU9pnyxY5mVLrQUlFaoD1hGX8MFdchIymIO7dIy4WcAL3hK4vrifKUGq6TXxEAISkA2Ryl5YgGErEl+tnFYauXSlLX/ewXuYWM/Y9Ln1DOyhfVQ6cuIL8OSc06wVKxjSZYuayeTew== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040501)(2401047)(8121501046)(5005006)(3002001)(3231220)(944501161)(52105095)(10201501046)(93006095)(93001095)(6041288)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(6072148)(201708071742011); SRVR:CY4PR0701MB3666; BCL:0; PCL:0; RULEID:; SRVR:CY4PR0701MB3666; X-Forefront-PRVS: 05954A7C45 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39850400004)(346002)(366004)(396003)(376002)(39380400002)(189003)(199004)(316002)(36756003)(86362001)(16586007)(575784001)(2950100002)(6666003)(6916009)(2906002)(72206003)(4720700003)(478600001)(97736004)(7736002)(6116002)(3846002)(386003)(59450400001)(26005)(16526019)(186003)(305945005)(5660300001)(81156014)(81166006)(25786009)(50226002)(8936002)(4326008)(8676002)(21086003)(55016002)(68736007)(107886003)(53936002)(105586002)(2351001)(106356001)(2361001)(69596002)(51416003)(47776003)(66066001)(7696005)(52116002)(50466002)(48376002)(76176011); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR0701MB3666; H:cavium.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR0701MB3666; 23:6LMgNW5jy7o4X1C5wDw8lZgx6Vu2dnfybeBLfPU?= =?us-ascii?Q?4leVikbo23SfreA2AHk4p1Jg72CZyMrFSvKajuzfj4ADn9qAxWLuJI+Ug+x3?= =?us-ascii?Q?k1k3g/EDfYE3lnhq3kVSZnAoA/zw62lgscUOPrDuHbrDB5EOleL+qeSdttuz?= =?us-ascii?Q?V4Lx4JCw3mVRdl+I+mM/q8beZVrm+NAteG5UVBcCY4jRCuyBzG5jRR8LDsgI?= =?us-ascii?Q?L+luRcJxq3mIlbMvYxELfH7Xb9B589+Yg75h4hDGMwwCzuv+wMS0XXHKN75G?= =?us-ascii?Q?0fTHJWPcUPE04jO1fDZegGlk5047Izov9I8b90m8mPFJOdHr2KczM6mAjsed?= =?us-ascii?Q?Cy9lF6IhaiZVjuQB6WsMMCz5XpQ7rDYbdW3cFoBp25+ma4dPIapxjzr1RI3h?= =?us-ascii?Q?6CVHLQ0f6OQ05PCAqgIBhFF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p1mY?= =?us-ascii?Q?D0w=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR0701MB3666; 6:ygMhwQOZyf+KXGAbchQqT9uVCKBJEhJuwlNqPziwaF6Bjg4Pyv3S0UCnRryQzFAFXlXJCSSzKpoJ7f3W+JxRK56RIBut3dMl9mCcxcYzWaPcb8+H8iQTq86rh2F3j9ARDlUeKiLCCe/YTG38I7PonUsgV3jdaL+JeNyjWSNFlcaJKIriwuri+OlPraagF0yyRuCaLujuRQslTwcAP/XgdiwGAYYP2igiOWPic9+BclOOSvAkyej6j3fuY453Q971vRYXj2b/CgDAE3VdZROLI6wPVM58wUhLq0o4dZ+ubMTSxx7D2fQd+vrGTVfn502dZCZD6EuDSm+BIPfxZ4VQRdrepPtNpWP2Mspj2L+a50o=; 5:pTOilZeBe0/WTLaIB32+UPZ8vSVBer0QMGXboEauXZXBjY8WyqzcUHhCqFBwT2FDkgShBgOptTvlpqDuxV1dxVoSSHm27j+rMyG/kpX9ZVE1vxAkJbUryCjTFMxdbSRBKEWj/Nv8vVziDnHsDaHsHjfvQ2VPrlCYWB9ef79cGpw=; 24:lzwO3EOCl7dGmUWppaNXXeKNJUx6EJJiDYUY+a3/8YIyx43S6s1JaCtTCoRlESrBuKG4vQE1JcPptRW1rRiporwwRs7dQ78RySnQbkJbP1E=; 7:LDL01SNIVDLdPpaZ7PJkhoJD6WwC/pJQB99MCNs3L3SyqQ+rlbUxovk2eVfQyLKUYhUZPnJW2E9EuMJpklDtEEXSCYwi7BDR4YDtiL5lYQRanOVgy2EDz+j082OoD4uUfL7U72fIbU0Bu6KvOjjLBRwOrBgLGt4YfJthVteDEp+YZ0g0dQ6/cTEdSKTFUEG+B9rRlyczMtA4c0jzkQ82cIxtodvRf/c0GbJKoefBd8HufQ/x0eF/FZgQKkO67IBf SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Feb 2018 05:16:58.3506 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 133c22e2-3cec-45f0-bd0e-08d57cd828fc X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR0701MB3666 Subject: [dpdk-stable] [PATCH 2/2] net/qede: fix clearing of queue stats X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Feb 2018 05:16:59 -0000 [ backported from upstream commit ce26be6ed48922cbc0b1d64c622d3dd5413c96bf ] Add support to clear the per queue statistics thereby clearing xstats counters. Fixes: 7634c5f91569 ("net/qede: add queue statistics") Signed-off-by: Rasesh Mody --- drivers/net/qede/qede_ethdev.c | 63 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c index d1b89ea..5275ef9 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -282,6 +282,67 @@ static void qede_set_ucast_cmn_params(struct ecore_filter_ucast *ucast) return 0; } +static void qede_reset_queue_stats(struct qede_dev *qdev, bool xstats) +{ +#ifdef RTE_LIBRTE_QEDE_DEBUG_DRIVER + struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); +#endif + unsigned int i = 0, j = 0, qid; + unsigned int rxq_stat_cntrs, txq_stat_cntrs; + struct qede_tx_queue *txq; + + DP_VERBOSE(edev, ECORE_MSG_DEBUG, "Clearing queue stats\n"); + + rxq_stat_cntrs = RTE_MIN(QEDE_RSS_COUNT(qdev), + RTE_ETHDEV_QUEUE_STAT_CNTRS); + txq_stat_cntrs = RTE_MIN(QEDE_TSS_COUNT(qdev), + RTE_ETHDEV_QUEUE_STAT_CNTRS); + + for (qid = 0; qid < QEDE_QUEUE_CNT(qdev); qid++) { + if (qdev->fp_array[qid].type & QEDE_FASTPATH_RX) { + OSAL_MEMSET(((char *)(qdev->fp_array[qid].rxq)) + + offsetof(struct qede_rx_queue, rcv_pkts), 0, + sizeof(uint64_t)); + OSAL_MEMSET(((char *)(qdev->fp_array[qid].rxq)) + + offsetof(struct qede_rx_queue, rx_hw_errors), 0, + sizeof(uint64_t)); + OSAL_MEMSET(((char *)(qdev->fp_array[qid].rxq)) + + offsetof(struct qede_rx_queue, rx_alloc_errors), 0, + sizeof(uint64_t)); + + if (xstats) + for (j = 0; + j < RTE_DIM(qede_rxq_xstats_strings); j++) + OSAL_MEMSET((((char *) + (qdev->fp_array[qid].rxq)) + + qede_rxq_xstats_strings[j].offset), + 0, + sizeof(uint64_t)); + + i++; + if (i == rxq_stat_cntrs) + break; + } + } + + i = 0; + + for (qid = 0; qid < QEDE_QUEUE_CNT(qdev); qid++) { + if (qdev->fp_array[qid].type & QEDE_FASTPATH_TX) { + txq = qdev->fp_array[(qid)].txqs[0]; + + OSAL_MEMSET((uint64_t *)(uintptr_t) + (((uint64_t)(uintptr_t)(txq)) + + offsetof(struct qede_tx_queue, xmit_pkts)), 0, + sizeof(uint64_t)); + + i++; + if (i == txq_stat_cntrs) + break; + } + } +} + static int qede_mcast_filter(struct rte_eth_dev *eth_dev, struct ecore_filter_ucast *mcast, bool add) @@ -1130,6 +1191,7 @@ static void qede_dev_close(struct rte_eth_dev *eth_dev) struct ecore_dev *edev = &qdev->edev; ecore_reset_vport_stats(edev); + qede_reset_queue_stats(qdev, true); } int qede_dev_set_link_state(struct rte_eth_dev *eth_dev, bool link_up) @@ -1165,6 +1227,7 @@ static void qede_reset_stats(struct rte_eth_dev *eth_dev) struct ecore_dev *edev = &qdev->edev; ecore_reset_vport_stats(edev); + qede_reset_queue_stats(qdev, false); } static void qede_allmulticast_enable(struct rte_eth_dev *eth_dev) -- 1.7.10.3