Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6332694pxv; Thu, 29 Jul 2021 11:53:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhHQOq4Sqmxug9x3TAt5GDowQH34UH/pKZsZcMguuG4FucyW/OnVo6lKkw5ptFGUFcspmz X-Received: by 2002:a17:906:1c07:: with SMTP id k7mr5859636ejg.173.1627584806928; Thu, 29 Jul 2021 11:53:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627584806; cv=none; d=google.com; s=arc-20160816; b=gotPHaeiWDSUJ8Yi6STDcxtccUpCxpvwaWG6iP9Lm/eryvDMK6Q4VXu9VoMN00Mobu 5/lri6FmsWqCk4zPvdQnbokJKR8jea8r+X1CGUb/lKAGNjbUesKW4q6Dthzw4mQuWpNR ltzab9D40IEmaTUptyig+ZejTy9N0JKZGTfnucRUwmKSr6UJxAG0/BUHN40Qq+SORxXT 3YCmo2HIe8BGuH9cAuyszWthj6aDZoeuWIF3I9qdhxrTKPME+EXSTJJ+fYhPH3jBgS/E xGWXV6r4zY0JCOgjFgseeBNX/Lo5EUKh2a/bb/5xUpyVf4n0dfa3Pt/tdG3ClXweMwqR VZtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=tB5r7jCOOPtFx6Q3Xg17uNrYOv0JnsNx/+HyvJ9HcMY=; b=BKZ+PFdozbipLZriYXqAO6mGE4+gfzwgqe2Pe5YWooVKEbXXeZctYTQuxx7ih3dDP0 KmEcXtxmDnP1QlztKchuLj4EK3RLyFWhkxBEQYmweK9aFqCWvk9ICjrCBRkAHxFarmfw v9wOpwDfiPZ0dIqnN7DhYqRFCw6wTndxpydJ0/20a3truFC9YEqnv20hDkLezDGhOMl9 FfgxWv3dM54RVyRy1XYwJiOYnvDntX4kcpTcQB6iXjNwarKujOnFU7oZAal0iLqMiWvH dKvhFDuL8FC52iZbSF0YnPJBQf89bgWX3GS0DLH2l7hy/jTm9OglwqKudSR9ikLTMIcM mMeA== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 21si3259051ejz.246.2021.07.29.11.53.02; Thu, 29 Jul 2021 11:53:26 -0700 (PDT) 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230141AbhG2Svi (ORCPT + 99 others); Thu, 29 Jul 2021 14:51:38 -0400 Received: from mail-pj1-f52.google.com ([209.85.216.52]:36733 "EHLO mail-pj1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229721AbhG2Svc (ORCPT ); Thu, 29 Jul 2021 14:51:32 -0400 Received: by mail-pj1-f52.google.com with SMTP id ds11-20020a17090b08cbb0290172f971883bso17136951pjb.1; Thu, 29 Jul 2021 11:51:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=tB5r7jCOOPtFx6Q3Xg17uNrYOv0JnsNx/+HyvJ9HcMY=; b=Wq5T3tNUCbzAFjmKGUZybPrFiOdbKuj1NpgpeoPIo07SzN1wEDqnZ3Sr5bo95BQmtr OmZL7eH4zCyJzF2i4N1MKJ2M7YM0aGaQtqNj6YZyzXzFu4YcKwmpZZS5TRVLklydDySh UHtxgvdwbKfPN6QfGiE00e25xoXFHhImhq14dYohXrv7bYokLVIpfk8WGv0Xo31jrCHe nRWA7YR1aWJY6az9tcm4ogUtCYG3vZYm/DCV50t2ihMjVVIo9GQ0f9+bQn6PmWC+0wRe 2B1gcLgz/oqT0OULQMKRufbEl5P7XtyoF36K/44eaOgMIVyypmtZ+aK/FiLtBRV6+KFE Q8LQ== X-Gm-Message-State: AOAM53314o2wz0y9luaOWk2+KwQaMK2BQnkJ9efeV4v3dcYbr13iYadK WLnDjhWjPDrWLk/d0Ud2yuQ= X-Received: by 2002:a65:578a:: with SMTP id b10mr5034953pgr.135.1627584687707; Thu, 29 Jul 2021 11:51:27 -0700 (PDT) Received: from localhost ([2601:647:5b00:6f70:be34:681b:b1e9:776f]) by smtp.gmail.com with ESMTPSA id r18sm4980703pgk.54.2021.07.29.11.51.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 11:51:24 -0700 (PDT) Date: Thu, 29 Jul 2021 11:51:23 -0700 From: Moritz Fischer To: "Wu, Hao" Cc: Tom Rix , "Weight, Russell H" , "mdf@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-fpga@vger.kernel.org" Subject: Re: [PATCH] fpga: region: handle compat_id as an uuid Message-ID: References: <20210726202650.4074614-1-trix@redhat.com> <6f30a4c6-61a0-bb57-9f13-bcad3f3589b8@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 28, 2021 at 01:36:56AM +0000, Wu, Hao wrote: > > On 7/26/21 3:12 PM, Russ Weight wrote: > > > On 7/26/21 1:26 PM, trix@redhat.com wrote: > > >> From: Tom Rix > > >> > > >> An fpga region's compat_id is exported by the sysfs > > >> as a 128 bit hex string formed by concatenating two > > >> 64 bit values together. > > >> > > >> The only user of compat_id is dfl. Its user library > > >> opae converts this value into a uuid. > > >> > > >> ex/ > > >> $ cat /sys/class/fpga_region/region1/compat_id > > >> f3c9941350814aadbced07eb84a6d0bb > > >> > > >> Is reported as > > >> $ fpgainfo bmc > > >> ... > > >> Pr Interface Id : f3c99413-5081-4aad-bced-07eb84a6d0bb > > >> > > >> Storing a uuid as 2 64 bit values is vendor specific. > > >> And concatenating them together is vendor specific. > > >> > > >> It is better to store and print out as a vendor neutral uuid. > > >> > > >> Change fpga_compat_id from a struct to a union. > > >> Keep the old 64 bit values for dfl. > > >> Sysfs output is now > > >> f3c99413-5081-4aad-bced-07eb84a6d0bb > > > I'm fowarding feedback from Tim Whisonant, one of the OPAE userspace > > > developers: > > > > > > I think that this change to the sysfs for the compat_id node will > > > end up breaking the SDK, which does not expect the '-' characters to > > > be included when parsing the sysfs value. Currently, it is parsed as > > > a raw hex string without regard to any '-' characters. This goes for > > > any "guid" currently exported by sysfs and for what we read in the > > > device MMIO space. > > > > Yes, it will. > > > > And there are other places, like dfl-afu-main.c:afu_id_show() > > > > outputs raw hex that sdk turns into a uuid. > > > > > > Some options. > > > > If no one but dfl will ever use it, then v1 of patchset. > > > > If others can use it but don't want to change dfl, then v2 of patchset, > > my favorite. > > > > Or this one for uuid for everyone, what have been v3 but changed too much. > > > > > > could dfl change generally to output uuid's to the sysfs ? > > > > this would be generally helpful and a one time disruption to the sdk. > > This change limited the output format to uuid_t, but if any hardware doesn't > use uuid_t on hardware may have to convert it back from the sysfs output in > userspace. Leave it to print hardware values (e.g. from register), and convert > it in userspace should be fine too I think. I'm not entirely sure. I seem to recall there being examples of sysfs files returning different things for different drivers. That being said it seems largely cosmetic to add the '-' in between. If it breaks userspace, I'm against it. If you *need* it make a compat_uuid entry or something in that case? - Moritz