From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <shacharbe@mellanox.com>
Received: from EUR01-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur01on0050.outbound.protection.outlook.com [104.47.2.50])
 by dpdk.org (Postfix) with ESMTP id 2B13B9988
 for <dev@dpdk.org>; Sun, 30 Jul 2017 09:33:21 +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=w4YqwAgwWNQ0T6mz/qD7csaWQJTlKktUAlRFCx/Rx+g=;
 b=QtIrW3zRySh/ccDUw2lAJ+sB/Lsarqi2DGmcPJoWRZPHhtmo0ASkBIkHtyRJeydu4QJOy3CI2bibaVBI12nD1YUU8nkeTX6jQt5ziltSu0PcvJxmrMuZjGoJMokFwBbc6Tq1UCZpaOFdAs7lxxnQSZiQ5CR4/yw2tWm9MLKVEeo=
Received: from AM2PR05MB0689.eurprd05.prod.outlook.com (10.161.20.16) by
 DB6PR05MB3142.eurprd05.prod.outlook.com (10.170.221.16) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id
 15.1.1304.22; Sun, 30 Jul 2017 07:33:19 +0000
Received: from AM2PR05MB0689.eurprd05.prod.outlook.com
 ([fe80::dd84:1887:d148:89ab]) by AM2PR05MB0689.eurprd05.prod.outlook.com
 ([fe80::dd84:1887:d148:89ab%15]) with mapi id 15.01.1282.023; Sun, 30 Jul
 2017 07:33:19 +0000
From: Shachar Beiser <shacharbe@mellanox.com>
To: Gaetan Rivet <gaetan.rivet@6wind.com>, "dev@dpdk.org" <dev@dpdk.org>
CC: Thomas Monjalon <thomas@monjalon.net>, Adrien Mazarguil
 <adrien.mazarguil@6wind.com>, =?iso-8859-1?Q?N=E9lio_Laranjeiro?=
 <nelio.laranjeiro@6wind.com>, Shahaf Shuler <shahafs@mellanox.com>
Thread-Topic: [PATCH v2 0/6] fix ethdev device detach
Thread-Index: AQHTBhQltpl/XfM2zUuD63ZVTDkr1qJr/0Lw
Date: Sun, 30 Jul 2017 07:33:19 +0000
Message-ID: <AM2PR05MB0689A1DF4FA60FC6F16D7189C0BD0@AM2PR05MB0689.eurprd05.prod.outlook.com>
References: <cover.1501075226.git.gaetan.rivet@6wind.com>
 <cover.1501076035.git.gaetan.rivet@6wind.com>
In-Reply-To: <cover.1501076035.git.gaetan.rivet@6wind.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
authentication-results: spf=none (sender IP is )
 smtp.mailfrom=shacharbe@mellanox.com; 
x-originating-ip: [193.47.165.251]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; DB6PR05MB3142;
 7:gePqonHq9R0J1IeXdLDsoQKwYc2zyxF7emLdz1rWhQPIHRRDOYDVeh0Q0vdu4mWf+YaYHIfeCVl+x5utOvvUObSWnd8wfmk7brd3Irpg87qGZxi8y0tXpE3GDYzO36l/a4IZ9TIvsXhmn+bdbmHUqK6TWVKiGINnihVPha7SBfqTF0OXxeQVntkOMnVIR1v9Cc0YeTkh8KLsb1suDblEoiM6T9dJ3uSLtBNPZz/gMc5Budf3WgCuCiDAdqecmm9OQUeXmgVmZF1n+Ui9neaXXLurmUCx5fN92s/ne63kHVuCdpHo7Gm5hckU4LQ+sqJe+XmtOUn3DiyraZAUbMzBZ3vejdPk2sIOEhnxntE7nlLqfmnrrmUCannNflwgCZSqkxRcZbH4xzAd5uiUMGl2YxJREz5w4lzCm6tIB438ZIbPrE1CX/7d3TWTkRsZkD7E92e7vb+gh/veP+oyUktxtGznSGM0/2vmCIv4lh+0WDpHgHWL9RQAQhOqOUxU5r3DwgL5Jrpku93j3axajKEi2KIlS2w2sRy2jPz43aTqbJ4YPTEl0xwHuZYxvFBfrT4gV2yeKhlkw4LfFm/1WzbCCQzAYyx4oPLLx8JLuGmzefkXNko3EJwna3UOeg/8sxmlSS3mFw321A7QLfwa8XhZzGvmrng+gzpdwhlVrQFUUaINtA5ddJFRTaK8n4ox2I8bO291kRS+h774eNfRU454nLsisGSoTGJJwF/4EIL4EQQ1smuF/niCJbXiqAL/zBxHIM3oGtfPYg0p9fuyhcy0/zDt3JDVeAid5vNzSdJ8Jec=
