From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0079.outbound.protection.outlook.com [104.47.0.79]) by dpdk.org (Postfix) with ESMTP id 0C5A0199B3; Thu, 14 Sep 2017 12:50:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=rhSnu3c+I31FY8dMdCYeQ58x4h9mhtIvraOl6JPWIWk=; b=RWKgF+KHaY/Z0h/Wd03U/gIuRZDNfzyev6TlwkrEgKWQ6yrMyUWD7YOLveRSSeO3wzjlURG821X9fjh2TMzanGz7dFmwwdE2MepZKAgyy9PNUYzr+ItboztSJhu+lBQqpfJ4CdelQ4xI490DJq2HtFrfYzSDS1RK+YxcJxLjXJU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; Received: from mellanox.com (82.166.227.17) by AM4PR05MB3137.eurprd05.prod.outlook.com (2603:10a6:205:3::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12; Thu, 14 Sep 2017 10:50:47 +0000 From: Shahaf Shuler To: nelio.laranjeiro@6wind.com, yskoh@mellanox.com, adrien.mazarguil@6wind.com Cc: dev@dpdk.org, stable@dpdk.org Date: Thu, 14 Sep 2017 13:50:38 +0300 Message-Id: <7ad64b46dcc52a1a8f7660677294b6f5b5e0546d.1505385989.git.shahafs@mellanox.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [82.166.227.17] X-ClientProxiedBy: VI1PR0101CA0057.eurprd01.prod.exchangelabs.com (2603:10a6:800:1f::25) To AM4PR05MB3137.eurprd05.prod.outlook.com (2603:10a6:205:3::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fbd3f2b3-f3f9-4124-0469-08d4fb5e75b1 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:AM4PR05MB3137; X-Microsoft-Exchange-Diagnostics: 1; AM4PR05MB3137; 3:Obo+TWckA9OyLBALA8V2RreLW5FGlO5xwPvNpjOuqtSseyDHMQlHXi39f1bNN+xRYBN/Lo36d+DsvgFF8Ayn0g59GDCSNgbzzl6PAPiAW9a32wc4TDb9xt9CHg/yJs+y3Q8jYDd0yshdtE8VPMF/2BoKnxJ3wyCnlqf4TgoQ2NzL5HDDyjZZdPrXs3Qp9KM7DkjU4OR1ItN2vXN6xAZkW350gw43Op+lLp/B1HZL/pIeIJRedkVGcE0TmmxMlP+2; 25:HaqQa3dWXGWcN8Hqu5Xl+X7WX69MERL+KjR0vo9JaAs1ihokoepigvlPY9oX/ngTLSqUwPqituhoBiDG9VWyW0azdiEcoga61EPiaq9uofMxstdA84Y6ZF5hqxT7LaDklmJZCPSas78nBqahV9BY1mW6KQeDT2X3WNav030zdl3/VY/NgiX9YzWGBvRpVrxtkoCucGtQTfgrjlpSYLYwTDjXRO8oLVDYjdoZBsTU5aIRQjG0q85yYbRyCGrSNaOurIsIDOVmOVokLgTNI/dd51N8Dam+mi7jZyUbJquc0V6mRn6eVDuvW3lV8vT2a+ekq9MHCRjzl1WVISiuJDHGqQ==; 31:gjKjMSfJUULtUyKRVv44JRpDm9Ay+j6O6AOKeghHxSKElBzQs5gGCzNn0uWvG36S0vQcMph6YAKaD7ma2OutXfy5lP81qCRRk/4iQ89+SfDIJU0Tb4UlSes74BggVixosQQuv3orqRWu8GRsSVzmoDSy8m3PAGYgrKUto31E/rA+AUNzBOTfBNmIzNEfvazno0d+XmeTz1GkgRbRofN/yk6HZOo4P6MgceJ2Z2iR5hk= X-MS-TrafficTypeDiagnostic: AM4PR05MB3137: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM4PR05MB3137; 20:0A5zLeHxQts9Wj3bIC2xrBKdq3DEbHT/A9glU0fGruZykNDsdrcMvJdEJqonIZJIaMCRE819H48Z3IWQ+lWvCEch6BU4lIzzTwGWEAD0/BhnQhAn8yhvGCwnCPGOWB/pSeUr1aeiFjcgvE7CSGnguQkgdNfpT8Mit+irirKveKcFD5uovCqoCnr4Lz6HKrRQntmxJ4DFRETuyJRRqxnbBhsEvEg338CBqwFbZ2qm78FLbyxcHl2Dq7rTUBUCKH96YQ8mCwi/7OnA8pPX+MBujRMYYIAjrf5yTQL0bXY/DoSO5lDYqfC4lBwOVwCgVONr+Hpo9hAS9SnjKUfgB40PDVxIKkRQaYmtYohEyZjLT76ZVZv+Vrouui9EZJRpP4StNMPR9rofqgC+YHVOaVivA5xmqIumDo32D4pQQjW471fCnJQjCLhOl4EHvgDA6TIfLqL+XZf+IHrMIndtrc3tRKuJXmFydDi2KhArGKPI3fqsOOLQNOe3jIu6PlP9ThoJ; 4:HpcWPNJdHGSKfwjCa54UqKLq6ypj0hUGcSgSpnxuZoDHHS1mJd94vJaDkAkrwWCRGhaa4UfQYp32WD6ObkZmcDpBouLbDXbATfmThjfWn8FXvZdECCyCq7168Ewek0vEe3rEhzC+FafW4peax6pKpYbxGYWc+w/AoW2Uf/ZXMJttryTLxhzgdlOCI5nEdHPYd8y1mniRFRn/JMfpezj/uW3LkBHJrahfmjD3s0wbCZJrSljFy4iDKRoMQJybW4My X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(100000703101)(100105400095)(6055026)(6041248)(20161123564025)(20161123555025)(20161123560025)(20161123558100)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM4PR05MB3137; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM4PR05MB3137; X-Forefront-PRVS: 0430FA5CB7 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6009001)(346002)(376002)(189002)(199003)(50986999)(50226002)(105586002)(478600001)(50466002)(8676002)(48376002)(86362001)(110136004)(2906002)(4326008)(106356001)(53936002)(7350300001)(6666003)(81156014)(101416001)(97736004)(69596002)(16586007)(76176999)(81166006)(36756003)(33026002)(7736002)(5003940100001)(68736007)(189998001)(47776003)(6116002)(55016002)(5660300001)(66066001)(25786009)(33646002)(118296001)(316002)(3846002)(21086003)(2950100002)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3137; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM4PR05MB3137; 23:VV3oZphP9tjHSIeRX7+Yuau0MSlQZc2UNmx2Uyxrm?= =?us-ascii?Q?O9bMtRodE8/Po820dhSrbk1sIjzQfAxMKOXOkby2YLJl1as/5kxT1SUZzE9I?= =?us-ascii?Q?ats+tHM+5fJaO59hAd3/tw7g4MBKBYcGJZn22LvgEE+opB2nnvZm18FJaTCK?= =?us-ascii?Q?Xj+LPrTzG/lbyEKlGT2CPteXpehqVFlkBD6866ijgSDxHcAqe1HSGGeYxSpW?= =?us-ascii?Q?hH6KkbFcuWKbaSrpbfhJT0h37fsihrKcxE8QpySkL5nsAnjLhuT+VZgC+ROu?= =?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KQP1OdnFFpoJQg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; AM4PR05MB3137; 6:dyq8283yxZSFg3n6l3rtZFAZWV/etB+tnAJXQazOf/BKuSpwEq03lZ41YR29FxvLRgrxFod5T8nAAWHUj6ZWXOgxTz64sNG2OETcmaUDP9t94DG0/rGokwmLrwsFL2RpPd2eaG49//i3fBGy6JGDggmuHyRgo+7f2347aFEVwvs2cAhLuSU1QzM+RSMbeg+U0OUmse1KMl5JarCFVCvXuQgY3QhSoFLKy0CsKtn/CJqjAp76ikR/DgxUYt3S8ZunBEaSSOEr+qHYLKSNC86aPr2dgNyts0FEkaICrCKHzWwwejG+IlFHZWRU4vquEeuGC2Rgtj3hqVopvIxG0lyG4g==; 5:2/ZHVEBLB2Ajcx0hb1gOh/WumBYF1vVdl0M4ew0mIwx8v8qaBdP/+61Tp5dbS/AGq47RlzjTPMdscqTZ4OjfY5wYM1aBlPyZZvM9kv2OT2j4nEUJgqnMPkla0b8wf9vtYT6ijt/nVIHd9yPYOzGXUA==; 24:VEB5+wLPzhc+g/UQ0Ln8kIzIjYTAGoMoL/TyWaXCy5ecJJieyxoYFYEOTontmBjyIrm2mIst+K+RBBcbo6RGxPLOhz0BE0NZ2bi8/G+XdMw=; 7:2HqiDNNBaxW8P63ve8ipOjMf30eK8qEXPPAe8RgfiyqGAXKLCpWgEJnf5Bf6MIg8k3lOmmEN6eGrkQoo0h9PeqbmMZgKQuPfY2l8QnVI8P5SPmM8afml8SHOp0IKMV+oX7qoSM6k2bdcKnv6Gq5sSCDQsXXZLBGU269JMy/1E93ClcqvwNTNiAUDm74D4D9TqTvoMMs4cwWfupul7TG7kYfgsZF+l5ZbD1Ed9JG49N8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2017 10:50:47.7990 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3137 Subject: [dpdk-stable] [PATCH v5 3/4] net/mlx5: fix Tx stats error counter logic 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: Thu, 14 Sep 2017 10:50:50 -0000 Tx error counter lacks the logic of incrementation, making it useless for applications. Fixes: 87011737b715 ("mlx5: add software counters") Cc: stable@dpdk.org Cc: adrien.mazarguil@6wind.com Signed-off-by: Shahaf Shuler Acked-by: Yongseok Koh Acked-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5_rxtx.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index fe9e7eac0..7567f2329 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -406,8 +406,10 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) #ifdef MLX5_PMD_SOFT_COUNTERS total_length = length; #endif - if (length < (MLX5_WQE_DWORD_SIZE + 2)) + if (length < (MLX5_WQE_DWORD_SIZE + 2)) { + txq->stats.oerrors++; break; + } /* Update element. */ (*txq->elts)[elts_head & elts_m] = buf; /* Prefetch next buffer data. */ @@ -481,8 +483,10 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) cs_flags |= MLX5_ETH_WQE_L4_CSUM; } if (unlikely(tso_header_sz > - MLX5_MAX_TSO_HEADER)) + MLX5_MAX_TSO_HEADER)) { + txq->stats.oerrors++; break; + } copy_b = tso_header_sz - pkt_inline_sz; /* First seg must contain all headers. */ assert(copy_b <= length); @@ -843,8 +847,10 @@ mlx5_tx_burst_mpw(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) if (max_elts < segs_n) break; /* Do not bother with large packets MPW cannot handle. */ - if (segs_n > MLX5_MPW_DSEG_MAX) + if (segs_n > MLX5_MPW_DSEG_MAX) { + txq->stats.oerrors++; break; + } max_elts -= segs_n; --pkts_n; /* Should we enable HW CKSUM offload */ @@ -1064,8 +1070,10 @@ mlx5_tx_burst_mpw_inline(void *dpdk_txq, struct rte_mbuf **pkts, if (max_elts < segs_n) break; /* Do not bother with large packets MPW cannot handle. */ - if (segs_n > MLX5_MPW_DSEG_MAX) + if (segs_n > MLX5_MPW_DSEG_MAX) { + txq->stats.oerrors++; break; + } max_elts -= segs_n; --pkts_n; /* @@ -1353,8 +1361,10 @@ mlx5_tx_burst_empw(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) if (max_elts - j < segs_n) break; /* Do not bother with large packets MPW cannot handle. */ - if (segs_n > MLX5_MPW_DSEG_MAX) + if (segs_n > MLX5_MPW_DSEG_MAX) { + txq->stats.oerrors++; break; + } /* Should we enable HW CKSUM offload. */ if (buf->ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_TCP_CKSUM | PKT_TX_UDP_CKSUM)) -- 2.12.0