From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30077.outbound.protection.outlook.com [40.107.3.77]) by dpdk.org (Postfix) with ESMTP id E9705239 for ; Thu, 8 Nov 2018 15:02:18 +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:X-MS-Exchange-SenderADCheck; bh=+9oP5uUdlT6QWUOOgfX0LuwrLmdWOKEALr7jhhnQC+M=; b=eOlnk8Y4BjHHVKJiuyxBLOvpmlYN2OiuxIT462TrvHXBGu1J4UNfRo7sbEqynmWmy+t2V8nfE/GqofnnrluC461A1Em/hgzO2C20djCtqdX8VYxtGcz8Ua3TDmzdkktPPiOdP3ezRsl5mDkHVouZelxkvlijJQ0shtYTr9y5aUg= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.186.150) by AM4PR05MB1555.eurprd05.prod.outlook.com (10.164.80.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.21; Thu, 8 Nov 2018 14:02:10 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::544b:a68d:e6a5:ba6e]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::544b:a68d:e6a5:ba6e%2]) with mapi id 15.20.1294.034; Thu, 8 Nov 2018 14:02:10 +0000 From: Slava Ovsiienko To: "Stojaczyk, Dariusz" , Thomas Monjalon , "dev@dpdk.org" CC: "gaetan.rivet@6wind.com" , "Zhang, Qi Z" , "Guo, Jia" Thread-Topic: [dpdk-dev] [PATCH] devargs: do not replace already inserted devargs Thread-Index: AQHUd1XBri7yylyi4kiNPWK4DQjufKVF5xDA Date: Thu, 8 Nov 2018 14:02:10 +0000 Message-ID: References: <20181107232105.19187-1-thomas@monjalon.net> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [95.67.35.250] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR05MB1555; 6:XUaBZW11EuzFsMaMALI3ySyP/q0T3A1/CGWs8/s8/eRpCYXqPO+cxy+4fC81e9w2W/6Uyy2HJgIS9C+cXZe6GEbEBKRi9f6S6UuQCOLO9LFs7B6jPElN9W1t06tW0zgdydpnPsTPbqV9NndVtp/PoRKiCBlM+B3kQL97lkJIhVgL5m4+5GwIrMvl5kJ5jayZjlNw8sR7ygAddHznKUOE3/RlWc4IEZRcR3SnOgHGD7qzg3LYry5OwsjkZX7EijiGSljMaqxkOFviaPN738JVDBfC/YTIzQon2B4CK5yn7wZSluTfj8rV03fJ99552mlJH02teEPZHJv49fLS8yKSFv9/wHTorNMDfb3kaChLeGKP95Rc1I8y+moff/mc5i1C8IJCtUAKckxGf2bMZ3e6uAicjQpkM1CgLHUvuj+qZmTIa6hAtqIo3hVYfS1arf41R13dZV0vYQJG1YYa1Aal9g==; 5:0fEJz9trOs9jXmpuNsxNBOv+GdfKVVMMmEy9H7p7lI4Ty5MqDi/X8EVsQD7JI0+3CbJhfWkUVyrAcSiktsPDbOB6WYI4i70vbJIbvt2Tdp74szwkq2AOxNDnba2IAZ6/GH0FE8TO5Rt62wrvH2Pn/VdFUL+IZMx3SGojamlr7tE=; 7:f9hW/WJaETYnRdd/dT6YNKJ9D61F4lzRUeSrZJgymHdZVYZjouUtS5goFxjLEP51K3DzZcTfuOp9O+nS/0Hk+jB8SsSPlHO97a6ydW5X6bOROX/exgAYip2qyNYSfSax6VkNNyZRTlBBXOpP+TTjFQ== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: f579c265-744a-4419-5948-08d64582c6c3 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:AM4PR05MB1555; x-ms-traffictypediagnostic: AM4PR05MB1555: authentication-results: spf=none (sender IP is ) smtp.mailfrom=viacheslavo@mellanox.com; x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(788757137089)(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(3231382)(944501410)(52105095)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:AM4PR05MB1555; BCL:0; PCL:0; RULEID:; SRVR:AM4PR05MB1555; x-forefront-prvs: 0850800A29 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(396003)(366004)(346002)(136003)(39860400002)(189003)(199004)(13464003)(229853002)(9686003)(4326008)(2906002)(2501003)(25786009)(33656002)(55016002)(71200400001)(81166006)(71190400001)(81156014)(8936002)(6436002)(105586002)(106356001)(7736002)(102836004)(76176011)(86362001)(53546011)(305945005)(110136005)(74316002)(97736004)(26005)(14454004)(54906003)(316002)(186003)(5660300001)(478600001)(68736007)(486006)(5024004)(256004)(476003)(66066001)(2900100001)(53936002)(99286004)(6246003)(3846002)(7696005)(446003)(11346002)(6116002)(6506007); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB1555; H:AM4PR05MB3265.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:3; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: dwpXvpvDRnQpI/0BhtLXgEJRyq1MHjYwqucZnb7yfNrKzgt6UEvDmNjdtUwkkgeloJL/l3WIvTh4voZCf0MO4CVqILU4AyFxyyTf3v05woQsjtgAkQSmk6nO0UFJSJ4tT/8bO58P6u3NiuuLfeFv82B9Y+MLUaco6y3rUYM9lyQmlVEcXM969y/t4Xr8Ybh+wwBnBOiXypCl9+BcIGmquU3gLMzTlPSzFxXNbG8LHD+P1waNAlJCJxPZ24Vate49nIga3Ry4bqlemHGcdjnXDIqss23UNnzPZMleQiQSDwKMI41b6oYwhjAvvGXBGKiUur17SSQMa+B3bbUVU1Kz/K562roizuhlX2lc0WGATKw= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: f579c265-744a-4419-5948-08d64582c6c3 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Nov 2018 14:02:10.1159 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB1555 Subject: Re: [dpdk-dev] [PATCH] devargs: do not replace already inserted devargs 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: Thu, 08 Nov 2018 14:02:19 -0000 > -----Original Message----- > From: dev On Behalf Of Stojaczyk, Dariusz > Sent: Thursday, November 8, 2018 13:25 > To: Thomas Monjalon ; dev@dpdk.org > Cc: gaetan.rivet@6wind.com; Zhang, Qi Z ; Guo, Jia > > Subject: Re: [dpdk-dev] [PATCH] devargs: do not replace already inserted > devargs >=20 >=20 > > -----Original Message----- > > From: Thomas Monjalon [mailto:thomas@monjalon.net] > > Sent: Thursday, November 8, 2018 12:21 AM > > To: dev@dpdk.org > > Cc: gaetan.rivet@6wind.com; Zhang, Qi Z ; Guo, > > Jia ; Stojaczyk, Dariusz > > > > Subject: [PATCH] devargs: do not replace already inserted devargs > > > > The devargs of a device can be replaced by a newly allocated one when > > trying to probe again the same device (multi-process or multi-ports > > scenarios). This is breaking some pointer references. > > > > It can be avoided by copying the new content, freeing the new devargs, > > and returning the already inserted pointer. > > > > Signed-off-by: Thomas Monjalon > > --- >=20 > Tested-by: Darek Stojaczyk Attaching the representors caused segmentation fault. The scenario: - setup with SRIOV enabled, PF plus N VF - switchdev mode enabled (have representor for E-Switch ports)=20 - run testpmd specifying PF only, one device probed and one port is created - trying to attach representor with port attach command - segmentation fault occurs within rte_eth_devargs_parse () The patch fixes this issue. Tested-by: Viacheslav Ovsiienko