Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1112161pxu; Wed, 2 Dec 2020 11:19:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJwGGTh/YNcJ4dTuiI93gQcxMMgSNib8xt4MOB9gIPt6zw9uix9kb+0QfOBnesgw66Ppg7IJ X-Received: by 2002:a50:e042:: with SMTP id g2mr1467783edl.292.1606936758127; Wed, 02 Dec 2020 11:19:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606936758; cv=none; d=google.com; s=arc-20160816; b=XLG3xDmaAaSBxIJLyaHSPtYw+pfHpnPebsWI+IEs7UMMAs0lNWXILMVPobDd1XmqpD w0/pIi+4jYGHxGnj+4FJQc0uAFUvguJIaNmUq+1gdRZQWPWQt8eld0XYOoOGd/lFErnt 52OIjoKtZoEhXCjoFAeB1DFNHl7IVTGW0aXlmB4gzVfnOghcrsQd23ibzoNtrdBC6Rdw UJ2zM9UOGll4xFMTtxLJO9CT7Dg0b48xuzTTKzpaA5y7vrONZsx9iwSOQnTW+mKYdVL+ GOnJU3GGZrBkDfleHd94d8Kp4hGPRXKS6L45zUuQCo8/rUaMUcAdEn0IUbCB10+GEM7G 5vfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:ironport-sdr:ironport-sdr; bh=jpG1/X9+wNfQVRkxXuVNP4eN3rZc8JmYCRC/Kj8dbsk=; b=PTBbtABYsz1buRkum4SbHMdrCaTTHkMMTyB51UNj8zpJfS3+ciMQkFNIu2XH2xj+k/ PLL0Alq2XxvVroL0Co4oF8b2HVbRhUtmozFL61rZ22BpVYp82/vkbkRaGB0GjvAOgGZ7 GxwGNG6uNil8JM9lLcRTCiLFOnjQzD0B8rrHKrlKl1JcJ1JfK0lzfPkg8vwYSjluj0vP 246xixIt5Hvx42O4vZkLcXbsChezB7dR9Pp5mqRyPT0NCeJRgPJYrJ7BkLoPHu3FuZmg BQlpV7A2lKZJ3ZSUjgzQWE5wrGt1CzlJAm44NHafGa9K62FNIIMsaOCF1cj8YisC196Y PuXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m8si560830eja.18.2020.12.02.11.18.53; Wed, 02 Dec 2020 11:19:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728837AbgLBTR1 (ORCPT + 99 others); Wed, 2 Dec 2020 14:17:27 -0500 Received: from mga12.intel.com ([192.55.52.136]:21267 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726104AbgLBTR1 (ORCPT ); Wed, 2 Dec 2020 14:17:27 -0500 IronPort-SDR: lAjN+e6r5fPIsEWcnhkITLsgvRDowoq2ruRM8373uAdLyYCoEEMZ+6IYD4k758yGbxZGz+rUs5 1hksupy36zZg== X-IronPort-AV: E=McAfee;i="6000,8403,9823"; a="152325602" X-IronPort-AV: E=Sophos;i="5.78,387,1599548400"; d="scan'208";a="152325602" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2020 11:15:45 -0800 IronPort-SDR: Uh9yPqqdb4FzpskxN5HT0WaSIXe9PqQXfA5nynZbX9f5Z2JvtIH00ewQxt3HoY8gLq3jlEN511 c3HRr8V8jrZA== X-IronPort-AV: E=Sophos;i="5.78,387,1599548400"; d="scan'208";a="550185358" Received: from rhweight-wrk1.ra.intel.com ([137.102.106.140]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2020 11:15:45 -0800 Date: Wed, 2 Dec 2020 11:17:01 -0800 (PST) From: matthew.gerlach@linux.intel.com X-X-Sender: mgerlach@rhweight-WRK1 To: "Wu, Hao" cc: "Xu, Yilun" , Moritz Fischer , "linux-fpga@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "trix@redhat.com" , "linux-doc@vger.kernel.org" , "corbet@lwn.net" Subject: RE: [PATCH v3 2/2] fpga: dfl: look for vendor specific capability In-Reply-To: Message-ID: References: <20201124155658.700976-1-matthew.gerlach@linux.intel.com> <20201124155658.700976-3-matthew.gerlach@linux.intel.com> <20201202020003.GB22103@yilunxu-OptiPlex-7050> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2 Dec 2020, Wu, Hao wrote: >>>>> >>>>>> + } >>>>>> + >>>>>> + offset = dfl_res & PCI_VNDR_DFLS_RES_OFF_MASK; >>>>>> + if (offset >= len) { >>>>>> + dev_err(&pcidev->dev, "%s bad >> offset %u >= %pa\n", >>>>>> + __func__, offset, &len); >>>>>> + return -EINVAL; >>>>>> + } >>>>>> + >>>>>> + dev_dbg(&pcidev->dev, "%s BAR %d offset 0x%x\n", >>>>>> __func__, bar, offset); >>>>>> + >>>>>> + len -= offset; >>>>>> + >>>>>> + start = pci_resource_start(pcidev, bar) + offset; >>>>>> + >>>>>> + dfl_fpga_enum_info_add_dfl(info, start, len); >>>>> >>>>> That means everytime, we pass [start, endofbar] region to dfl core >>>>> for enumeration, if there are multiple DFLs in one bar, then each range >>>>> ends at the same endofbar, it seems fine as enumeration can be done >>>>> one by one, but ideally the best case is that this capability can provide >>>>> end address or size too, right? It is possible that information can be >>>>> added to the capability as well? then we don't have such limitation. >>>>> >>>>> Hao >>>> >>>> I am not sure having more than one DFL in a bar serves any purpose over >> a >>>> single DFL. Regardless, I think the consistency of just having Offset/BIR >>>> in the VSEC is better than adding more infomation that has little or no >>>> added value. >>> >>> Agreed. Can't you just link the DFLs in that case? >> >> I didn't see the value of more DFLs in one bar either. So I think we'd better >> document it. > > Yes, it needs to be documented well, otherwise users may have their own > choices, e.g. link 100 queues together by modify DFH registers of the > queues one by one, or just have them done together in the VSEC. I am not > sure which one is the easier way for logic developer, but at least we need to > document what driver can support. > > Thanks > Hao > I will update the documentation to clarify the basis of the rule of one DFL per bar. Since we have a clearly stated rule, we can enforce the rule in the code and perform more error checking. >> >> Thanks, >> Yilun >