From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0069.outbound.protection.outlook.com [104.47.1.69]) by dpdk.org (Postfix) with ESMTP id 202E75F65 for ; Sat, 10 Mar 2018 02:26:00 +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=KCUmNbIhiIL61y0SaJ78WZ8zuMfD6Ae/mFtIOGTXNFQ=; b=Y+ZGmsOF5Tt2k6lCx9JEzZPZvnHxUObVCndAmMUMkCooRmMzW6ojydZnnS9V2dhoyJdn0RBvtM8OBdPXtvFu5bwqkaKgH32P4mnqjesJbubgUyy7xp6jDhbn7RlJx8qBDGgKRzsCAXDWtuPAFl3lt2luFFzVq7RUdMHFUxq5UbE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; Received: from mellanox.com (209.116.155.178) by VI1PR0501MB2045.eurprd05.prod.outlook.com (2603:10a6:800:36::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.548.13; Sat, 10 Mar 2018 01:25:57 +0000 From: Yongseok Koh To: wenzhuo.lu@intel.com, jingjing.wu@intel.com, adrien.mazarguil@6wind.com, nelio.laranjeiro@6wind.com, olivier.matz@6wind.com Cc: dev@dpdk.org, Yongseok Koh Date: Fri, 9 Mar 2018 17:25:31 -0800 Message-Id: <20180310012532.15809-6-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180310012532.15809-1-yskoh@mellanox.com> References: <20180310012532.15809-1-yskoh@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [209.116.155.178] X-ClientProxiedBy: CO2PR07CA0068.namprd07.prod.outlook.com (2603:10b6:100::36) To VI1PR0501MB2045.eurprd05.prod.outlook.com (2603:10a6:800:36::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 34943aa4-186c-45e1-8601-08d58625e0ec X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0501MB2045; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2045; 3:7Yj1Y9yH48mdUfIprnp2cKpsiSHThWZgP8DgfYcKT9wTxcIz36D+997rSvIACAYyk2z9M0L7WxhqpS1GK+v9KGN17U6lT53vRaw2BIhVM64YsLoZAcfiiBDLbHMyL/SYB5oqOfTfovoasydDHkawelxxy5xconN738H02qOe3Hfr3oQ8tx9bNcyScpTfImSJvrOREspmULct8pY3Bg6CTnT8qq9ofYNDom99JXFVtowxgsD/idNgFEZtCePyPea7; 25:hDY0uXBq4XkpdlihyEW9ER2mf4EBTmQsFY9jPXERVtk/BmFfEYevQOGfxL5fRA0QZjgPyEbQwSLUCzYsBj/HOOLC6mVCvtaA5AarIUUtQU9ikSfFsfJPKyBxVnUsQmVuEZTRJUIBRFv/JPINSmag/ui8il1xN7rdYfBBzza198zfrkQpWWWS814Be7CAscHT3idpDGVa/C0G4tQgkH1sWi2wzaSu2O2WyEwYhcDmd5KYhR82erkj3mgir1P2I4jrADZPZKfzC13lthU2YGsY7Q+IunmL/qTrQWt2MSSfeTJGLqD/Hco5jaI83E8od5jnSm0UaTb5Cl0w5amly1QW3w==; 31:3rHzr5gZJQISGTSFsis89Vjxh+VVpG5/uAt1w3zQ9UPtkpibbKm5A7GMCjrpCqdkCovRdhvLN0KZfELkKu7b6KyBPgfIexCvJR4HZe0IONXnA5Kzj4l5d96K8sfIaD6bLHz8t9/j++BtXGzNI8lWyuh9UzjgjtS7w7FAi3UsO7kr8sQoFbme27/sHgdrINFyesMNr374p7dRrWQBAGSQ2ZUmkxMKF2p772AptuyAqfk= X-MS-TrafficTypeDiagnostic: VI1PR0501MB2045: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2045; 20:EUd7Vw8RZLLG4CZOkiB8iQXl10s7izMBr1P/n8jsRQ2hNYoUCYllE6RzhCx2/9vJ6yNHKbk3wPABzea8AF+UpKZuQ/TyYna4I+EgRj1IkadcNSlY3Bhie8NSXNQobQhdSkb1Wlg1NWRak1/Y6RIZGax8nbiHQWkFC0e22XT/rFRFU7SoOZh1TbfeU8t7r7Ku2W/7bIxAYRZrxkaOfJRQ84v6+DxYIQI3cE3JntRTCHk/iSg1e8HpLE6J0ERGaknjUVqxrZDeuPjApYptVNwSZg9iYp65bHUKscUP4xq8llmUpXdT+3twuKTEj6nUL9S2/ygLURVbd5NOITR0ikRuDQM8R6mnIRn5xGJgBuepOcd6wlKk8hNJm9iU5UFRsUs9utXQRNdPX3+CssF4PzrJroDCG3GajbVvOQIX8eGL9yqmwtYiPUZ3QaNKTYGfWYjtZXhh3IvfDMmUvBxeJSZoe0Yj8gem5vBJl1pg2BTZzaFpIj6h5y25ps0RPkVvoK7b; 4:iPDlAmTc9luwAf3lzYNE9Tpy9L7JB5P1Ajwy7w73GFydmWfsOF060aC97uZwIZLiZMZEqMB0U2vKCZIjjHJoyOoUxQCuBSyGR0yJcHvaAGz3jQW43R0y1FyMLML9yZQp3ROt/SyRjXSqLVFHMjgZ1wsiutUebc/l83g+vNeleC7U6kQGndUA/VVrvcdHuxo0j8Yul5bKo3fQFmXokXTYGrBK+sQ3KVpOLHg+NOwVriMzJ2gPvij0rdfJ75trU04wCDZd4vxJwZCePoP8BYZ8gg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231220)(944501244)(52105095)(6055026)(6041310)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:VI1PR0501MB2045; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0501MB2045; X-Forefront-PRVS: 06070568C5 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(39380400002)(346002)(396003)(376002)(366004)(39860400002)(189003)(199004)(7736002)(5660300001)(97736004)(7696005)(51416003)(36756003)(6666003)(575784001)(478600001)(76176011)(107886003)(86362001)(8676002)(48376002)(55016002)(50466002)(59450400001)(52116002)(53936002)(4326008)(69596002)(25786009)(21086003)(105586002)(6116002)(3846002)(66066001)(386003)(2906002)(16586007)(186003)(50226002)(47776003)(68736007)(305945005)(8936002)(316002)(106356001)(26005)(1076002)(2950100002)(81156014)(16526019)(81166006)(83323001)(21314002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0501MB2045; 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; VI1PR0501MB2045; 23:8mCfs/KNgyWIz9iYClcY34X9Yyh9sNRtATddkyX?= =?us-ascii?Q?Yb6HpbhoJ0Z9BseLClsp+G7kVR6JMndHi/72oL2VnL1aXk79yLKNj9cH07gG?= =?us-ascii?Q?O72ZWYNNEWjUPlzfjlxds6dc0NtRV1Tdw7rTWQ54HWt8+l6rizeqUoACWNWm?= =?us-ascii?Q?mG5YiT7sUjoKa6/+CEgXgaKl3NFPwx20/9cE7gB3Ynv2gtCNiTML0mcKRRJ2?= =?us-ascii?Q?5y9iw7JF2BdvlUxDzT2XGyAeysM79ip2n3TKdmKP3nFcZwOsmzD1WqYzS0l/?= =?us-ascii?Q?pahdrVoSw+aNsJuklVqxuqRQiCHKvi5su1Q9wBHH/fxDohZUlobLghEm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9imU=; 7:tc588KIpR6A4MTTkFW3qokHH8Ne8syel547zkUH2SA6CdzwH3CPMUf4PeFuF+6y8oRg6+B+d6p3CtxzQ0tJ/XkLin9opHfvspcTwQEiKoo5ySd3vvICzjmuBWPyRBpUxlRHFh1fmUEmLPwhaxpgR1jw5FG2rZ9xYgHmrRISurzWQKlOdSc2PnD4gNnNQleNdbO9oGHu/KwVRSLqcnapzWSqi+rLVGOZv4okR4tqSRrTFP9Yu8nwywqXaHAa9Xa6p SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2018 01:25:57.1894 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 34943aa4-186c-45e1-8601-08d58625e0ec X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0501MB2045 Subject: [dpdk-dev] [PATCH v1 5/6] net/mlx5: release Tx queue resource earlier than Rx 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: Sat, 10 Mar 2018 01:26:00 -0000 Multi-Packet RQ uses mbuf indirection and direct mbufs come from the private Mempool (rxq->mprq_mp) of PMD. To properly release the Mempool, it is better to empty the Tx completeion array (txq->elts) before releasing it. Signed-off-by: Yongseok Koh --- drivers/net/mlx5/mlx5.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 25c0b5b1f..b2487186a 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -187,14 +187,6 @@ mlx5_dev_close(struct rte_eth_dev *dev) /* Prevent crashes when queues are still in use. */ dev->rx_pkt_burst = removed_rx_burst; dev->tx_pkt_burst = removed_tx_burst; - if (priv->rxqs != NULL) { - /* XXX race condition if mlx5_rx_burst() is still running. */ - usleep(1000); - for (i = 0; (i != priv->rxqs_n); ++i) - mlx5_priv_rxq_release(priv, i); - priv->rxqs_n = 0; - priv->rxqs = NULL; - } if (priv->txqs != NULL) { /* XXX race condition if mlx5_tx_burst() is still running. */ usleep(1000); @@ -203,6 +195,14 @@ mlx5_dev_close(struct rte_eth_dev *dev) priv->txqs_n = 0; priv->txqs = NULL; } + if (priv->rxqs != NULL) { + /* XXX race condition if mlx5_rx_burst() is still running. */ + usleep(1000); + for (i = 0; (i != priv->rxqs_n); ++i) + mlx5_priv_rxq_release(priv, i); + priv->rxqs_n = 0; + priv->rxqs = NULL; + } if (priv->pd != NULL) { assert(priv->ctx != NULL); claim_zero(mlx5_glue->dealloc_pd(priv->pd)); -- 2.11.0