From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00066.outbound.protection.outlook.com [40.107.0.66]) by dpdk.org (Postfix) with ESMTP id 0F30E199B4; Wed, 13 Sep 2017 12:50:50 +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=2UIn0FmyZO6vZPypL8FVoxzWa4gyCKy6GTamOSJ+nqw=; b=evEmLYt0a1WmQdmOnQy811xF5JyANRNWaibBFBO+obWapwBwwVyYFZr4ujOEVIpU0gLyRNI2+zmq15KZTeH91aN5bDwafZ5ZGrjyZ4COLwEDb8mDMXKEfdbaVhjICrF5sKFtkbeq6JOY1uURzCJh05fvAx9nqwqb90157p9seLM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; Received: from mellanox.com (82.166.227.17) by VI1PR05MB3151.eurprd05.prod.outlook.com (2603:10a6:802:1b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12; Wed, 13 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: Wed, 13 Sep 2017 13:50:38 +0300 Message-Id: <05958f0c9e0a99a2ac56152a36cf15237f4d125c.1505299539.git.shahafs@mellanox.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <7b6d42c0c5e1a04f8483b6546ea0b1db8fb7ceee.1505133966.git.shahafs@mellanox.com> References: <7b6d42c0c5e1a04f8483b6546ea0b1db8fb7ceee.1505133966.git.shahafs@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [82.166.227.17] X-ClientProxiedBy: HE1PR0401CA0079.eurprd04.prod.outlook.com (2603:10a6:3:19::47) To VI1PR05MB3151.eurprd05.prod.outlook.com (2603:10a6:802:1b::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9f88cfc0-791f-44a5-19a7-08d4fa954b35 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:VI1PR05MB3151; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3151; 3:KUMgTjMiM6pgNnxypwNNLNVRz073liiGtXtJ3bIp+Ij8jxO4phrHOywT8S0Ww4H9nPVrFgXCWc1oXxxXinuxUBRlia0e2Fut5q5D9s+Jcq1cVRw5F6A/ZMByrG8C0YBJReg8vMhdnF+IlwEytXxmjmHay0BEAnSpjM5ArrEGlmIegOT+54N2/5xTh2bBb9mkvDgAGN9tapQ8eGggjgEIu0h0uW9ZQrtqMb7oRXr6pfIoalNMiiWv1rJiYtt282v4; 25:5g5FpDX2rcjbZCfZJBJQjhGWT+FOwlRbMNud9uUiBtlTDJgFEVrLBV7Vt8kbBdMhXZuhYPQOGgblCP1WV1paniHXbuHOXW2W3bJwsl5smyj2EYxYTujd+EHH6qx2YTLLmfjwCuhKPiP/GacMCqcryI0cjVEhNhcNyAru25iilhc+rCysJgIc8DoW/qgV9sqYHSF2/058Cz0lvFuvQZdpaiuz29mlyaKXLoT1HNl3+t/7ylTp5GChOAUhQY3MFqogXTtWgtB7wl37iXgl0NWO/n8H7gL/QO1CRvAFMGREWFfNiXat1NeU6i4cq5VIdYmAt1CRzbx9vb4Zj5dbSnacDg==; 31:ThdWxi0Edazu86aaaMg3C5rsZIez9fITASsUGOtdeSgT1jCBeVgTHVEdRUDVjQJVxJLYDPBv5yRhH7Ld5OihkQwSi9go6n3vi6OzBsD5i2edR/7psN9zOPQ4sTOqB3X08xFod49ATyNRguzqdrV4K70m/Nb9tJfBIJb3NTW8Hsf5DTLGSntS9lWtYM8ypT6cCPLrkQNn9tr45KUqTmlbBztVtKxUzuS9gVxGfXKPm9U= X-MS-TrafficTypeDiagnostic: VI1PR05MB3151: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3151; 20:RRoC38iXAicoTKTVkjGl8YczUzEW2GrHihsuAgTKwavoAPnQ5PKmfxTlKz3lHWdNdj+uk7D4V6/VzaHiguyXmR/YmHp1TTTS6C1F0el8Jc/cgPFznqTtECFwG3RqyeNceHy3VTrbahUCcZ0mtH5po+lcnPYYXqAFy1pqL/qN5E/xyNKJ59cChZthXyfCrFpfe/9wJuL1wwDrlXaqq1a6qEdMNMrBr4OgjBO8WNWj0i7om9tJNE39CmRg4Fj6a+JjPswdzGFYnl+sTyADwWxCdCDFQbbxgLS1HLrmKsVMongSPcRQVs79biaUzT/pZor+6YKmZEImBQdcE7chpBuLY1hITbDvXlJPmpVO+09DRqnltn0qST+KTLLjg87QhpgHVWWV4y1n3g09NeHZpJlL5mAg9aSbajv71amO7fOlJg20wNd2k0bQy5P884zLKnFbbYo6R46QACEtWrBiFwA0f9LfwGAbIVyHgUPcXwNP9dsgPILxkhfu7qZ5Kk6JD+eX; 4:qSdDI5mpUTmoBnwbkiFEs8HBQSdP94aWMIi9y/z3oKA9Ke+xq4PH+yYOIaT7mI+ILTfBO0ZOImKe+KUYML8pkpJg0mvFF/BLPRBbXKeeRVdY2I0Hdm7V+HamTvtJyujkJ0MKxXu+Jfnp7eaZqUfeiyk+NNpq4VFxJkczX4DMZxtDRj+8wIfrxuZeA40R3tdpsx/a3HScT9yTdLjx7bFx3xOX4EPTBWBdjKvjWC/bHWidLtHhQbqy/SdLA6mew5HN 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)(93006095)(93001095)(100000703101)(100105400095)(3002001)(10201501046)(6055026)(6041248)(20161123558100)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123555025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:VI1PR05MB3151; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:VI1PR05MB3151; X-Forefront-PRVS: 042957ACD7 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(7370300001)(4630300001)(6009001)(346002)(39860400002)(376002)(366002)(199003)(189002)(21086003)(105586002)(86362001)(48376002)(50466002)(3846002)(6116002)(7736002)(69596002)(76176999)(50986999)(118296001)(25786009)(66066001)(47776003)(478600001)(106356001)(101416001)(33026002)(55016002)(305945005)(53936002)(2950100002)(4326008)(6666003)(110136004)(5003940100001)(33646002)(50226002)(2906002)(68736007)(5660300001)(81166006)(81156014)(8676002)(189998001)(36756003)(7350300001)(316002)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB3151; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; VI1PR05MB3151; 23:a89kGYZzrjBZ0XbHmoLFkMtd4QvkzAhKuXgfgtIiA?= =?us-ascii?Q?S0fVkmbDT6BpiDbiw8eSz5+kJpEiSTu9j4kwn9OQZR+HeR6pJ5396TWQc89X?= =?us-ascii?Q?VbjKw44AvXN0eACT75sTynxmg0TeJ1GqNaXqU8kOPwSuNUMasfnq+VxLpNwD?= =?us-ascii?Q?cis9JxbWzZ0xN5hm5BMhFtTQBI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osticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2017 10:50:47.5080 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3151 Subject: [dpdk-stable] [PATCH v4 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: Wed, 13 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 --- 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