From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0072.outbound.protection.outlook.com [104.47.1.72]) by dpdk.org (Postfix) with ESMTP id 13EDB16E for ; Thu, 14 Dec 2017 10:48:26 +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=gIQu/NkjGcTfplvQoNk1Sg7xX9+wjN0TwBF2fUHP7tE=; b=nQA2bn1w/q+/Y77FcZVtGqp4qnzJpnvSu9WPNZqDiI5IniVdyWvNS9If0X7DEd9xUt0YI9ufyDlVF354+2kjUutJyi9pSxjBFMVQTKfsrR0BxljOKaE2prxaJkQ9lS5MTY7bzlkaXXUVyewbd13jvSOWb+MyIZvzSLn93cfytlE= Received: from AM4PR05MB1907.eurprd05.prod.outlook.com (10.167.91.15) by AM4PR05MB1906.eurprd05.prod.outlook.com (10.167.91.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Thu, 14 Dec 2017 09:48:24 +0000 Received: from AM4PR05MB1907.eurprd05.prod.outlook.com ([fe80::b0cf:4ecd:d349:a71]) by AM4PR05MB1907.eurprd05.prod.outlook.com ([fe80::b0cf:4ecd:d349:a71%13]) with mapi id 15.20.0302.013; Thu, 14 Dec 2017 09:48:24 +0000 From: Mordechay Haimovsky To: Jeff Guo , "stephen@networkplumber.org" , "bruce.richardson@intel.com" , "ferruh.yigit@intel.com" , "gaetan.rivet@6wind.com" , Thomas Monjalon CC: "konstantin.ananyev@intel.com" , "jblunck@infradead.org" , "shreyansh.jain@nxp.com" , "jingjing.wu@intel.com" , "dev@dpdk.org" , "helin.zhang@intel.com" Thread-Topic: [dpdk-dev] [PATCH v6 0/2] add uevent monitor for hot plug Thread-Index: AQHTUshMnnLbKxfSu0iaknZonxLr1qNCyNMA Date: Thu, 14 Dec 2017 09:48:23 +0000 Message-ID: References: <1505880732-16539-3-git-send-email-jia.guo@intel.com> <1509567405-27439-1-git-send-email-jia.guo@intel.com> In-Reply-To: <1509567405-27439-1-git-send-email-jia.guo@intel.com> Accept-Language: he-IL, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=motih@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR05MB1906; 6:AB8BjziBh5ggn1A7y6oAtd/NY0w2ToAKOkSoc6YEkCsjrJ6D53pnRl+EuE0RV2voDGfQ553NFmN+Zph2RtUPSv42RAjrd9zMQVX6W8Hiwe4MK4V0NFtDbqcl+UWRFhuppnOVk4hoqA05FSeUKjsVMFbgAzrtUQEGEqcBfxlJG/IDFE/LK/2APAby+njI7HwW0jygcQDEVKlBzwo3QI7sS8arFMZV3U5ZARDH10ApOeXRPkUX6rp7XKv8U/fb/xyRA61TJ/Ceom2xuXGV9oNguspfmVNfNg26sl/f/H1QoqIfnrbMkj7qS2IBzdcECf3AU7jL3FKU0BI/V9cjBAbzx3CPJygjGCvN0vhLQOIbh74=; 5:rqd1Skm6D8PqVg0XF3kgVCnjaJb4qmrAQNVmJvwRaBq/c8cwwI08bXBbe9ZD27ATSDjsJkEHR8I7LZ7gMF3k1dFnVCKWVMxYUumiquSJCRGw+01Ponz73cKmb1jEIVg+8kFNpgACPzNLz+wPA2raY+jWy2qqU8ZMnBefOVAbqjg=; 24:nhJcK/RtL0h5llCGIlaCIm5ZD5T+yPYCH/Y581saTE0g8d1bAvhIFNlUqkCxgO0S0CIf3P9B2MvNwAUR/h21fMqRKECcPqTF+vn39MI0nGQ=; 7:gEpfkxgcLEfFKgLqBvZxxV7HFpn6K6YwZgiYKOoR5TJ+PBFdRusO8wU56cPJsdnFlhpyXljj7wRtSrKkm2Q7/M1Zn5xqG+cj7d6QwxyfUCWx9sLLnS8Bh5ZdM4MyoAXr9hP9yfCR1Fs8NlZ7Q7SdiXg9YGj0gddBR24r1P9ahjwnyoZMFS06PCuFsv+3qk1Legk5OyWDVRjaDenF1jTxvC7M6CQVQiaVcdlSvXKSHLYtMNJQf3B+vMbIoGkvaW8E x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 863857da-558a-4190-8f80-08d542d7d167 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307); SRVR:AM4PR05MB1906; x-ms-traffictypediagnostic: AM4PR05MB1906: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(72170088055959)(185117386973197)(788757137089)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231023)(6055026)(6041248)(20161123564025)(20161123555025)(20161123562025)(20161123560025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:AM4PR05MB1906; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:AM4PR05MB1906; x-forefront-prvs: 05214FD68E x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(366004)(39860400002)(376002)(346002)(13464003)(199004)(189003)(6116002)(4326008)(81156014)(8936002)(3280700002)(81166006)(106356001)(2900100001)(105586002)(3846002)(478600001)(5250100002)(102836003)(25786009)(53546011)(53936002)(6506007)(2501003)(68736007)(97736004)(110136005)(5660300001)(2950100002)(59450400001)(8656006)(2201001)(33656002)(7416002)(6246003)(7736002)(54906003)(76176011)(229853002)(8676002)(316002)(74316002)(2906002)(305945005)(66066001)(99286004)(86362001)(3660700001)(6436002)(14454004)(7696005)(55016002)(9686003)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB1906; H:AM4PR05MB1907.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 863857da-558a-4190-8f80-08d542d7d167 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Dec 2017 09:48:23.9857 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB1906 Subject: Re: [dpdk-dev] [PATCH v6 0/2] add uevent monitor for hot plug 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, 14 Dec 2017 09:48:27 -0000 Hello, I would like to apply this patch in order to review it. Trying to apply it on 17.11 (and latest) fails due to missing lib/librte_ea= l/common/eal_common_vdev.c =20 Trying to apply it on 17.08.1 fails on missing drivers/bus/pci/bsd/pci.c fi= le So, on what DPDK version should I apply it ?=20 Or maybe there is a bunch of other patches I have to apply in order to use= this patch ? Thanks Moti H. > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jeff Guo > Sent: Wednesday, November 1, 2017 10:17 PM > To: stephen@networkplumber.org; bruce.richardson@intel.com; > ferruh.yigit@intel.com; gaetan.rivet@6wind.com; Thomas Monjalon > > Cc: konstantin.ananyev@intel.com; jblunck@infradead.org; > shreyansh.jain@nxp.com; jingjing.wu@intel.com; dev@dpdk.org; > jia.guo@intel.com; helin.zhang@intel.com > Subject: [dpdk-dev] [PATCH v6 0/2] add uevent monitor for hot plug >=20 > So far, about hot plug in dpdk, we already have hot plug add/remove api a= nd > fail-safe driver to offload the fail-safe work from the app user. But the= re are > still lack of a general event api, since the interrupt event, which hot p= lug > related with, is diversity between each device and driver, such as mlx4, = pci > driver and others. >=20 > Use the hot removal event for example, pci drivers not all exposure the > remove interrupt, so in order to make user to easy use the hot plug featu= re > for pci driver, something must be done to detect the remove event at the > kernel level and offer a new line of interrupt to the user land. >=20 > Base on the uevent of kobject mechanism in kernel, we could use it to > benefit for monitoring the hot plug status of the device which not only > uio/vfio of pci bus devices, but also other, such as cpu/usb/pci-express = bus > devices. >=20 > The idea is comming as bellow. >=20 > a.The uevent message form FD monitoring which will be useful. > remove@/devices/pci0000:80/0000:80:02.2/0000:82:00.0/0000:83:03.0/0000:8 > 4:00.2/uio/uio2 > ACTION=3Dremove > DEVPATH=3D/devices/pci0000:80/0000:80:02.2/0000:82:00.0/0000:83:03.0/0000= : > 84:00.2/uio/uio2 > SUBSYSTEM=3Duio > MAJOR=3D243 > MINOR=3D2 > DEVNAME=3Duio2 > SEQNUM=3D11366 >=20 > b.add uevent monitoring machanism: > add several general api to enable uevent monitoring. >=20 > c.add common uevent handler and uevent failure handler uevent of device > should be handler at bus or device layer, and the memory read and write > failure when hot removal should be handle correctly before detach > behaviors. >=20 > d.show example how to use uevent monitor enable uevent monitoring in > testpmd or fail-safe to show usage. >=20 > patchset history: > v6->v5: > 1.add hot plug policy, in eal, default handle to prepare hot plug work fo= r all > pci device, then let app to manage to deside which device need to hot plu= g. > 2.modify to manage event callback in each device. > 3.fix some system hung issue when igb_uio release. > 4.modify the pci part to the bus-pci base on the bus rework. > 5.add hot plug policy in app, show example to use hotplug list to manage = to > deside which device need to hot plug. >=20 > v5->v4: > 1.Move uevent monitor epolling from eal interrupt to eal device layer. > 2.Redefine the eal device API for common, and distinguish between linux > and bsd 3.Add failure handler helper api in bus layer.Add function of fin= d > device by name. > 4.Replace of individual fd bind with single device, use a common fd to po= lling > all device. > 5.Add to register hot insertion monitoring and process, add function to a= uto > bind driver befor user add device 6.Refine some coding style and typos is= sue > 7.add new callback to process hot insertion >=20 > v4->v3: > 1.move uevent monitor api from eal interrupt to eal device layer. > 2.create uevent type and struct in eal device. > 3.move uevent handler for each driver to eal layer. > 4.add uevent failure handler to process signal fault issue. > 5.add example for request and use uevent monitoring in testpmd. >=20 > v3->v2: > 1.refine some return error > 2.refine the string searching logic to avoid memory issue >=20 > v2->v1: > 1.remove global variables of hotplug_fd, add uevent_fd in rte_intr_handle= to > let each pci device self maintain it fd, to fix dual device fd issue. > 2.refine some typo error. >=20 > Jeff Guo (2): > eal: add uevent monitor for hot plug > app/testpmd: use uevent to monitor hotplug >=20 > app/test-pmd/testpmd.c | 172 ++++++++++ > app/test-pmd/testpmd.h | 9 + > drivers/bus/pci/bsd/pci.c | 23 ++ > drivers/bus/pci/linux/pci.c | 34 ++ > drivers/bus/pci/linux/pci_init.h | 1 + > drivers/bus/pci/pci_common.c | 42 +++ > drivers/bus/pci/pci_common_uio.c | 28 ++ > drivers/bus/pci/private.h | 12 + > drivers/bus/pci/rte_bus_pci.h | 9 + > lib/librte_eal/bsdapp/eal/eal_dev.c | 64 ++++ > .../bsdapp/eal/include/exec-env/rte_dev.h | 105 ++++++ > lib/librte_eal/common/eal_common_bus.c | 29 ++ > lib/librte_eal/common/eal_common_dev.c | 222 +++++++++++++ > lib/librte_eal/common/eal_common_vdev.c | 27 ++ > lib/librte_eal/common/include/rte_bus.h | 51 +++ > lib/librte_eal/common/include/rte_dev.h | 107 ++++++- > lib/librte_eal/linuxapp/eal/Makefile | 3 +- > lib/librte_eal/linuxapp/eal/eal_dev.c | 353 > +++++++++++++++++++++ > .../linuxapp/eal/include/exec-env/rte_dev.h | 105 ++++++ > lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 6 + > lib/librte_pci/rte_pci.c | 20 ++ > lib/librte_pci/rte_pci.h | 17 + > 22 files changed, 1437 insertions(+), 2 deletions(-) create mode 100644 > lib/librte_eal/bsdapp/eal/eal_dev.c > create mode 100644 lib/librte_eal/bsdapp/eal/include/exec-env/rte_dev.h > create mode 100644 lib/librte_eal/linuxapp/eal/eal_dev.c > create mode 100644 lib/librte_eal/linuxapp/eal/include/exec-env/rte_dev.= h >=20 > -- > 2.7.4