From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0073.outbound.protection.outlook.com [104.47.1.73]) by dpdk.org (Postfix) with ESMTP id 7FC301B3D2 for ; Mon, 2 Apr 2018 20:50:40 +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=ppPB6kYT9AOHGfw1TK00ghfo0J0/8Bk8B/R52FV+1d8=; b=ZWyQ2010avMqMeyMXguxMhaJtMngdf1ZajAtejI9bKP4zuVJriWslw6R98LOCZ7acxl9cjR60QcDs6/okLgPvtXm7oNgr37Y8B6T1AaLkd58TFdAGDfzj8romZXidIiJqu+Whj5wHi+MOYCEUGJti5DOSSP1ZZxLxdcObek/G5o= Received: from mellanox.com (209.116.155.178) by AM5PR0501MB2036.eurprd05.prod.outlook.com (2603:10a6:203:1a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.10; Mon, 2 Apr 2018 18:50:36 +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: Mon, 2 Apr 2018 11:50:07 -0700 Message-Id: <20180402185008.13073-6-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180402185008.13073-1-yskoh@mellanox.com> References: <20180310012532.15809-1-yskoh@mellanox.com> <20180402185008.13073-1-yskoh@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [209.116.155.178] X-ClientProxiedBy: DM3PR12CA0064.namprd12.prod.outlook.com (2603:10b6:0:56::32) To AM5PR0501MB2036.eurprd05.prod.outlook.com (2603:10a6:203:1a::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ca1305b2-32dc-4aaf-5a6c-08d598caa0ae X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:AM5PR0501MB2036; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0501MB2036; 3:btvzqlOJH1OAo4bJs/phLjQqoRtoDOYQMcUDJ8gzE6LJ6XK5bP8Q4GxCPDcPAcLVW6e0+aJ0JTRHN0fDyqjdOHGbTv08Juhb7iP8919sVZ8y7GDSMYXrcE/aJsdNqLnVL0mIWmH1+Jgxpc929v2xjT8uuZ39WnY5WlYTK1u2wYNjFMQrz+f+zc2LeEOgcU26zUz0Srbus8Bx/MILhH1rcWQCcgIW8oc3haaYZ+ww6IOU/tQMDh79mJBBKW+Sqyp/; 25:MB3sYkNJIdKACs2CMtiv703pEZtSOW//rlht3eKxVPviOhAzrZu61/N996eumsP1TjMlrh4CK6ZUrGZVP70+FgWfXbb0oafN4ji9+bOvYUVUaBWrScnrSFiLNeRrn9Z5f9jw+QiONKaCfSjGbQ793jYfMiyvZw01ILk2nRPX0kKoRFJp8xKNnWf6BMClPaeJfrbn5r9xtnsj6Gci1hgHIolWxZnwSsN1kwyCaK1niFQULXcNx2fLP8Zg5DV95gUnCfrnkvXeXYrLuM++mg1y7n7OKMMhuhyh9BKoIsxauOEk+w11N1tfbAES3mvXtgz3Sf/HHbPu5HFP+22m6Uaulg==; 31:v8somgTJ/pF/bks3r+e97rtr9S9VsoLaDR12GayNgiFBjrC2LgGcFEmGr/xkpW+XBVPgXDzvqpoc7NMh1Xf97mbLCwCo4+f1ATK+6MQtgkTsElOPRePbFB2+Wnkcrd5NwOdxKbzTUIVPY+xVnT7ramrTyruJsm4NC+Pq/ZdfSacRSW6D3IR0gYnOjz+aLBYvzykl390KPlXnTFCjTG2zcTpE4e+PetWhaunbZyU2GRM= X-MS-TrafficTypeDiagnostic: AM5PR0501MB2036: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM5PR0501MB2036; 20:EAhjwSXemMov7uyGmc0SRHDUrsbtg89+0IMpnVmTJJgOhaLDLoTJAvAoNcLfVLsL4FVaTvF/6fPhSVkRv/yjPcL9CnMbNlrgg/lJ+AdSD8+JQUOp3h+3UJp0wdQ2GfG6YbiGcaspLbRzfT6GfaAf7V9dWFccwy58RIHT0ljUvOBnlm+hW32VpGFWrmto5Tc3uI4/aaMbxlyFF30QmqybZOQVBIBkor6T3Yc4o+YveMtc18u1wkUQujktqOLyaJ4fRfRKqhDooooIuhiKDblsHvvpmoxbnLX+RgWSlaEMu6PCnYzW9lyhvXTPeTdf38Nd/nVzj38s6IthKHktA92RU+d2w0ADn6r5dTRx9RdEq0OVi6ssfcMJ2PG89zyFyVAmgdHmP+Skn2jJhl/45c+ix9EiSbSSaStvRJWNpzxttJpDHZXjvWY97pIbzu01z1AhfoQ7SuqMrqQE/Bj/IFSGzpoFu8RPzyMkQnuta8KhlBHkdlPte/M87bngQjoK47Pr; 4:e2Vw8iQ9jk4an6q+o9VX29Lv0i223QCmc5tspV8a/ILfzE2Ay3XdmuGlYujfqHjnH0vLY3GjSrNOyIJbKJ0+ycJi2jLxvNqB37tJBvKpB+wYnssSIGL/+vDIPbuEN3GI+7xnTQPs9XSuicBXgCBmOviCERQu9pajWQ4WM3X1CSxfZebbQEqOPbaBh2Cc0mvOEvh0boD5ZTFHvtzEANaW8b2Pz4y/SwUaQokc4d6wc7x2iGD4anYBYgoLZhP/SZtUQQTbRjmZ9fSwtCuT89K6mg== 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)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:AM5PR0501MB2036; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0501MB2036; X-Forefront-PRVS: 0630013541 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(39860400002)(366004)(396003)(346002)(376002)(189003)(199004)(25786009)(106356001)(7696005)(81166006)(956004)(5660300001)(76176011)(16526019)(26005)(8936002)(186003)(51416003)(478600001)(47776003)(69596002)(66066001)(50466002)(105586002)(476003)(316002)(486005)(446003)(6346003)(21086003)(81156014)(52116002)(8676002)(16586007)(86362001)(2616005)(50226002)(68736007)(386003)(59450400001)(11346002)(486005)(107886003)(3846002)(1076002)(2906002)(6116002)(55016002)(36756003)(7736002)(53936002)(4326008)(48376002)(97736004)(305945005)(6666003)(83323001)(21314002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0501MB2036; H:mellanox.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0501MB2036; 23:0e19wm4VosKm+DihDCWIWQkega+kLVtlheFAVL/?= =?us-ascii?Q?6/VPNpAvoFdl//T2kWASF/GVTmHKE0a2scW59MpzWUZEllu9WDYH4SRUOu5k?= =?us-ascii?Q?Z5psQzzErQuZGLh538iQ8OUJX2KN7Hs3iqDvAyCH/lbwNxrwyuNIFyNs5FhU?= =?us-ascii?Q?Cm8HTsBOQQvf97NyltwzEr77teG7VhZHgh73LK9e1l8oSV3ifUbCkKZf3MbW?= =?us-ascii?Q?XfQaqXoVXTyz1+c8e2LjCe2z4qFZ3C0YZWzca+NwQIoBQmKjFAz40/skqtGX?= =?us-ascii?Q?l1QSCtr8RYd3Iw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ns+UQQyYr7RP4Fc8bVc=; 24:LEc6G5G089trZRvNTJV3HQ0OxNRxqG565w1ev5Gj6h4NdTKKtgLSTm1IbWX/rB07W9Ik/93JvkI+pjJsDQpjwCK0FnS0M+AwXulXYjVZwPM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM5PR0501MB2036; 7:tBiE6iDOLaEXglojme/GgAmO1+HtdEaYJ+Cx+ABMpxtuUQA9IURtbGs0BDLDit26NhzUBt5L0hIdC+ihIGt4JrjlgHe9xTSpfZvIgYGWTjbNmTszkOWiU3j7oSY42MQ7TaETsrI/oXgzi/6p8NSgA0YeAoGRV2T7ymC5lAeNXzqw8pnBt6p897ITJuQ+HWkcLrWSm4+S/d1i74HFYvcQmeWnMiEL7yYkw881XGTH3RZnwdXucs9oJ2Z4vl9XU9p9 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Apr 2018 18:50:36.0956 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ca1305b2-32dc-4aaf-5a6c-08d598caa0ae X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0501MB2036 Subject: [dpdk-dev] [PATCH v2 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: Mon, 02 Apr 2018 18:50:40 -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 aba44746f..51169e6ac 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -189,14 +189,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_rxq_release(dev, i); - priv->rxqs_n = 0; - priv->rxqs = NULL; - } if (priv->txqs != NULL) { /* XXX race condition if mlx5_tx_burst() is still running. */ usleep(1000); @@ -205,6 +197,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_rxq_release(dev, 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