From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0066.outbound.protection.outlook.com [104.47.1.66]) by dpdk.org (Postfix) with ESMTP id 4DFCC1B693 for ; Fri, 10 Nov 2017 09:27:38 +0100 (CET) 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=TrCDQdPlnuzXOUwm1y3YX7KkeZlQ6RVwkfo5U6+cwko=; b=gNtKtQMXfrXXHCg7zjcTmezMCsrXWRGXFV+bGSnB64kc5RlC6XJ7RdXamUMtJFgTkAHZQ5tAPy5lAxj3f3D8cqtG73zIBl9fMg1TahdPgC029b7fdfwA8txKBMr/LbNxD24+0tXtbNGLCfmB7QGd3wk9U8UcySH7B+9BZU6+5DQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; Received: from mellanox.com (37.142.13.130) by AM0PR0502MB3652.eurprd05.prod.outlook.com (2603:10a6:208:1d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.218.12; Fri, 10 Nov 2017 08:27:35 +0000 From: Matan Azrad To: Adrien Mazarguil Cc: dev@dpdk.org, Ophir Munk , Moti Haimovsky , Thomas Monjalon , Olga Shern Date: Fri, 10 Nov 2017 08:27:18 +0000 Message-Id: <1510302438-29138-1-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: DB6PR0301CA0054.eurprd03.prod.outlook.com (2603:10a6:4:54::22) To AM0PR0502MB3652.eurprd05.prod.outlook.com (2603:10a6:208:1d::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e69cd6f9-d96b-4f6b-0779-08d52814e5c9 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603199); SRVR:AM0PR0502MB3652; X-Microsoft-Exchange-Diagnostics: 1; AM0PR0502MB3652; 3:bprGgMEYOjg5SlIlLaG4RwCVWPRLD416/R/Kcd9YzvsLpQM3piDq55ldfNW4HMOjJSwFt/P1Nc9B98YoCCsT7w+WfwIY8WNjRkqm5odyua3U/tOxO2/+tkEQqu1qLErPsMagcA/5raRx4dCT0h4iPzrn8husoi6ZXoHh3I5Nzkr4RyUQ1KjVVAskNj3Y0rIbACmC7c/hD6FxRwVS31FWqC4V+O3K/H0J4MvwoKRmFTpRRIqO7+qo1QByYptrlCs7; 25:fEaGt2dD4dY0UUfI/jl0AOe1/FreQOZ++eeFMIHfUeX2F5Ixx48CHbTtzqgU3J7DEKCiYmzmO07PW4OS4+B1WQKYK0Fi9VupYyik/UuR/qeW2fEY07+tK8jihepmc25vzNSs8LBt/sIXvaVpf7p1uXrbpT2Z4RyT638h8XZM7XvYVtJvSiou0O9+BjWS7a9pufyhc8UOlrZ4zxHIW69KvwaR2elIAWptiTbONlwlRXanEriTn0Y3o1BGpttBPIicrf7NhYy1erJd2nCb1c3CWr0CLK7pExDqRriiH/Xz/j4lb5jDD12uSJE8iDVa+xHPnaHCraZRHN7lEN02+m0Igg==; 31:Evx0uJBplL7HWecMPCj1ddLayH/bwD4iqVOT3/+zHECmfsY01atBF73/LdL9a1JxA/Dz4YuM+Uh6Ch3i8qTy/o/QXWkaZz91puez93R4AbzwvJnBWofFMWGe4dzZCxZxfAdkjI+fIDdM7Xeft2fwQ9xH8Wg4BRcEmEyQmBAcm1aXdHQAyi3/ndEDD+cyHNowCFFYkercSabCqUT+uMYM/9BnlJZkdluUxbbLjqsoYQg= X-MS-TrafficTypeDiagnostic: AM0PR0502MB3652: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM0PR0502MB3652; 20:qgcS55F40BCM3eJ/XV0tR9aH+pu+YyJFrrkPqH/Xv4VG+fd0pNjhNHW8mBjFPf8gco6PvYvzrz3srmJa6w3wIXp2kwUBlT/bfMD3GgMLAz1z9rXuISWtwWfv/W7i9q3CE+uxvNpZVLPPOjcFwyUmdE0Sz1yDpT8yb3kB17H0RuzL9zCGv4rOUS6yQTvm4zSdVGWdkmbVPye+P3e3ytX8k02a9EGal9LUoq4sJVglVCeafMLwhXBTjNmALkZtLcFLlP9OaRT7jpYwm0+SGo2/4SAho5WZ3Zo3tUJRZtLOYBnUz6lv12JfuiwnLRE8hlWiS1UCAvKWKwhpaUc3jz2S4Bb9iptlkPB1HSMdr100t5/ueTWdzmFVdx0vFR7aRDpKGc1lG7o7rr+7BLnCpJ5VhOl57LQifIsRfzCdKnZsLKBGVu/AkQw6L3Yp8mJC/BFg7C/RHIHQ7GonjsAas9uU3c4st3Eao2b5Nm8RCKMTc2Y3y2ovotc4rGQ8rzdT0NGQ; 4:HpfFRBzsCjqYSxY+VsxJ5jsVwj2Ii6dC5x4Mjxr7HIq4pdFf/Rd50D3ZHPdYjs+WHn0WB1KG3W5WGTJ4i6ldpG98IQAcM6/n5czAwjORZkdG3HBxn647Xf5qKrTAtiECV0NKl4Vx0eT8eKYRXefwI1Cdq75eccku8Nv3uXxitoNA6NQycWYwFvDEPx8sscr/1YLO2YSDQRNMhYwZGy15sQkBOVJ1NaODlO2aEdxwaZe3PBt8wFpxQAffC9GCsKFZjtooa5xQYE2BtwkIYB0iIg== 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)(3002001)(10201501046)(3231021)(100000703101)(100105400095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123558100)(20161123564025)(20161123560025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM0PR0502MB3652; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM0PR0502MB3652; X-Forefront-PRVS: 0487C0DB7E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(39860400002)(376002)(189002)(199003)(33026002)(21086003)(53936002)(106356001)(33646002)(105586002)(8676002)(7736002)(5660300001)(6916009)(69596002)(81156014)(81166006)(305945005)(6666003)(4720700003)(6116002)(4326008)(107886003)(25786009)(8936002)(101416001)(189998001)(3846002)(50466002)(55016002)(48376002)(5003940100001)(316002)(36756003)(16526018)(54906003)(478600001)(97736004)(68736007)(86362001)(50986999)(2906002)(16586007)(47776003)(50226002)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3652; 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; AM0PR0502MB3652; 23:cEhEPKMz2ngjzQKMl9Q7fShPTMJ8k6RTg1E5b7w?= =?us-ascii?Q?D6Fe/85j2lYNTYxL911Al5AYnfEcpPx6igaRnEMEtGcw9d+pepQyyWpXyuEZ?= =?us-ascii?Q?L1W7c8zM/aJNoZBPGN9Q2ognptXeKgMRHZCaacD4QALE7kGjzFzVtvnoxCdA?= =?us-ascii?Q?PfIhzRCqjPX4cZD9jFQcaMG9K03EXUeS9oKdoOhr0wW/4nisK/GEgPnhfLOH?= =?us-ascii?Q?DkQItzEeR1V/OHPnhrJ7MkHrLscEnfkFuZzmzrJA4shvjOUJgLURLgLlPBhv?= =?us-ascii?Q?ZGuDt8MPtA5Pn036+A5sdje6YaPAxBIcNoMTo8kJjjfGF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5PQ0YF++vWP6O+uN1MpjSAWTbieWkSL35KltzomkCKe1JmqqMjDGYBoH4/IecWFXZnAvpCDxXIjtk6bIT7lu6NW1+opfOP9NhnK5mFUh7xdQQXd1Yk2deVMbdvItoZOWvlVzlvLRQtFn4fvvep5xy3zBSZwDUUDEdLoQ3I0M8ulQwGtxHNyO/BnIx827MW+Fgn0raFL7PkInqkJBxX3Pl0MHztFABy0kHM1Y6nKFjRiPwRTqL7aiscC+Ilha4/x3ZThIzIWQ+xaBGay6ncHrHCxXyhsWwW5og+c9QZ51rMruYJ7HK4uxb2NKIr980k5Jk2xA2CK7rQBnkBQoj/XANgRMMlByM=; 5:Ssnbf5wF6mLowXInHeKGntQjEEe54ulhNxG/XalqgN65SvCuLUWT1GjTU8Xdz/cD70ti7XktaY+5aZleVu0XhoeuLgTkileXb5ZnNmlexazlnjKULs6JwFwdORb4AxlfNK6N0qnuKMR2aFHw+e1BajDHTNOnMWCXvMIfrgM+DG0=; 24:HfBhSlB9Sxo1SansgR9xxgNYANE1j5+oHlojI9BAA+2199oiXUZHSprZpNYW/Z8APyHLtzkZN9xImheDUdKmMJyVG/iuNNpRB9tpG9azFDs=; 7:uvKh8G8lYOW69MWbPPbtFeLsfenGo4cU7+OqGtoxdtuQ8T+5EJa+l8voUiJun3YCFDWyGAO3M6liGSYmHw15cruQ6L34pmKzl069s8LUKLWtM8eXMeIR3XdAaESp2AiAhEPcs2u8dDHzRM8+4Nwgxt/fnNNJeEZZyYhHtGiQlwGqVgY4Qpmfc9GV8ASrD+TTxUK0okLjgrUBrJRragt5UXI0zs8Avu7sziqGymKfbklXOV4U4J1JY0slhbjvQISH SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2017 08:27:35.1313 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e69cd6f9-d96b-4f6b-0779-08d52814e5c9 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3652 Subject: [dpdk-dev] [PATCH] net/mlx4: fix last Tx wqe stamping lack 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: Fri, 10 Nov 2017 08:27:38 -0000 When Tx pakcet HW processing is done, SW should stamp all the completion burst WQEs. Stamp missed last completion burst WQE. Fixes: c3c977bbecbd ("net/mlx4: add Tx bypassing Verbs") Signed-off-by: Matan Azrad --- drivers/net/mlx4/mlx4_rxtx.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) I think this is a critical bug fix that should be added to 17.11 version. No performance impact was seen. diff --git a/drivers/net/mlx4/mlx4_rxtx.c b/drivers/net/mlx4/mlx4_rxtx.c index 3985e06..44edeac 100644 --- a/drivers/net/mlx4/mlx4_rxtx.c +++ b/drivers/net/mlx4/mlx4_rxtx.c @@ -336,6 +336,7 @@ struct pv { { unsigned int elts_comp = txq->elts_comp; unsigned int elts_tail = txq->elts_tail; + unsigned int sq_tail = sq->tail; struct mlx4_cq *cq = &txq->mcq; volatile struct mlx4_cqe *cqe; uint32_t cons_index = cq->cons_index; @@ -372,13 +373,13 @@ struct pv { rte_be_to_cpu_16(cqe->wqe_index) & sq->txbb_cnt_mask; do { /* Free next descriptor. */ - nr_txbbs += + sq_tail += nr_txbbs; + nr_txbbs = mlx4_txq_stamp_freed_wqe(sq, - (sq->tail + nr_txbbs) & sq->txbb_cnt_mask, - !!((sq->tail + nr_txbbs) & sq->txbb_cnt)); + sq_tail & sq->txbb_cnt_mask, + !!(sq_tail & sq->txbb_cnt)); pkts++; - } while (((sq->tail + nr_txbbs) & sq->txbb_cnt_mask) != - new_index); + } while ((sq_tail & sq->txbb_cnt_mask) != new_index); cons_index++; } while (1); if (unlikely(pkts == 0)) @@ -386,7 +387,7 @@ struct pv { /* Update CQ. */ cq->cons_index = cons_index; *cq->set_ci_db = rte_cpu_to_be_32(cq->cons_index & MLX4_CQ_DB_CI_MASK); - sq->tail = sq->tail + nr_txbbs; + sq->tail = sq_tail + nr_txbbs; /* Update the list of packets posted for transmission. */ elts_comp -= pkts; assert(elts_comp <= txq->elts_comp); -- 1.8.3.1