From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0077.outbound.protection.outlook.com [104.47.37.77]) by dpdk.org (Postfix) with ESMTP id 930387CD2 for ; Mon, 29 May 2017 11:49:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ISdRQ1Rh8glxQ90PTzHCldiTekGd6gYEflT3eu3oRII=; b=N3Ax7EGYxx1zQOtnme4xEvRErRbaMgweGoacA1IBtB/5PySb78+i0rlGIPMdmFew/+HpQx3V7y3yZf3KK34KR01X4DDPTJY+ReHASRA/5s6p0oUYP70Bh603KzeuYawWCBZCmvR4WQicaMthSOk374qF1CU8VzStNpG8d8Vxmrw= Authentication-Results: weka.io; dkim=none (message not signed) header.d=none; weka.io; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost.localdomain (14.140.2.178) by MWHPR07MB3072.namprd07.prod.outlook.com (10.172.97.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9; Mon, 29 May 2017 09:49:15 +0000 Date: Mon, 29 May 2017 15:18:59 +0530 From: Shijith Thotton To: Gregory Etelson Cc: Stephen Hemminger , dev@dpdk.org, Ferruh Yigit , Qi Zhang , Wenzhuo Lu Message-ID: <20170529094858.GA28265@localhost.localdomain> References: <106841857.Z7q1jSDIte@polaris> <2910302.37N35vC6kd@polaris> <20170526085321.75582301@xeon-e3> <6458984.zlYVzvDLUS@polaris> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6458984.zlYVzvDLUS@polaris> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: MA1PR01CA0072.INDPRD01.PROD.OUTLOOK.COM (10.174.56.12) To MWHPR07MB3072.namprd07.prod.outlook.com (10.172.97.14) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR07MB3072: X-MS-Office365-Filtering-Correlation-Id: 4ac21f86-8cd8-482a-75f6-08d4a677f934 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:MWHPR07MB3072; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3072; 3:4hUQuqHpDqYOJANVY21dmA7sxJevnuXQ7G0ajXPx0Pw+6POxahcxUD8mQdcxLSTqtvwh6TqU21aSAfYBFhSKxaePc+iK9KRJyZKZv+nxHkst1mwFIPZ10ERJrnVP+JYaHZsr46VfrfMwf0dV+jFFWDO7pY4V6Vvo/O5v+hI+xD+bCif8FgktocCFU8nsxVT1EnLtnCs3v73XZU6X0KguMmy09jW1/y2tB+bzAc57q3/6MaDAfpENAgsSCe3PCSfich7lCpBYeCWF0oASc3ztP/syv9wMVXZ0fO0TXYSebqboQtdVPnIGg8m4QLEa0SNsmXkbKIyml5e4MV9eNyiz/g==; 25:wwMLeOpBuOI+KWRxAcT/X8uNGPprdLpYmPSQ92LOuLyv50djxedADe+0pdcxJkanvBsvsvfv619J63+Kvew68pPqBn39y2KU/DrcRxq3NJTGrvPaeD9AlPKnb9laclRVcC/Js1bij8fzS3ilszcI129yk1D2B742m6yp5YxgyjnzGh3YPJWy3cO3RDoanFEf1cbQFRWS4l6H/EdWlp/YM6XvhOYSYToyHXypWoXKjhNLW0DAJ+kw+KybPdK92FT/Ww7gENh7aLLz+75H6B8340iLxBMuOUiva3epFPxI/MRiiLmsYFo0cGyy9nepbRM0SgaGFOLm3nVV97fpvM03iQ6m7jx1vU7oxaJoi2YbDTUxV9caxkzCxYhA1Ar69UQRiLHhgUKvAt+IO5XG0kAFQz+I7qKOwSP0Dzt+Pwz2sA43N0gIeRQtwVFHiOzrR3TK0Eglup6OySU7oW4tJrpwhLOfbUZfhVCWIeY5iWFQVBs= X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3072; 31:NC1CbM8uboRoAQLXJgGkTL4XDbTitx4+CeYtSBGQ0+ra13Q3VogTvmc6umTOz1UCoGi2AzUWuMYSGX5ZLkDHhAv2jCcHdt/7ekMZp0xEiB231TebTzD5Wg4cL2jej1LVzN1+m7RoM3oLcGqA1VDSYBye234YOPVDfpBlRZDJ4lLaQASr7G7LrrVsh3nO5DOIMyckLOYe1gr4TSpX6PLRlW5tL4xI2x/1dQSB72BX7larcLi4/P3knTbmAoUsN2J3; 20:PpMBCD1xai7cmwYopZKsLIkGe8YkIzprZIscxh8sY1N9KGGdALuRlXM4o8shLMhoBkqwadkBHT1p1mVqTw9TB1QbCdPoM7thyRXA9/Da8ym5yAuH4Km/OIGsKctAf1m4SHu8JaeUXfxV7cJNe6FMWKnjGdihCgWAL4KpAfVZd0qGDNTgkpYTmmt3XlrUR+ej/VnlhjjEzEGA6YT3PwzBwxgUakL/5oLT2H/LTYO2TCFLXMHyz+d65temnIrt25Gv5Pfuunx14oyskZ7/kpkpyATSMdVo/N/jZdtj6HHYnq7NQk/AaZCj3MTXvb99AtN5s4ZfkDfDxADL0Ni9fHwRapIMZ1cZ71r7qCu8CCWb2nlhz/EICAkQcpFoRht87EjJFCoUDCuBmYICP0CHdeJ/U8udezSK0Qwb3QByuM6NYKCtdD0vxgQUls356I1CbZ0jhafAcI+dpgexxCHSDtV+Q+pUGHI6pOu6vShToDyAlD3qUgze2e/R0RigJM4FK7GWAFzg7+w6CGL9J5RZ6K91SC/a9iWYEVoKD+PTaj3bBCdpIbiNRDMIdHgXutOuXygL5uLfEtBHq5pzMUJtPg75QcePKdvFeFvn5VE9OqqltSU= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(58145275503218)(17755550239193); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(93006095)(10201501046)(6041248)(20161123564025)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123558100)(6072148); SRVR:MWHPR07MB3072; BCL:0; PCL:0; RULEID:; SRVR:MWHPR07MB3072; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3072; 4:U6FnQEzUX7Jk3y5O/YX2zMOo5/nJIBd0FSoE6ScIYCzWWvvC8/el1ipHkhUNLX9QGLr9hNiG3IIJPm2Vi2ov5IRSH8mAOUNTkgJZi5bBmzyIBTtkavYnVxlazWR80S5Wyq7GkKwFpiqe8DkvGaTR1ZLFZL+Hb0pEe1wUNU88rcdqQHXBB64/+HN2yPuFKBqSxY+Kb5PHZbj953oBQoDgJFyvSJhDP7VMuAmDKMjWe6EplfLghdnAMCksdN7voqalDQpeQwAzZc5t+RyrvKj62RXn1IoLo3ImKRkoKprD0KeJY2oCAn28upjiA9txeNdoiTIacSvdM2zr60LJSYu4c6BJYPHyRXXfXFV2bx0+ZWbC2yTZuFX5Cb2eOkcc7M5LifMIKKMT1FvIfK5aJZOOCkZBN9OVW3f70fak7//042gIip3xPWtSMlZHFFGdM2MDaFzGjN1rE6FVX1sBPQwkC3lxVM2o8aTPxDr63E64orv8GX04q5rBU4f+TnUPczGMkCI6idj+X5OGxnYYWkelPQ1Z+OCvKChgFc+5vPDL2zpRC8Sp13H+/44QUssF3+pqBHFE8rzXlCbsoyt7ZYoFGTCQvvyOEV1lB2ur1Z53Um1vAWQ0uA/GF/+SUh7HgXzbky0EWAMXUHqWvXhKa7AcI5FQdMcqvIOVBQBQeKl0IpCNtxJLOAXdp/xpK8JTzZLwiOu05DavV/oA9Z2DzCJSx27D1MxULVQnsaf21xMtDYmhEQailsdjjEeaDF9q/WUdFMc/OrqQCtUtANdb8RdtoP7RaezVm/NGrTlp2WNdxapdkcSkrwT6tEIne+7J9w77JCLa9Sg3uYIrRyDuWUNu7Q== X-Forefront-PRVS: 0322B4EDE1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(39850400002)(39400400002)(39840400002)(39410400002)(39450400003)(24454002)(53936002)(54906002)(9686003)(3846002)(6116002)(305945005)(1076002)(7736002)(23726003)(5009440100003)(6506006)(33656002)(66066001)(47776003)(6246003)(189998001)(2906002)(25786009)(50986999)(61506002)(5660300001)(76176999)(50466002)(38730400002)(55016002)(110136004)(54356999)(83506001)(42882006)(6916009)(6666003)(4326008)(42186005)(2950100002)(72206003)(4001350100001)(8676002)(478600001)(93886004)(81166006)(229853002)(110426004)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3072; H:localhost.localdomain; FPR:; SPF:None; MLV:nov; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR07MB3072; 23:zPfMV/WoYOMGEMeILHdMv3ObWDpCmRdvZi7UsgQDe?= =?us-ascii?Q?cT3mGNDZoaE/N2UhsxvNqOFbGu5nBrAfXp6U86yAkHAZgDDYexsHfCSExCpz?= =?us-ascii?Q?YQbm/mWZ96VnmktFAvOpQYp+sXytPrK58jFzA9VY7THBekv2cQsyDFusvn8A?= =?us-ascii?Q?rrgl+N5NnWcGQb2gMF0qQ0Mx4FSKIj0snCk11lLkQtRCKOmvib9jKt9div7Y?= =?us-ascii?Q?Vg2+NmzlagnJdq9EO0wBuTFE8slJzJAAzw6eAuRJnbRBgejvoZlQo++kGMQp?= =?us-ascii?Q?uPOYfI3BWNbTh40W4Fkr7Y7XOZO4Af3p89812NcjbvP/9yyOdUCC63kfEGim?= =?us-ascii?Q?+a1caSoUVVIYgHUtUf0MvlyhcJ2t+LcJtf4EMhet9DQtGvw63LS4ElMz8m08?= =?us-ascii?Q?rzohVlqhM7lGHEoZ0uQ2NdZ5yxqDknciFXvIITe8qe2RWFHv2LzhJ1rKaFAt?= =?us-ascii?Q?bEKOjJ4gBOFhpFXXd9s7Z1qQWO6oMXKG+uBOKfp2+OUlnGU+ePcGlFhwPAQN?= =?us-ascii?Q?mauPKG+WQSplCWpC+ACy3ZlKOO1BF/GfI9K7s/5Av5ldhfuTp326URQhEU3I?= =?us-ascii?Q?KkxgAxUocMXn0L4+CIEijcTDcn86y6x8gf/z6KkKOPiS/yhB1U/ACZhePD+S?= =?us-ascii?Q?p+wjAG1ONknJXA3aVEd+9zmo7Z+6R4dwonWoxzbKDEHSt8AR6M8xbWoB0Up9?= =?us-ascii?Q?4in3yDvo1n+As05dtOgt+cm6t0jXNxAxnk70gPwAWlSehNcX396sNrTB0HP2?= =?us-ascii?Q?47SV7ZBdi3prPRmiFtkeytELktiAAdOyzKWx5jJ+mWUov6Q7vJEkydpRJH9o?= =?us-ascii?Q?Pz+zEek3hW/Xk0WKtnuqlhowK1dGKvmwaU3DIassqIr0gTthyNuFfAojhDPo?= =?us-ascii?Q?AW2c5DPvXqMjLevf38EsLq+xl3w+/hu/7HK6wkGa7PBcS9vlsTcgzDuyiOSp?= =?us-ascii?Q?ax/VVElk+jQoYj1Fdimj2CVMmiNBA4Zq86BIFSI5Y6DDWZb8FWzDeaHV1blZ?= =?us-ascii?Q?TUlOU9INrL9iS0mXUK7PbOz8T8sP0L9feJR+lu9sGuSvmrsoAJhPqVU/jhGA?= =?us-ascii?Q?sWuvL53B9P1Dp0iGKeNHmd3/JTS4cl7AZJqx9cl2do25ANz9pq3YgPxFKQi4?= =?us-ascii?Q?izT7PyLCGp7EXxlNytYBHF1Lm510aBbpPowzpa4oNClIWKEUs5yZE679yULE?= =?us-ascii?Q?qy04EL6dA7PGQ669hDUEOOEqD4ILE1UqWaqrw95CAQmWdl9nMiLKxlxbIIzb?= =?us-ascii?Q?jIghIl8ETmXuwDRhSj1i4JcaOojkBbRbMzFtoX2m74T2vXnTPnJLs2UHDrGr?= =?us-ascii?B?QT09?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3072; 6:jOJNrZagY/CJ+xisvwJ1rpZ/KmPDE5c/t+3kBSucY5BPz0lWuy5P+nJIbVrKjshYTnvpIjZop4lZlGAq6P9sgjAYv0WY+cRKnYmaPZwytyTVbGsy1jOh+ncUvVIUNolybThZzxf06zX6XYrDGgY3oEQrX4hf4W7E+dM8xPM9XtkBK544Kw8J8jpJW9A9V9GzZswF2vELeiMS6qbssNZX7Sh3FNJR8b/PluKyXDGvy1TxBzYe9yO9I7k1G+VxLEbZ1FXfDWoIVznqSasA2IYVVQJOKtsW8mCXiiEhFVE2ZN73CspfnnHG2Qa4OL7lxP5oav4DW8fhIMYn+hJrh7enz9cucOrm591lqLLrxt03BKQLDnB+xIkVJDAQROi4R1B0D445dODmu4euuqxKxEo8a834B1rM/aEgYaGclhbPMpRlN16VNoOGe9PpHf6atWHHFubKrTI85pkAYQCMlp2AAD3ia2WbYk4me/heduKhFgKp7ce+ZxOfP3JhWygzTSHxQpmZFn8r5tHfxnQuzSAvpA==; 5:5omU88xRY0ptwztlaq/QNUbqDJKy0j3xkF4RcIvKq2eN/jeE99Vv1z40BBluCSuvsaSE2Z8FxINdMBa5vToc2nOy9g0yKn75NqSVE9ysUZrgMqWvQxgDPVnRtWIKfv/kKNqEmU+tMDItAj+jeyNiNA==; 24:mqefhI6D3yTyY5lhmbpGKGom/SLKi6qzpgysvjOcbaHr2a5JLRn3JlORnpKWmNGFmOaiLseW/ivT6c0ufh39JTRiAMpj9sTlT860By8oRvA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3072; 7:3KnbM5BGVdSgwGv3B2rJ7Fwwicb+TsfV3/I8SxbYlVvuyltPTlA0+j63ARf985xpHYMVOTK4T9RwgrfGgHyvliRKkFIgzVnnBt5cyEMadUYya33U55+LVspGBU3ARFI0ZEogL6YSyAvaKzvDKGBw02AVWbQwQr1wQI4d9y1AZSREBTLDS85WpHV9enFYB0AjvpfpfaBMpFLXrFZUPCmTm6ERXZIGZmvv77K1FLxqIssO14iMzxlcK7tan3JPmU+M5DgngVge5IOBqMwIlD7xAkequsOwtj0kGXXB7PWj57KoHcJxSbwmjHagtwZoRNEgODmq0eLtagEHNHRWIK0PCA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2017 09:49:15.9147 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3072 Subject: Re: [dpdk-dev] i40e igb_uio: reset pci on process exit 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, 29 May 2017 09:49:21 -0000 On Fri, May 26, 2017 at 07:14:55PM +0300, Gregory Etelson wrote: > I did not look into VFIO driver yet > > > > Regards, > > Gregory > > > > On Friday, 26 May 2017 18:53:21 IDT Stephen Hemminger wrote: > > > On Fri, 26 May 2017 09:17:33 +0300 > > > Gregory Etelson wrote: > > > > > > > Thank you. > > > > > > > > Regards, > > > > Gregory > > > > > > > > On Friday, 26 May 2017 09:05:11 IDT Shijith Thotton wrote: > > > > > On Fri, May 26, 2017 at 07:30:58AM +0300, Gregory Etelson wrote: > > > > > > > > > > Hi Gregory, > > > > > > > > > > The patch is useful for LiquidIO PMD as we can avoid VF FLR request > to > > > > > PF. One comment inline.. > > > > > > > > > > [..] > > > > > > > > > > > > > > > > +static int > > > > > > > > +igbuio_pci_release(struct uio_info *info, struct inode > *inode) > > > > > > > > +{ > > > > > > > > + int ret; > > > > > > > > + struct rte_uio_pci_dev *udev = info->priv; > > > > > > > > + struct pci_dev *dev = udev->pdev; > > > > > > > > + ret = __pci_reset_function(dev); > > > > > > > > > > s/__pci_reset_function/pci_reset_function > > > > > > > > > > > > > + dev_info(&dev->dev, "pci_reset_function %s \n", > > > > > > > > + ret == 0 ? "succeded" : "failed"); > > > > > > > > + return 0; > > > > > > > > +} > > > > > [..] > > > > > > > > > > Thanks, > > > > > Shijith > > > > > > > > > > > > > > > What does VFIO do? > > > > > > It looks like in vfio case pci_enable is held off until open and > pci_disable is done > > > on close. There are other things that may need to be done to make close > work > > > correctly. Like turning of msix. Also reset may not always be possible. > Better follow VFIO as Stephen advised. VFIO does pci reset inside open[1] and tries to reset device during release[2]. 1. elixir.free-electrons.com/linux/latest/source/drivers/vfio/pci/vfio_pci.c#L229 2. elixir.free-electrons.com/linux/latest/source/drivers/vfio/pci/vfio_pci.c#L361 static int igbuio_pci_open(struct uio_info *info, struct inode *inode) { struct rte_uio_pci_dev *udev = info->priv; struct pci_dev *dev = udev->pdev; return pci_reset_function(dev); } and.. udev->info.open = igbuio_pci_open;