x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr
x-ms-office365-filtering-correlation-id: 9ae12f47-9b6b-4b4a-b6b1-08d4d71d3ffa
x-ms-office365-filtering-ht: Tenant
x-microsoft-antispam: UriScan:; BCL:0; PCL:0;
 RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(48565401081)(2017052603031)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);
 SRVR:DB6PR05MB3142; 
x-ms-traffictypediagnostic: DB6PR05MB3142:
x-exchange-antispam-report-test: UriScan:(68840517438536);
x-microsoft-antispam-prvs: <DB6PR05MB3142435899805DE243AAA5E3C0BD0@DB6PR05MB3142.eurprd05.prod.outlook.com>
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0;
 RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(100000703101)(100105400095)(3002001)(10201501046)(920511095)(6055026)(6041248)(20161123564025)(20161123555025)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);
 SRVR:DB6PR05MB3142; BCL:0; PCL:0;
 RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);
 SRVR:DB6PR05MB3142; 
x-forefront-prvs: 0384275935
x-forefront-antispam-report: SFV:NSPM;
 SFS:(10009020)(6009001)(39850400002)(39400400002)(39410400002)(39450400003)(39840400002)(39860400002)(189002)(199003)(13464003)(377454003)(86362001)(3846002)(102836003)(6116002)(478600001)(106356001)(38730400002)(6506006)(6246003)(107886003)(105586002)(9686003)(54906002)(2900100001)(6436002)(66066001)(99286003)(55016002)(53936002)(4326008)(2950100002)(25786009)(229853002)(7736002)(305945005)(97736004)(189998001)(2501003)(7696004)(53546010)(14454004)(33656002)(74316002)(5250100002)(50986999)(5660300001)(3660700001)(76176999)(54356999)(81166006)(8676002)(101416001)(8936002)(2906002)(81156014)(3280700002)(68736007)(17260700007);
 DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR05MB3142;
 H:AM2PR05MB0689.eurprd05.prod.outlook.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)
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: Mellanox.com
X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jul 2017 07:33:19.2408 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR05MB3142
Subject: Re: [dpdk-dev] [PATCH v2 0/6] fix ethdev device detach
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Sun, 30 Jul 2017 07:33:21 -0000

Tested-by : Shachar Beiser <shacharbe@mellanox.com>


The bug is fixed and now there is no crash:=20

testpmd> port stop all
Stopping ports...
Done
testpmd> port close all
Closing ports...
Done
testpmd> port detach 0
Detaching a port...
Invalid port 0
Please close port first
testpmd> show port info 0
Invalid port 0
Valid port range is [0]
testpmd>


-----Original Message-----
From: Gaetan Rivet [mailto:gaetan.rivet@6wind.com]=20
Sent: Wednesday, July 26, 2017 4:36 PM
To: dev@dpdk.org
Cc: Gaetan Rivet <gaetan.rivet@6wind.com>; Thomas Monjalon <thomas@monjalon=
.net>; Shachar Beiser <shacharbe@mellanox.com>; Adrien Mazarguil <adrien.ma=
zarguil@6wind.com>; N=E9lio Laranjeiro <nelio.laranjeiro@6wind.com>
Subject: [PATCH v2 0/6] fix ethdev device detach

Device detach in librte_ether is rough right now.

 - Device hotplug capability is not properly checked
 - Device state should be set after a successful detach
 - MLX drivers are lacking the relevant flag
 - And this flag should actually be removed, thus occuring an API change
   for v17.11. An announce follows.

Without this series on an MLX4 port:

   testpmd> port close 0
   Closing ports...
   Port 0 is now not stopped
   Done
   testpmd> port stop 0
   Stopping ports...
   Checking link statuses...
   Done
   testpmd> port close 0
   Closing ports...
   Done
   testpmd> port detach 0
   Detaching a port...
   testpmd> show port info 0
   Segmentation fault (core dumped)

With this series:

   testpmd> port stop 0
   Stopping ports...
   Checking link statuses...
   Done
   testpmd> port detach 0
   Detaching a port...
   Please close port first
   testpmd> port close 0
   Closing ports...
   Done
   testpmd> port detach 0
   Detaching a port...
   Port '00:03.0' is detached. Now total ports is 0
   Done
   testpmd> show port info 0
   Invalid port 0
   Valid port range is [0]

v2:

  - remove coredump from patchset

Gaetan Rivet (6):
  ethdev: fix device state on detach
  ethdev: properly check detach capability
  net/mlx4: advertize the detach capability
  net/mlx5: advertize the detach capability
  app/testpmd: let the user know device detach failed
  doc: announce ethdev API change for detach flag

 app/test-pmd/testpmd.c               |  9 ++++++---
 doc/guides/rel_notes/deprecation.rst |  6 ++++++
 drivers/net/mlx4/mlx4.c              |  1 +
 drivers/net/mlx5/mlx5.c              |  1 +
 lib/librte_ether/rte_ethdev.c        | 11 +----------
 5 files changed, 15 insertions(+), 13 deletions(-)

--=20
2.1.4