Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp536004lqg; Fri, 1 Mar 2024 12:40:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX7jv0rbO2EW6XXCzG02vbTVZzuM8WwfII8c84aneLEBf0Zy6b+hF6UXAXE67IxKYKFgxtjjSBHFEymBgEMerJ+aAuhQUJA7sgPSHnPQA== X-Google-Smtp-Source: AGHT+IEVLGYwXAe57JrDQRvo0zd4kF/+jnMBC0mIeo9jVEIpGK6eKJGFtsKRRNAFyfvbq12VoUkL X-Received: by 2002:a17:90a:bb96:b0:298:b9f7:83f7 with SMTP id v22-20020a17090abb9600b00298b9f783f7mr2684308pjr.24.1709325625677; Fri, 01 Mar 2024 12:40:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709325625; cv=pass; d=google.com; s=arc-20160816; b=MV/v2GSOtN+o/xVY0/v2mj0QCEEjNmeBLKo9U0aa73on6w+UHiufZ/Ry5CiHv5RJZK gh525gh6De94+Kp+FAudnPL9O1pv5Hsha4oZAyMujiSvI2YfxSz9YaF5E2YoCbUUGBAk DjGoL6qP9SVneM6ZN3tWBrEePXvfLmOR9ppRR3aHO6XAsbDS3vBk2y44ytNW1UuHkd4U pKykdJAaye3fKSEm+kggjbyaxKJSNmhB2DAphfkNEz2MGFjwoKIqFBBU2p0LPs72YunA bD7jfHmAAFHetzBpNIL/50OulIw9s59piE425rIeJkJ6bnUwTNLWIvKIJkgft4oHKars 8FHw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:references:message-id:in-reply-to:subject:cc:to:from :date:dkim-signature; bh=DiUWUqRoyxbQLllthQlrMuid+mISe3YGYwqfaf6BNIk=; fh=YBlZxtiIrshkk8PoAKgf2DqPtYwsjufGkGuxtOJsnfo=; b=iKPzPoAdWmF6huAlX0G3yx5funzQM49DC6XBmzmgNI1tI4lwh86n4Njmj+KC+lgLJZ DeXQokO4QbpibnGSBKqNRdzzx3w64YKpm1zjjlhljA7kEdP9MVV1OPabuuSDqJXDiLOF 44dW055bmdlDQuW9Qeqz+kYTRcdJMY4ZLNMBghnusHpPtGQ6rv/W0lSMdPymv7Odi3oH VSaUMlRN8PQkLXFLbRrUTlDaBlDywkfV6AoH9Q6ZkbJgJXtwNRWu1sjFrhYm0OZ+KA0W xgHgAj5XxvDsWvXxrFdJtrwq8eBqHcweMd3Mr5JYmskHUzD6oqjKRsv/QKoQJ2xmom6z OUJw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hscPwgTO; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-89099-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89099-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id lw5-20020a17090b180500b0029b02a58a7fsi4459090pjb.10.2024.03.01.12.40.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 12:40:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89099-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hscPwgTO; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-89099-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89099-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 3E9372877B7 for ; Fri, 1 Mar 2024 20:40:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8FC183C499; Fri, 1 Mar 2024 20:40:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="hscPwgTO" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F40FEC132; Fri, 1 Mar 2024 20:40:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709325619; cv=none; b=bVOz/KMtcBXdSJS8oNlbuXeID/IvCCId0Hh/cyZJ7JZLVFaRBpe4H54sykKmSCs5jBs8yQslIa6MtWlrkqM05cl9U1Mw5fK/8yMm9UQTkOBBzoTNjTwwvDNvR+U/tQWZzhJkW99Q0L16rGlch1qk6jVpQD89Krf7sYZoAJkQzR4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709325619; c=relaxed/simple; bh=ZwhwYeZHjwCE+vDRa8E+VJ06lF+5Z0Wtom9hTPOPs8M=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=Wamq6H8UYhky78iDOLTJwrc4JLT3zP6SR2PlwzTLMWS47VdHM6fouujT3c1Jn6g2URdrjWKAJf0cYMxn5Tud9Ob5si7y3numYMpI/upFaRfxg/qR38xHoSz5W8Ui0JDOKQX9Esj3dxHVGfnHesM7zqFzAzUDU9ejtaBcQAXLplg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=hscPwgTO; arc=none smtp.client-ip=198.175.65.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709325619; x=1740861619; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=ZwhwYeZHjwCE+vDRa8E+VJ06lF+5Z0Wtom9hTPOPs8M=; b=hscPwgTOcCkqnNF0Z4n5cAm4OhXl2w0iVRENYarPm4cWNu8b4+kMAfog +RMVmVH9OX+yRaiPAjKjkE7+UjyxMTrou+Vi+Vj7vLa6ectjRGDbNjXYI CiYpHZaQH2tveb9IPiDo5Az00Gu9Ui1tuWOf8pZ7aQV80n6c+1OOc5MIz wDjXNSX0dmY8fOC3dC8+SKA6te9CACC5HqH9osdzh9Vpr4tXqQw2FOMDI x2XLkijVunz8CG/k6w9LqonkOv5+rSsh8K7bfIVlfB9XVH7Rw9e4JrS9n iz8pKwURewsy1gbjPD6vDEh3441w0F5DGsfUdZ7V8lQCu9p+9yhzVYduO Q==; X-IronPort-AV: E=McAfee;i="6600,9927,11000"; a="4000389" X-IronPort-AV: E=Sophos;i="6.06,197,1705392000"; d="scan'208";a="4000389" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2024 12:40:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,197,1705392000"; d="scan'208";a="8243052" Received: from sj-4150-psse-sw-opae-dev2.sj.intel.com ([10.233.115.162]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2024 12:40:17 -0800 Date: Fri, 1 Mar 2024 12:39:24 -0800 (PST) From: matthew.gerlach@linux.intel.com X-X-Sender: mgerlach@sj-4150-psse-sw-opae-dev2 To: Xu Yilun cc: hao.wu@intel.com, trix@redhat.com, mdf@kernel.org, yilun.xu@intel.com, linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] fpga: dfl: afu: support Rev 2 of DFL Port feature In-Reply-To: Message-ID: References: <20240125233715.861883-1-matthew.gerlach@linux.intel.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed [snip] >> >> Hi Yilun, >> >> I think this conversation has gotten a little off track. This patch only >> changes the port reset behavior at driver initialization for revision 2 of >> the port IP. The behavior and the requirements of port reset during run time >> have not changed. The existing implementation requires the user performing >> the port reset to ensure appropriate SW was quiesced. This patch does not >> change this requirement. > > You are actually adding support to the new devices behavior defined by > revision 2. Previously the user requires the management PF driver to do port > reset, and this only affects some logic in the PF itself and the impact could > be handled inside the driver. The current PF driver doesn't actually do anything > because it (or any kernel component) never touches the disabled logic, and the > user accessing of the mmapped but disabled logic won't cause system issues. I'm wondering about the use case when Virtual Functions (VFs) are enabled with the current driver. If partial reconfiguration of the port occurs, which includes a reset, what happens to the user software attached to the VFs when the hardware has changed out from under it? While the current port implementation won't cause PCIe errors when the logic is disable, something has to notify the user software that the hardware changed. I think the user space software would be typically notified of the change by the orchestration software performing the partial reconfiguration. I think the use case of VFs with the original port implementation is logically equivalent to the new port implementation with multiple PFs/VFs. > > But the new management PF does port reset and affect other PFs, and may > cause disorder in other drivers. so you need extra code to support the > behavior. I think the real problem is that the new port is not doing as good of a job preventing PCIe errors during port reset as the previous version. Matthew > > This patch does make some progress, as you said, "With revision 2,the > initial state of the logic inside the port is guaranteed to be valid, and > a port reset is not required during driver initialization". But it > should not be the only patch to enable the new port reset behavior. > >> >>> >>>> >>>>> >>>>>> image. I don't think the driver performing the port_reset() can know all the >>>>> >>>>> Other PF drivers should know their own components. They should be aware >>>>> that their devices are being reset. >>>> >>>> The other PF drivers depend on the actual FPGA image being run. >>>> >>>>> >>>>>> components to be able to provide any meaningful management. >>>>> >>>>> If the reset provider and reset consumer are not in the same driver, >>>>> they should interact with each other. IIRC, some reset controller class >>>>> works for this purpose. >>>> >>>> The other PFs in many cases can present as standard devices with existing >>>> drivers like virtio-net or virtio-blk. It does not seem desireable to have >>>> to change existing drivers for a particular FPGA implementation >>> >>> If you have to use a specific method for reset, it is not a standard virtio >>> pci device, and you have to make some change. >> >> From the perspective of the PCI PF/VF implementing the virtio or other >> standard device, the pci endpoint is completely compliant to the standard, >> and no driver changes should be required. As mentioned above, this patch >> does nothing to change any of this behavior. Consider a port reset that is >> part of a partial configuration flow. The virtio endpoint can become >> something completely different with a completely different driver. This > > Then how could the virtio driver stop and remove itself to avoid crashing the > kernel, and how could the new driver be probed. If the answer is still > userspace responsible for everything, that's not good to me. > > Thanks, > Yilun > >> patch does not affect this flow either. >> >> Thanks, >> Matthew >> >>> >>> Thanks, >>> Yilun >>> >>>> >>>> Thanks, >>>> Matthew >>>>> >>>>> Thanks, >>>>> Yilun >>>>> >>>>>> >>>>>> Thanks, >>>>>> Matthew >>>>>> >>>>>>> >>>>>>> Thanks, >>>>>>> Yilun >>>>>>> >>>>>>>> >>>>>>>> Do you want me to update the commit message with this information? >>>>>>>> >>>>>>>> Thanks, >>>>>>>> Matthew >>>>>>> >>>>>>> >>>>> >>>>> >>> >