From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0065.outbound.protection.outlook.com [104.47.37.65]) by dpdk.org (Postfix) with ESMTP id B72217CB4 for ; Thu, 1 Jun 2017 13:35:23 +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=EYf4EMlr+HkUntgW6invYyG8MvjhCqZVorrs0oXhtws=; b=fhyq+c+r3ZfRRtCK8IAG16wZ9iKXR9TPSDoIV5bdlSCy0N40dT1i0ZnvWW/WGDNiEY8edTY09yJIKvutCU9RViRxXwMq7RrXgPfPJQDMx8NYgBfNA1Gvx9hUudAlkMx6mxqJplTLJWGKYA2f/NCaYJFkEG6g9U4ySb3fl+HZ+ko= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost.localdomain (14.140.2.178) by BN6PR07MB3059.namprd07.prod.outlook.com (10.172.106.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9; Thu, 1 Jun 2017 11:35:18 +0000 Date: Thu, 1 Jun 2017 17:05:01 +0530 From: Shijith Thotton To: Ferruh Yigit Cc: Stephen Hemminger , Gregory Etelson , dev@dpdk.org, Qi Zhang , Wenzhuo Lu , Thomas Monjalon , Jianfeng Tan Message-ID: <20170601113501.GA2165@localhost.localdomain> References: <1748341.rbpcFmWp0q@polaris> <1496228966-18573-1-git-send-email-shijith.thotton@caviumnetworks.com> <20170531083010.228859c3@xeon-e3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: PN1PR01CA0091.INDPRD01.PROD.OUTLOOK.COM (10.174.144.159) To BN6PR07MB3059.namprd07.prod.outlook.com (10.172.106.141) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN6PR07MB3059: X-MS-Office365-Filtering-Correlation-Id: cba6809d-db79-4425-2137-08d4a8e24948 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BN6PR07MB3059; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3059; 3:BvC1QDChELc3ch4JQZltKHjcOWnXNavdtJRstzH/ZsaazGrAl6DtX78WizA6VvaHMb3S0qCoCVkw6fSOwl4FrVulczuhHe80pE38Etec9PHYNCcZkVp7n+pLnylR3mA9kYo3gLpH7KVBOIMPmnhT8sOKpHHLd1KfcDX1E+xYN8jt1fmzt5dXaefwpbmSMP+M4igt4yAvkSTwUY5PsgP5o5HIHHXlP9RRKvDhP63/zA4VvPLvI2DggvkxcmtYA6qxyTYupKva8U9pk04pdxWiydjA0YILewv709YUjTePSsPJdR01QbnrxeBeoLzGfHlOaubwNRON3vXGCsdbhgStrw==; 25:lEnBDfurs4eT5aFw2ItvRHJPOiXRnkUlgGJmttWK1IWB2bfMBwGTKlIgRRf5OlQokRfIpwZxv6tuL9JjqM8dpmHXxmt4MkK6RGgo9NEPMJkPuWPN9WX6D8FIFv0yE9tob/WfXjKSFAKpCJCcTF6MorG0Rnq/3peOmeCzwc0t9dxtBjhQ37OMektoAgeui3BrpZwX02+OesL38Lhe3vpVG8YU6yuyxOl7u4hEAjZDbIVfh3WekaWvNrFzd7vlnnKnOoff4LV2H7m0wzTylb+RIuve9UnXCkbTekoDIRv6x4/i1fOppNa6huBavDK2qVAKmY7fSz5hRX6g0148bTvImU67Owa+6QsomrvX7Tr287LuDDeId98YSfRMb1qjj3r+oSKftiC4LcSofXqc94Ux8T6UF/eZ4k8K9uPmNNYcawe6NBZb11pqAsxxPWcABM1TkZKfrUoZbVUHx6tvR5srj0WZ/fJ08JdyV+5X0gmxCN8= X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3059; 31:C7Ob7O3lJMW1E50+QoA0qf7snP9/hgvfVU1YfjlW/38uagEyKdHlE7Ims3bxzIL2bIvwfzj9vqo9G9uO9iLnkf1lEGG/LpI+5aZNeC0gzr83S7Q+BxcFKBvWOnZH0NBYNOf8oWb8i7V3M/A1PXz5EB6q2OYj8xnrFkiWXOLjO3p4g7IkcwxxhiNU/4Ph0MII28jJxX7qLSHRMueLk3IiL1dd0lPNlrVboK+BCwyZUbNsfAookiOt8xArPzI9sGdD6PyEnvy5rcG1RpY/gMxorQ==; 20:7cFeAlFSgX/Zjxb7TlIrV9DRgQkHtRMCuuUWiS+cZ3aIYgWUFbLFWqVijcs9QtJJuWWIK3WVZqV8C0fhDFR2n1Btr+5LVbhSfZFhLRcoe9Zrxew2yRYDFYgoWHCrTcJs4+DC8Zl2c0gf/RD9p+fz10Yw5iwRx8u8gtW1S78vF2i3wDoryXkoSo87Q52tMyn5cOYsdPpRuJZ88m1tbEQ1T97XwuVskJ+oQAUtNpwApQKpDFU50i39+VBKK+8+6z0RMa5SFkMT80uKt5E1YQefKczcihhrvPZhrGkCnXtZPXCzyzavPMYIqY+/Pc1rAjqW1lqQZldeVM11qWPi3XtVWd4LRIuQciyn6/qz5MXYXdOBnWej1k0cTBwP8+v7L/fB8K0UzA2d5JCY4BJWv/hGUJxU0D+tOEPBEQKpM4HFRE5cRe2zS079Jh7/Sm4OG746ky+bu/BNHmvUvFFhuDrt0BIalpNxJavx8m6I2SsgeOKOAbOqePEKzcgu4dXaTz5z2MrzwdZkZwL7Ky8y7+53aWas4zTAdW1//JzKL+9a3YneP723trRKU+bwQn4zhrwKRDkS2/LzYhFNcEta6ikPYr0Wp5UxgCbmAZXynpDLYQE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699)(17755550239193); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700094)(100105000095)(100000701094)(100105300095)(100000702094)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703094)(100105400095)(93006095)(3002001)(10201501046)(6041248)(20161123558100)(20161123555025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123560025)(6072148)(100000704094)(100105200095)(100000705094)(100105500095); SRVR:BN6PR07MB3059; BCL:0; PCL:0; RULEID:(100000800094)(100110000095)(100000801094)(100110300095)(100000802094)(100110100095)(100000803094)(100110400095)(100000804094)(100110200095)(100000805094)(100110500095); SRVR:BN6PR07MB3059; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR07MB3059; 4:rbMbo7hXrew7TfUK9reHn99oC7100Sdi2v5nTS8MV7?= =?us-ascii?Q?6yIrwfgPjO5sjEtboPX6Nov74UF6cNBRk0MecF+ZfR1l99c2P8X3QMurk0Hi?= =?us-ascii?Q?R+Rk7th1GHLW5fC7wvzjuXYVjsiB1HlYH13LV8A1k6BVnzsFhW5lCoi8jziK?= =?us-ascii?Q?rexSnQRwWSo1WIkcoB01LN5XqZdLu4gnIFdbPnAbgFvx3JdHln2ruxdgu7ki?= =?us-ascii?Q?FWQSYtsDZUY0LGi/s3xy9tOTdc9QETS/k4NH9Gs8Qj+vWSOOYG50hzBob5Hb?= =?us-ascii?Q?+E5aZ+vBda1QDndHihGtsVYpBG508wTHy4NTuTAwEIHJmIQF+VS62RsoEaln?= =?us-ascii?Q?EDgnwagQRmmbFrWR/s8/WoVCBLRDNarA1JIUp9w+b7X4ntEHm4OoY5C4K7/2?= =?us-ascii?Q?Hqrmo7oYOhUlQgEiThcben+3XD3+dudt6Y5I1uF3HMgx0MaKt2mQb+NYJ4jF?= =?us-ascii?Q?MIwj71G3yreUHIW0kfftRD6DjS7SkqEjVenrvc5RslbKDivTmLDBh+MA5aNl?= =?us-ascii?Q?Ifj0PAL9KYuT7b+9QtniaCFS6HUnDY4A3mVeRCFwXASuXzSlBeeM3RWKGlSt?= =?us-ascii?Q?n5VRfR7YhXwEWDorj78Bgz2F7GK5dpg/ypYBugTFll+la6ElpjK8Ba5eDlhR?= =?us-ascii?Q?uRRIk5Cu3+bqUe61mpcTqfg5oFohCrM9HcObJ4G5kmZgMVFxMgRgYqShLDfM?= =?us-ascii?Q?Kr6QdE5uTTssfk5Q6zwlQgsS2R+w3wx+gt/yDyzZtyMwu7WnY8xYte9BuUAR?= =?us-ascii?Q?JkrsNGt6fBs3oyhmX72x4onZUYLRSZrkuFx43DmD0NOZdpCLp0HapEf/VCTf?= =?us-ascii?Q?qN2/PwnGuvlDbrnNB8ENAvCvjiKFJt0afJpStW3+moMxV0+e+wGt21VN87bd?= =?us-ascii?Q?CNJO0UVRE10CZYLA0WqKTU7gu1qc9knMfLynlS3TFmLuS9+dAFl9aHWMFz8v?= =?us-ascii?Q?3BC7hJ9sD1DdwKbt6Yunc2frCaKCr45Gb43f43kQnJAuam2OlhTi+RfZ0g+N?= =?us-ascii?Q?yIQaBEA8z9AOzy9aDv1//XYqXGtsujUjk2B4jWwnaS0PU90MuPLQ70mMg9aG?= =?us-ascii?Q?vnilRjWAvoJfY2yDxM4dR93DUf221Zr+vZvaTKWAOBrgWZMxJFffj8JdcjFx?= =?us-ascii?Q?DfHSbOEWrvoP9wQVcT0MKNs3BDKUF7Apy+HZoCl2W/2h1NbPwsluypP4OQ1U?= =?us-ascii?Q?HhFpxlD5ZaC2aJ/CBhkbRv0QLo0JEDCOt5?= X-Forefront-PRVS: 0325F6C77B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(979002)(6069001)(6009001)(39850400002)(39450400003)(39400400002)(39840400002)(39410400002)(377454003)(24454002)(53546009)(229853002)(2906002)(3846002)(4326008)(53936002)(93886004)(55016002)(6116002)(54906002)(6306002)(9686003)(7736002)(966005)(83506001)(5009440100003)(81166006)(8676002)(305945005)(5660300001)(478600001)(2950100002)(72206003)(23726003)(6246003)(54356999)(1076002)(4001350100001)(6506006)(38730400002)(76176999)(50986999)(25786009)(61506002)(53376002)(42186005)(47776003)(6916009)(189998001)(33656002)(110136004)(50466002)(42882006)(66066001)(6666003)(110426004)(18370500001)(562404015)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR07MB3059; H:localhost.localdomain; FPR:; SPF:None; MLV:ovr; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR07MB3059; 23:FjRmzODaXN8TjRS/RRIBn9nGJlao9hZGfzkAjW1a7?= =?us-ascii?Q?dl9l/NmeSAgIcSE45aRMI+zZ3P9lrgSIsRvNu+A4r6zkxHhQP29nP3/tlzq2?= =?us-ascii?Q?+svq5COywstPEmGp9XauoQLQc5olR+CudnbLCgGPRGfz4ouq0Tkh3Azyp7Sf?= =?us-ascii?Q?T59q5DjbR2qFScaDF3EhTlchor++j0hNekccau1V8ujRlAGK+3B7v1GXL13g?= =?us-ascii?Q?0ljI0j7zR9uHZvid7oNWOXz+LVrGabyafcCjbIuHYVvId1pfqi0eHkz3M/PR?= =?us-ascii?Q?vgoZdrfsDiXClyRGrcQRihJCI05zu7zx13BIX+d1K1WlJl+gEBA5qDFTQBiy?= =?us-ascii?Q?hlYsb0lJmZHr/Ld4Scj8ZwbekLWINMRrQIRnFHc7WnU8iF4cXVloJ7xBxWq/?= =?us-ascii?Q?twJk6czUlrwuJfKUuB3vSXWJLZv6ZfSfjHLnO+67lIJPrOUSWOTfmWrlmEpM?= =?us-ascii?Q?/rmEf9Vz0YQdmHNcV2j0ZaXTj8XMJB7RyCnbffmJ4H80p4aXxDJGf4RQrTPs?= =?us-ascii?Q?gxogHy2+GjwMIbco1Ej47bjhtdVt/CSCJPDxg1+2QHxOSFjZ0nRKTq3nbxFu?= =?us-ascii?Q?w5EtDgn3pHrMQKcPvunZLbPgQneDgoYsbkdk8H7Rrl/iEj0aeqsiwT3HRYvC?= =?us-ascii?Q?xVTXWIyqbZCiP4VR3l/LiPXbtdUDsxXIzdA7rrD9a7ColL25TD5x0DXroXnG?= =?us-ascii?Q?AJXq4BoeLrGv0PZqF4nvwAjwIg/oKx8T3vbgTNlC8t5jbzs9h7C3xNguBRAY?= =?us-ascii?Q?yhsGIAjnI1ND490Mz9DA9Nna1eiYiDtavK+1buy+fDpQWD3T9BeBDVVxTH34?= =?us-ascii?Q?Cyz6YjszRX9k07aSoQQWTHe87Feehw9KAo1Rids4l6/7yxnlNiKjHksiVEfu?= =?us-ascii?Q?aIi2TvRP2JFVUhry//FTOa44lLRdui9IhafwGDy0kOWVehiLnz1rjfhfLl3V?= =?us-ascii?Q?cVsFMQMxFgLc68GVxov8XLgDsXhBK/Ph0F6vc+iHtT0WhDDEMD+3+gr8UnUc?= =?us-ascii?Q?bObqydtP3FrT93At4hRewg2MidIuYnSyWrdz2yl9qVBfq/l1AemXXhqhGVaQ?= =?us-ascii?Q?SCXjMCUFPonXGjoP1p5vquTr/xlbfGXgZ33L6XaIVWDkRRGFqqoyBIeVorY6?= =?us-ascii?Q?c6oNpUy3i42iy3SeH/U0hhzo1Ghl2fk0E8SwyFDg4yiWwJkm+k4fxInMKJjF?= =?us-ascii?Q?rLwS14AzGpGMQ3bdrIEt7w8IpbVozZH9n9YTKyySOuf7DZhCxsiGdL7UX/c3?= =?us-ascii?Q?PdFPADxrTl/evQ9zDGtJgYlYt5hh1aqlaYzZxt4Pi+mUUy0m2DtnlKhcrC6Q?= =?us-ascii?Q?dzjWzow/RIFrHqKcMvqhPtcKlA76btQ4GWaLnkmcUVuakMCE2M46elfd3/k0?= =?us-ascii?Q?FZITY/8bw3Rpmabim810fuEOoT6seGIOQqLAYvoedMYUopMrVvWFBMMeqp0N?= =?us-ascii?Q?oBQEaDxYLx2hwm7sFaYh9/fpju2P72sfBtexLRzJx2ZY1qdgeobC5zFfy67P?= =?us-ascii?Q?/TOk3rQNYd+ggkXCr5EizOKuqgBeKY+YG1ZqlRGvpYN56tr65pe1a6E?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR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6uUlfxNGgyHOKq/zuIBCT; 24:PipGIrHZEyqfTXLnMHRbhFG6Lw8azvxWfMytjR90GBGt3tN4ETtW+hQdi/PmY+HNn3toHMua23602GAy2nzR7RMw6ePSNm1OnbjIomGqxRU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3059; 7:J4qB5pB4unFGOQcQIhSJ9OO9UHskb84jgVT2P0/NaGhy5JoJnyDbgPLyTZ0GHSELaJhtGE2mnFUA8AEf4lwomI78HAPOq7jzBIWLZB76pDIfif9VeJFVicWVaT+SrYpq8O2icuOCRG2daCbiZCd56PXtkD0PLyomjQl14jFfbHPbBwmkvN59QLx8mTVyE2bR3ey45KJPhGBxAiLMVrHFN8vdqISTQUESb+J5nuvWedfN/CmRFJWmoW0joh58VDpS+BRewL10sD4LYKk0n6f/O3S5bRrp+X3G8OsLRBwdm3uFRy3hjMpOUIOZpR11YknDeP36pMCSZXNdMMSYaDW6Ig== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jun 2017 11:35:18.6308 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR07MB3059 Subject: Re: [dpdk-dev] [RFC PATCH] igb_uio: issue FLR during open and release of device file 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, 01 Jun 2017 11:35:24 -0000 On Wed, May 31, 2017 at 06:11:40PM +0100, Ferruh Yigit wrote: > On 5/31/2017 4:30 PM, Stephen Hemminger wrote: > > On Wed, 31 May 2017 13:20:08 +0100 > > Ferruh Yigit wrote: > > > >> On 5/31/2017 12:09 PM, Shijith Thotton wrote: > >>> Set UIO info device file operations open and release. Call pci reset > >>> function inside open and release to clear device state at start and > >>> end. Copied this behaviour from vfio_pci kernel module code. With this > >>> change, it is not mandatory to issue FLR by PMD's during init and close. > >> > >> Cc: Jianfeng Tan > >> > >> Jianfeng also implemented following patch: > >> http://dpdk.org/dev/patchwork/patch/17495/ > >> > >> Which also implements release and open ops, for slightly different > >> reason (prevent DMA access after app exit), but mainly both are to > >> gracefully handle application exit status. > >> > >> btw, for Jianfeng's case, can adding pci_clear_master() in release and > >> moving pci_set_master() to open help preventing unwanted DMA? > >> > >> > >> Gregory, > >> > >> Can you please check if this patch fixes your issue? > >> > >> Thanks, > >> ferruh > > > > pci_reset should stop all DMA. It also clears master status. Per Alex Williamson[1], bus master will be disabled after FLR. But a disable is preferred after reset, since all device won't behave as per spec. 1. http://www.spinics.net/lists/kvm/msg115715.html > > If so, should open() call pci_set_master(), currently it has been only > called by igbuio_pci_probe() once? DPDK has pci_uio_set_bus_master/pci_vfio_set_bus_master to set bus master. Can we leave it to the application ? vfio leaves the device with bus master disabled after open.