From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0044.outbound.protection.outlook.com [104.47.2.44]) by dpdk.org (Postfix) with ESMTP id 470AC7D52; Wed, 23 Aug 2017 09:34:08 +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=tiOlnJz4HSgvlf4F3gZIg5K5RvNtp25RmVi1iXD/J00=; b=kPYPWmetdvfCouYchrA/9qE67eCvqlsUULm3QRgZUif14USGv3vqSfwHhlpCEvvRRppeS2lAZsjRTFvuUW00G2MAsP0BTX2oWt9R6YpgoF4i05fix0IJp4G67ZaLg6NwtzFVwmF7xkfyxE89xxFm/3xd/CgsJy+a9EKwqR2Hel0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; Received: from mellanox.com (82.166.227.17) by HE1PR05MB3145.eurprd05.prod.outlook.com (2603:10a6:7:36::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1362.18; Wed, 23 Aug 2017 07:34:06 +0000 From: Shahaf Shuler To: nelio.laranjeiro@6wind.com, adrien.mazarguil@6wind.com Cc: dev@dpdk.org, yskoh@mellanox.com, stable@dpdk.org Date: Wed, 23 Aug 2017 10:33:57 +0300 Message-Id: <20170823073358.116786-1-shahafs@mellanox.com> X-Mailer: git-send-email 2.12.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [82.166.227.17] X-ClientProxiedBy: HE1PR05CA0158.eurprd05.prod.outlook.com (2603:10a6:7:28::45) To HE1PR05MB3145.eurprd05.prod.outlook.com (2603:10a6:7:36::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5f7dfa1d-9d17-43be-4c1f-08d4e9f95645 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(48565401081)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:HE1PR05MB3145; X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3145; 3:4qcTGq79lua1OzEp+VoStKHj8xwmEVrm0okSZYkJpJUz0+/nnU8Iwb8gGbuY6PQiHDoJMPt8UihwpRIbmTSB2ALLy+JH0Xz8qHPlciyXMC0iFUSVGIncg+PRcn9iB/JWSXOp94KD6/usZX7gaJXyQKeTwKTOpTGpN9EyZjgNlTS0pLsSMk3lfiuDLE/hKQQX/2i7KP3xe+Kr+8tAkOxsniadgDpOptdiRnE3QmpmSXxKP+GbsVJcA7JeyR73c1Qf; 25:jnY1In/7XLU43bYsuCA00PfV1F7vc9DRmeVkzDMqzhSHlKiKpT8cqWuUPkG8DJJllKzfTdojORiXmlpWwZoTzmJRUKDld6c7YY1A6yZoZBmBDlhZ7+r4taBzsjKELvrPXgxjVu+8Jqiq03ANm2nwJq0oARcTbZMzo+oi8ka1eoGbpEecU1HkPIWBAyPH/WZXEEj1/3ILCtHmr2chKis59tIwPjC6zrcoz17AyiXKc9+KwRQ5HsuCo5+qRfpr/nxb/vz+tcZtkowqSgack9G/wIKW2+hfaLHAnYiVEz2vKozJA4h5hwTscwz+Hj9F8HgNv/EZdAUUsFXmo2ri/3uMYA==; 31:cmvrfsN2Fv6zswungLVkBkAwNlP4RZkp/GKnJjA47pp4VJy0GoAhyQUln6cd4VV1Y0O3bjvuQdvBUzfTzNvwJO4Ga6eyv4C195IqZjhWq2TbWMf8iv3RjpNeZ7nkONVLzgyTA4vJT+L3f3QMrSwiY3ug3eJLrf307obeHJ31GU9OC+ZVwCZaW47UkvrZochHpEyLAi+6Oj9gKu4p9iIn+YpHpTqAJwwsXg2WwkDU3OA= X-MS-TrafficTypeDiagnostic: HE1PR05MB3145: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3145; 20:pbkuaSGnw+OrLU3pyHq/nN5nYQYfnzMlm80LIebOfNbDPzmq1HVbKT7/YLN+gMXmncR0+Ho3DuS+8N6NfRWVCGVqQK1/WRkVbiVgtdHVxbRw66u8fVRBZxtDRvNUq3x4OpIe5d+uPK1TFy63+S0C0p/niZ77kdk1lQEgr9v/OgPfEZ++hWlHq6/scRU4STbxxYTh+BnE/dq5qzaKOCrcboRrY91sZGyFXbO9++cv+QDdS4Gb4gD9wbnEUh7WKOTIF3S5hjuHcRjw77z/9aLK6DGcNLfINHESmcytkgqfwLw2gwO3Rt2nFeYoXXjFZcb0kM/crsrSnsCd+8OKBym9mAXudSvBp5ezngKrMg2GjSzfoMB5YdY44dgYLerDBrWd1I6rj3Ahfojwji7P+7SNsonfLLOJ9ceL+8vI5oC9j2z2nH9c7LGNsYt+zP/i6hEpiC7gf1WWMqYgs4b16k/IL2gybWlLHoymrPdlgjU32vhG5cO78lvT/IJDxrkxzLug; 4:JKNVAtS/TRNBGCjmhVjbDWFUZsteHcO0lo/ZPRdaqF/ly8XcaYbW3i9Vxer1+2BTpUuFIsedUeKPEP9BUmm+jFHqERSkJiOYYO5BvC6o3Sca9eHW0O2913ez3ViLNmQ9XtsWT8wVkhNOjrKMqUQS4QBs6tGSNIP+KULGqwAzmTr+m2r2U75l1f1rJgj/i5uTABVagtYA6yHS1jXNxw9xBP2bhZPErwh7p1SH+dgy7CZoNEPVh4HGYlxpsrV0lAb+ 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)(601004)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041248)(20161123564025)(20161123558100)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR05MB3145; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR05MB3145; X-Forefront-PRVS: 040866B734 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6009001)(199003)(189002)(7736002)(21086003)(6666003)(7350300001)(42186005)(47776003)(33026002)(6306002)(4326008)(55016002)(33646002)(97736004)(53936002)(305945005)(1076002)(86362001)(3846002)(6116002)(68736007)(8676002)(50986999)(48376002)(25786009)(5003940100001)(53376002)(81166006)(110136004)(69596002)(5660300001)(50466002)(478600001)(36756003)(189998001)(101416001)(50226002)(66066001)(105586002)(966005)(2906002)(81156014)(106356001); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR05MB3145; 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; HE1PR05MB3145; 23:KklfU5pxLBlGyL5SrFcY/ausyNSZpNfXWzslLWbNX?= =?us-ascii?Q?vw6RmLM5S3aq86XMQgr2LZ56QqvJ/VuHE/D9eiV2NFISXjVTEvCzXTljrVQc?= =?us-ascii?Q?/DGgT7yQJk/LR7Z0CYTteTxuMXIlWHIuiwsr4Nrssn4Gpf7yn09NtL1OY0mI?= =?us-ascii?Q?91KcX12+lduPe+FVnm3YywajjCndbhCF4y7RfxLzqlCUelTbpBl2H0ugluxd?= =?us-ascii?Q?poa8o/0n98bQXJk5nLiAFlqfwfSs2PK8QQ26ynvRCPs90TW5/UsJdsFau9IG?= =?us-ascii?Q?R76su7Zu9bLpNFdTIJLwTbbJ+C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K7vCSdG0qtTQOXmA5HMgY9oV5lqTpPqX1yfYPU5LikNOXeAOvrpAE/sL+a+JenrrpLe9r5BRg/XFMSw8EWsAJ/mkuJCE0j+vbFVsS2OzunIquJwzEcXmWVILeKQj8O/evS72PnrIO13AvO0qp0o9KTJlq3n6Dp8NWHdw1m7G3Otrv93es38jLKOKGe1PRYlPfVEnfJxE2l9wSYSSxjHwGVICIIFTjiCYd3EM8sfQuaF1ijzBJzDQo7Ud+C2pe0E7pxrxYhMAB7JN7eFkVWUFagbzc5AU2rVTdBmE6NQXRGlNdXqDQ14IPLV9/pj9UOFOL/4DD59Q==; 5:b7wjanZbFbNDlHcHBFlE5NFV6HWGxwzrDMlPEzVfsFdJ2AbfgRqq9dBLsXpTSMKA/1iLir7XU+oQMVTvuskgQp2J6AN7PzOGWEj1tB1K1XCappU+xGy6mG1vQ57fhCFdxH+2sk9KiVCgZyb22XvtiQ==; 24:TdVfadA75VDFC/VmlPRcETHDY8URBtSrfpUpKNaHyGWmTvviujz0NcUGLeHTc9hWTVm72iWi7wOEYYndFgpVzy9OMJV2DSbhDuiQep5AEpw=; 7:Zl+CYf0fKP4lL1MJuPaXX7Bxk8JVrwyth3yOjnf5xSeKFxnvbUlZ+BpWJpR84qDC5HaYikGR4gqb6b075OREmpW/Smzq/52ZTogjR6DAqS9df64cAhZrIgAmHUK0a/dGByD2MqeKjtRTKGzuswSg4m3JMJ5oPvYIRcq1TerXp1ntT7y/ugRhIossrf5b7jPD642ukjyYjbz48O0PU08WZa49dotHMFdfiUMAW2ivpVg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2017 07:34:06.1155 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB3145 Subject: [dpdk-dev] [PATCH 1/2] net/mlx5: fix num seg assumption on vPMD 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: Wed, 23 Aug 2017 07:34:08 -0000 vPMD Tx function assumes that after the scatter of the multi-segment packets the next packet will be a single segment packet. This is not current as the function can return due to lack of resources without sending all of the multi-segment mbufs sequence. Fixes: 6cb559d67b83 ("net/mlx5: add vectorized Rx/Tx burst for x86") Cc: stable@dpdk.org Signed-off-by: Shahaf Shuler --- This patch should be applied only after the series: http://dpdk.org/dev/patchwork/patch/27367/ --- drivers/net/mlx5/mlx5_rxtx_vec_sse.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_sse.c b/drivers/net/mlx5/mlx5_rxtx_vec_sse.c index 8560f745a..30727e6dd 100644 --- a/drivers/net/mlx5/mlx5_rxtx_vec_sse.c +++ b/drivers/net/mlx5/mlx5_rxtx_vec_sse.c @@ -119,8 +119,7 @@ txq_wr_dseg_v(struct txq *txq, __m128i *dseg, } /** - * Count the number of continuous single segment packets. The first packet must - * be a single segment packet. + * Count the number of continuous single segment packets. * * @param pkts * Pointer to array of packets. @@ -137,7 +136,8 @@ txq_check_multiseg(struct rte_mbuf **pkts, uint16_t pkts_n) if (!pkts_n) return 0; - assert(NB_SEGS(pkts[0]) == 1); + if (NB_SEGS(pkts[0]) > 1) + return 0; /* Count the number of continuous single segment packets. */ for (pos = 1; pos < pkts_n; ++pos) if (NB_SEGS(pkts[pos]) > 1) @@ -502,6 +502,8 @@ mlx5_tx_burst_vec(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) n = RTE_MIN((uint16_t)(pkts_n - nb_tx), MLX5_VPMD_TX_MAX_BURST); if (!(txq->flags & ETH_TXQ_FLAGS_NOMULTSEGS)) n = txq_check_multiseg(&pkts[nb_tx], n); + if (!n) + break; if (!(txq->flags & ETH_TXQ_FLAGS_NOOFFLOADS)) n = txq_calc_offload(txq, &pkts[nb_tx], n, &cs_flags); ret = txq_burst_v(txq, &pkts[nb_tx], n, cs_flags); -- 2.12.0