From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0062.outbound.protection.outlook.com [104.47.2.62]) by dpdk.org (Postfix) with ESMTP id 1C4A32C6A for ; Mon, 7 May 2018 19:56:26 +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=0dwcDhdGtsTaMf3DX+SUeeAkFWrBBV1UT7FTQ62GZKA=; b=Ut/nL0SFnDGqZDIDUJeKFZ1wkDZhFmhN3yCfW0R4YgGA98gIjgcy8vlBOtid+NiOVNrJ7r5LVK2iCZy51ZOLtSv9PikQf5PgFGL6N2D+g/FmxWpmcYlSeD5WZIIa8dqu0QJpVMrhtQimplDqyEG6sFz248H6rB0Fk4HGb4oGDAw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; Received: from yongseok-MBP.local (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.735.17; Mon, 7 May 2018 17:56:22 +0000 Date: Mon, 7 May 2018 10:55:36 -0700 From: Yongseok Koh To: Raslan Darawsheh Cc: shahafs@mellanox.com, dev@dpdk.org, thomas@monjalon.net, ophirmu@mellanox.com Message-ID: <20180507175534.GA42287@yongseok-MBP.local> References: <1525705833-8573-1-git-send-email-rasland@mellanox.com> <1525705833-8573-2-git-send-email-rasland@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1525705833-8573-2-git-send-email-rasland@mellanox.com> User-Agent: Mutt/1.9.3 (2018-01-21) X-Originating-IP: [209.116.155.178] X-ClientProxiedBy: CO1PR15CA0098.namprd15.prod.outlook.com (2603:10b6:101:21::18) To VI1PR0501MB2045.eurprd05.prod.outlook.com (2603:10a6:800:36::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(2017052603328)(7153060)(7193020); SRVR:VI1PR0501MB2045; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2045; 3:kquc8shQe3wNMInmPXfz+EuYfNy0trrDuApOMlVBCoihxpmGQw0ZWrsVXl0zh4eL052ZoOUHquZeezicTKSpskwhs12Av6xzFHKHI05dV2U5vNvNDs9JiAnsMN9s3Au0A+2R3IxvmXKilCYGKemj7UFtNCBYbFSgbMmRajkANwiLi75PlfOVrL7YM2MyYuRgMnJcd6OeXlhFKfKuVNOOQyx9ds7NeUmOWwD9pbSSTutQefggX3z4cefKBx0gnK8r; 25:BXGMLXm3UGx+IuqQB8VdpAM6QeIxU1E9oo9fJ/f1fufXiKyqPtFPZfV/ejaS+/Q/uNXFLqk1G7F/xgxJnqItmc5yxfz9GYUiXIlGz6q2dKeb5hhocmvKJy7XkXX+7fBHzeKeXp7rKK8Megt7eAu8Gwuh21oj3v2lTVFavnhTOYFYNYTVSwidtsI3XnDogHTNfAOhUZcQmbk67nxqOrvY1LdKFbbdu/ql9JhjDT9i/MzYMDxT8WYM1q3jSBM0AviZlOI2XprhS/f/dTorVTcSSVK/5AygOhgICT59cwqyaMZp8HoIRM2pqJz/dW6SNo9bAXW5O+UlXelW+e7zJhwwsQ==; 31:MgTo2rriii9kVRsQXsqIA1cNmLChjYSdNy8dUpGDJYQStL6wlrwmpnMvJj1Q5ySWnxhF7idsytwoJVvAcOyMGrVorgKssKwkIdsj1z6nwtp6CtossFOMWAj0pZordM/B4sIwZB+hlGhCf57eMOGHIDnUKW1ecGsFQR/xhJ0Yvjwdg7ykVlqIFvOX+y0K/NkZoN3EQ0ggDGYdLewXGHrkIYQONxEIXWbdRYUOiQtGrNU= X-MS-TrafficTypeDiagnostic: VI1PR0501MB2045: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2045; 20:fwd8Pb7lozLYlreTEw2Hu07GyZl9BII73mY7yzLLOjvGSy/3Y+ojmmChN5cIzxksVPtvn7HrDjDeLPoMjxGz6Xu63sOB1o3KxuQPYLMKlmWJo6m0clBdRuf8lWH077BibFWy97ryZqd2ZYh8GmP1oYA0y8N9xf7reM6AFVWfTNkOM02rixhp7dz/iDMuOEHnA+9A0r17DowZodtZeuHP3ya3J8uIRO4r1dMlGBz5ILypP40QhwFpp+D+0d0IjxlqYU8fJjbxCbTg5GugBTUFKsRNUyq9VUsikWy5jnkSSn7KgMKlU7tIej+JJTD+2ZWm0+X76BP96Vk/UrvqFIN9+RBRLLZWeIBcmNXZSc+Bq1mybkxFVmklSZdq4vXkeN0UwK8PIbrMtyH7n0tltT26lbit557H+iHLOPBeG5VTZA7rBHAcxZSSj6Kf9c9xkQR5plg57EZ40ER0rhFNre6hDBobCkAVp+qNVaU/0yqT4GiYl/4WBLmwLNQmbcpxnrb/; 4:Zc3HuRUJLVwNuaeaY+p9RtGgqds8euSC5np3iitIJWuZR7UB0/+91Dw2X3m0KQVhjburHGr6y9FqBQ5iklrlKmqVRuvisE6i/TUgEkbk6uzjo00fHJwSfyuyjRhX2hf08WFQKZKw39YSITibjKTvi0ZLGDoTRwwk+2Hsi/3bRb82XCRWJNQXk1C9qzcyA7131KSEqX1Y0Vouz8dGlBbCcnciESqTF8Pd9qR/Qcnwvr0AyFFxpD+V3C1sqiwYSatbzu3Z2+jpb+zMJdcsyqwI5kcSbe3IE288XYRGKfDlxq3SNumzxfbxUSBtt7mouNu3 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(60795455431006); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231254)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(6072148)(201708071742011); SRVR:VI1PR0501MB2045; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0501MB2045; X-Forefront-PRVS: 066517B35B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(396003)(376002)(39860400002)(39380400002)(366004)(189003)(199004)(16526019)(50466002)(1076002)(26005)(7736002)(305945005)(81166006)(47776003)(33896004)(6506007)(386003)(81156014)(7696005)(52116002)(76176011)(66066001)(106356001)(98436002)(68736007)(33656002)(59450400001)(105586002)(97736004)(58126008)(16586007)(229853002)(956004)(11346002)(6116002)(316002)(3846002)(5660300001)(446003)(23726003)(476003)(2906002)(8936002)(86362001)(8676002)(107886003)(9686003)(4326008)(53936002)(5890100001)(6246003)(6862004)(25786009)(55016002)(478600001)(486006)(6666003)(6636002)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0501MB2045; H:yongseok-MBP.local; 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) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0501MB2045; 23:E5Uhnrkcoul/UVX3i/1VZ/o2OMQFevwPprsnpeO?= =?us-ascii?Q?Wka6UfP2sNp+URNRl1mNh1SAqVcX9IliNd3VYvCqtzB7xtZN5qmCpfaHC/Ra?= =?us-ascii?Q?BuJ8n1GKpVO4kxkUzbtsgM/rf0Nx24txWsRHzeerjdVr4XGtKf9oOf/ft4Wm?= =?us-ascii?Q?cbxb8bTwd8g/Z8r41nkiwcUhuwXUqYJcqlTpEAZ2Bg5HAjuoMmyZPH/7OaXA?= =?us-ascii?Q?sLFjyHpg2j+qmYsi1s2uGnJsgskv5wuFuf84J9wfOfhct59ixmvpQK5PG9rv?= =?us-ascii?Q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FUZu2C8sKMYYgAEDw40FyWYfl9tpym515vfadstz5IsPHshu7NiUcoWyyIdVyhdS821K/T93R/cP61k+f9v7jopC+U=; 24:v1VPOWKrlFLbyt/nCVL1pinDr/RBIqgTPPGmw1TbuC9wVyVoI7oHt3hhg2jyj8d+YtwAf7LlhsUMpEgC706yeYM5iiEFIUz88WvMVKes5f8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2045; 7:oWCNmul97Ls6tc65ratvVaq3tgxNYeib2gL/eeHr5YRdrsWbn90HGnOWkC/mMsZfB8RpdibpEMoCYqwZ6BRtpy6LrDunUBnEjuFtDd7ZXlXZpggoD9SEODw0Q1KRTbTt2C2elwmmITQiGv07Ci5RP1b/U6kQaxDuzdE2ECA86MJoC2007BheH6RTEWwblK2jVtM/W8XILUo+J2MS6n06W9VH318RMKBI+mJKf+LWpiRuPhCIZCK5vLJAw8rev1zL X-MS-Office365-Filtering-Correlation-Id: 98dc450c-9aa3-4017-4e15-08d5b443d8c4 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2018 17:56:22.2532 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 98dc450c-9aa3-4017-4e15-08d5b443d8c4 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0501MB2045 Subject: Re: [dpdk-dev] [PATCH v2 2/2] net/mlx5: free eth dev port in case of error 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, 07 May 2018 17:56:26 -0000 On Mon, May 07, 2018 at 06:10:33PM +0300, Raslan Darawsheh wrote: Please refine the title. No use of 'eth dev...' > If something went wrong in mlx5 pci prop need to free the eth_dev > that was previously allocated during the port setup. Shouldn't it be sent to stable branches if it is a bug? > Signed-off-by: Raslan Darawsheh > > --- > v2 changes: > Reword the commit log. > --- > --- > drivers/net/mlx5/mlx5.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c > index 3831e3d..bffe90f 100644 > --- a/drivers/net/mlx5/mlx5.c > +++ b/drivers/net/mlx5/mlx5.c > @@ -1063,6 +1063,8 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, > claim_zero(mlx5_glue->dealloc_pd(pd)); > if (ctx) > claim_zero(mlx5_glue->close_device(ctx)); > + if (eth_dev) > + rte_eth_dev_release_port(eth_dev); I worry about the case where secondary process has some failure above. Secondary process doesn't call rte_eth_dev_allocate() but rte_eth_dev_attach_secondary(). But, rte_eth_dev_release_port() clears the shared data, memset(eth_dev->data, 0, sizeof(struct rte_eth_dev_data)); Then, the primary process will be malfunctioning. This seems a bug in the rte_eth_dev_release_port(), diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index e5605242d..20180146b 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -352,7 +352,8 @@ rte_eth_dev_release_port(struct rte_eth_dev *eth_dev) eth_dev->state = RTE_ETH_DEV_UNUSED; - memset(eth_dev->data, 0, sizeof(struct rte_eth_dev_data)); + if (rte_eal_process_type() == RTE_PROC_PRIMARY) + memset(eth_dev->data, 0, sizeof(struct rte_eth_dev_data)); rte_spinlock_unlock(&rte_eth_dev_shared_data->ownership_lock); Or _detach_secondary() may be necessary. You might want to talk to Thomas because he is the maintainer of ethdev. Thanks, Yongseok