Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5040089img; Wed, 27 Mar 2019 00:26:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqxIISJ1xxXrI8r+YY6IZDE+ZaK82N/A7i3jKNebeUxc1cjhmGXL41jIDRzmQekBlWcQ6hD8 X-Received: by 2002:a63:5854:: with SMTP id i20mr23505217pgm.171.1553671601513; Wed, 27 Mar 2019 00:26:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553671601; cv=none; d=google.com; s=arc-20160816; b=zeISzVUE9gKvQLf6Syowo9zqQJpen+guhoM3Hldq9KVNALndMG40S1W0/koz32dnOn Gx3pmdJ5BVgX9B0TBX5sdNmM0xuFt6sin+BlHz3h3es0rk21B7ZZDMlQglhxrCVYKWJ8 o1r4pe3YygMdsp/FHATaSdac+FYuNs7PfOjgeDAal67R7MVReSvSq+zo40hHmBPx5K5N 5xouJF/IjWvyyD3NKM+oTHqyKR9IlGFkZltzS0NgDEe9IHvgjNvvZ5KdSoiwKkDxShL1 /x2xFkkMTVFqHB78Y2UbZ6On0IzedtdSbHOUi1tlXOq25VnsSpaS7IhVhgvJwh/1XSMN o2Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=oerGFDjmT66Ni+557xOvmR29TkJgBWSrUuu4eKl+CFc=; b=fEbabFl7sDkUTR9g1qoe5f29koakwceI9yL38h5cLyVsFQjf3KMSOS9Tg8RWLFu1y1 0IGOG0KQAkUQhCD8dVxHNPM8BvDmP9txkDTw1ov6Ectk24DqtZpwMXVAXM7Yam0AfZst N435Osta/+EEh5+97RTGvxuRfMtkG6LXi59BAysdqMHbu+Ly6hHfZzu4mBUHmHVFqvR7 OPwe4jA1tu45ICBzGTQau/0x1Lox2daWUIMHmESPsDj15C5bvxpqU849EhmTX5iKCm2w 6qyg+0KiEpdwg/JYyuoYv+CSOei/zUyeo6OZ0fSFDM9kX9KhkN687buz0fQ2x3IlX5DD 7Ezg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id f17si17727797pgd.143.2019.03.27.00.26.24; Wed, 27 Mar 2019 00:26:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1732319AbfC0HZg (ORCPT + 99 others); Wed, 27 Mar 2019 03:25:36 -0400 Received: from mga09.intel.com ([134.134.136.24]:4440 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725997AbfC0HZf (ORCPT ); Wed, 27 Mar 2019 03:25:35 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Mar 2019 00:25:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,276,1549958400"; d="scan'208";a="332407505" Received: from hao-dev.bj.intel.com (HELO localhost) ([10.238.157.65]) by fmsmga005.fm.intel.com with ESMTP; 27 Mar 2019 00:25:30 -0700 Date: Wed, 27 Mar 2019 15:10:06 +0800 From: Wu Hao To: Scott Wood Cc: atull@kernel.org, mdf@kernel.org, linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Ananda Ravuri , Xu Yilun Subject: Re: [PATCH 03/17] fpga: dfl: fme: support 512bit data width PR Message-ID: <20190327071006.GA18685@hao-dev> References: <1553483264-5379-1-git-send-email-hao.wu@intel.com> <1553483264-5379-4-git-send-email-hao.wu@intel.com> <127a9356a7bf597d35dd361f2b16bf80460f0370.camel@redhat.com> <655bf2991a4f8bf6a473c91218d6dba7748520aa.camel@redhat.com> <20190327051040.GB20968@hao-dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 27, 2019 at 01:19:29AM -0500, Scott Wood wrote: > On Wed, 2019-03-27 at 13:10 +0800, Wu Hao wrote: > > On Mon, Mar 25, 2019 at 05:58:36PM -0500, Scott Wood wrote: > > > On Mon, 2019-03-25 at 17:53 -0500, Scott Wood wrote: > > > > On Mon, 2019-03-25 at 11:07 +0800, Wu Hao wrote: > > > > > In early partial reconfiguration private feature, it only > > > > > supports 32bit data width when writing data to hardware for > > > > > PR. 512bit data width PR support is an important optimization > > > > > for some specific solutions (e.g. XEON with FPGA integrated), > > > > > it allows driver to use AVX512 instruction to improve the > > > > > performance of partial reconfiguration. e.g. programming one > > > > > 100MB bitstream image via this 512bit data width PR hardware > > > > > only takes ~300ms, but 32bit revision requires ~3s per test > > > > > result. > > > > > > > > > > Please note now this optimization is only done on revision 2 > > > > > of this PR private feature which is only used in integrated > > > > > solution that AVX512 is always supported. > > > > > > > > > > Signed-off-by: Ananda Ravuri > > > > > Signed-off-by: Xu Yilun > > > > > Signed-off-by: Wu Hao > > > > > --- > > > > > drivers/fpga/dfl-fme-main.c | 3 ++ > > > > > drivers/fpga/dfl-fme-mgr.c | 75 > > > > > +++++++++++++++++++++++++++++++++++++- > > > > > -- > > > > > ----- > > > > > drivers/fpga/dfl-fme-pr.c | 45 ++++++++++++++++----------- > > > > > drivers/fpga/dfl-fme.h | 2 ++ > > > > > drivers/fpga/dfl.h | 5 +++ > > > > > 5 files changed, 99 insertions(+), 31 deletions(-) > > > > > > > > > > diff --git a/drivers/fpga/dfl-fme-main.c b/drivers/fpga/dfl-fme- > > > > > main.c > > > > > index 086ad24..076d74f 100644 > > > > > --- a/drivers/fpga/dfl-fme-main.c > > > > > +++ b/drivers/fpga/dfl-fme-main.c > > > > > @@ -21,6 +21,8 @@ > > > > > #include "dfl.h" > > > > > #include "dfl-fme.h" > > > > > > > > > > +#define DRV_VERSION "0.8" > > > > > > > > What is this going to be used for? Under what circumstances will the > > > > driver version be bumped? What does it have to do with 512-bit > > > > writes? > > > > This patchset adds more features to this driver, so i would like to add > > a DRV_VERSION there as an initial one. In the future, if some new features > > or extensions for existing features (e.g. new revision of a private > > feature) > > are added we need to bump this version. > > This doesn't seem like a good way of advertising API availability... Besides > being awkward to query, what happens if a distro kernel has backported some > features but not others that came before? What does it advertise? DRV_VERSION here is not used for API availablity. :) > I'd suggest some sort of feature flag mechanism that can be queried via > ioctl (e.g. along the lines of KVM capabilities), if "try the API and fall > back if it fails" is unsatisfactory. > > Plus, if it's about new APIs being exposed, this doesn't seem like the right > patch for it to be in... Actually this patch doesn't introduce new APIs, I am trying to make this transparent to endusers. That means users don't need to know it's a 32bit PR or a faster 512bit one, they still use the same IOCTL interface for PR. the API_VERSION and CHECK_EXTENSION ioctls have been defined, but I think at least we don't need to bump them for this change. How do you think? > > > > Sorry, I missed the comment about revision 2 only being on integrated > > > devices -- but will that always be the case? Seems worthwhile to check > > > for > > > AVX512 support anyway. And there's still the possibility of being built > > > with an old binutils such that CONFIG_AS_AVX512 is not set, or running > > > on a > > > kernel where avx512 was disabled via a boot option. > > > > > > What about future revisions >= 2? Currently the driver will treat them > > > as > > > if they were revision < 2. Is that intended? > > > > Yes, it's intended. Currently we don't have any hardware with revisions > > > 2, > > and support new revisions may need new code. :) e.g. currently revision > > is > > used to tell 32bit vs 512bit PR, but in future revisions, it may have new > > capability registers for this purpose. > > The driver should refuse to bind to unrecognized revisions, if they're not > expected to be compatible. Yes, agree. Thanks Hao