From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A754EC433E0 for ; Thu, 11 Mar 2021 01:44:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5D56764FAB for ; Thu, 11 Mar 2021 01:44:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229614AbhCKBnn (ORCPT ); Wed, 10 Mar 2021 20:43:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbhCKBnM (ORCPT ); Wed, 10 Mar 2021 20:43:12 -0500 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22A2EC061760 for ; Wed, 10 Mar 2021 17:43:12 -0800 (PST) Received: by mail-pf1-x436.google.com with SMTP id e26so4781160pfd.9 for ; Wed, 10 Mar 2021 17:43:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ozlabs-ru.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=MWojlJbUjd8zeoqWw9mfU3jMWrIYqMEd6vbJ5jtrUws=; b=Sa9/Vp7ANEMp+nq3kdNHz5hLIhyAAfUqRrv1U71IBC4MZ/QwYxf7GA9TfF/vIleoGD LG8ZdcTnkWi2Ka8G05Q7H2ZoN5R/0JvxjDcdf0DAXG6U4b0v0u1RzaFZhTvGjvNIjfM3 qtcB1HniugfDx0NsU9tGro1jViIiR8g0aBIjQlQng4CtvI2uwqfqlTCwryXZZqhW/cPE Dm5HnCFbg2UjhbaxBUvhOp+d+SjnHLvSno2XKApGMKeJ/JXyU6i4hieRNdF+PvxwZYLn /uziyQZs2tSbiWGTLsonMt00StcmiDExuqM1O7g5RN75xk8KPmpS1CBXJJlWEvkOPkGN gFnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=MWojlJbUjd8zeoqWw9mfU3jMWrIYqMEd6vbJ5jtrUws=; b=oqscpBSPEvobCtEPijfwwwQ/NdRQW/T4Mxm/zWdA2Pb0EJvm9NGch0QK9cjGHYMI/Z /Ji775J0mYN9LIrNlGp8warE/y1btscyCsrme/8yG9bT/MoZKoxry17HsEoLfNf6Oix0 4iRZCh8P4raSFbUeWzrOnp9z8ybw1WFDRHqP0gvdkZw59iZN8JKlvwnwozkHhXYwjt9v ZgoUfKAOL+qz3bG+pPAlDYUp7pSpndu0W/MGuev/UVXQ5+A5lj7MhFNVCJTOY86eCyDY ForcqRR1UaIIQ2Wuo3BebMWd1ppKiVGn7K5TAt7aebhgbQ/nwJURnLCAOe/9gFPQzLZe rwdw== X-Gm-Message-State: AOAM533MO0kJWGRjMOJVCFKDEmk4ArUmtc9sZci3f03NpxxDbCkz7rf9 e++CKwaWUGlqX6A1iP8RTk/Bjw== X-Google-Smtp-Source: ABdhPJzCjrEDF22HR8BBzOTqHG5psBpFNzWPU//hpBEJ39p1CwsucIYBG8PUZdW8cdI4LaaOtKux6g== X-Received: by 2002:a63:689:: with SMTP id 131mr5200828pgg.416.1615426991602; Wed, 10 Mar 2021 17:43:11 -0800 (PST) Received: from [192.168.10.23] (124-171-107-241.dyn.iinet.net.au. [124.171.107.241]) by smtp.gmail.com with UTF8SMTPSA id s11sm641511pfu.69.2021.03.10.17.42.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Mar 2021 17:43:11 -0800 (PST) Subject: Re: [PATCH 8/9] vfio/pci: export nvlink2 support into vendor vfio_pci drivers To: Jason Gunthorpe Cc: Max Gurtovoy , alex.williamson@redhat.com, cohuck@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, liranl@nvidia.com, oren@nvidia.com, tzahio@nvidia.com, leonro@nvidia.com, yarong@nvidia.com, aviadye@nvidia.com, shahafs@nvidia.com, artemp@nvidia.com, kwankhede@nvidia.com, ACurrid@nvidia.com, cjia@nvidia.com, yishaih@nvidia.com, mjrosato@linux.ibm.com, hch@lst.de References: <20210309083357.65467-1-mgurtovoy@nvidia.com> <20210309083357.65467-9-mgurtovoy@nvidia.com> <19e73e58-c7a9-03ce-65a7-50f37d52ca15@ozlabs.ru> <8941cf42-0c40-776e-6c02-9227146d3d66@nvidia.com> <20210310130246.GW2356281@nvidia.com> <3b772357-7448-5fa7-9ecc-c13c08df95c3@ozlabs.ru> <20210310194002.GD2356281@nvidia.com> <7f0310db-a8e3-4045-c83a-11111767a22f@ozlabs.ru> <20210311013443.GH2356281@nvidia.com> From: Alexey Kardashevskiy Message-ID: Date: Thu, 11 Mar 2021 12:42:56 +1100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/20100101 Thunderbird/85.0 MIME-Version: 1.0 In-Reply-To: <20210311013443.GH2356281@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/03/2021 12:34, Jason Gunthorpe wrote: > On Thu, Mar 11, 2021 at 12:20:33PM +1100, Alexey Kardashevskiy wrote: > >>> It is supposed to match exactly the same match table as the pci_driver >>> above. We *don't* want different behavior from what the standrd PCI >>> driver matcher will do. >> >> This is not a standard PCI driver though > > It is now, that is what this patch makes it into. This is why it now > has a struct pci_driver. > >> and the main vfio-pci won't have a >> list to match ever. > > ?? vfio-pci uses driver_override or new_id to manage its match list Exactly, no list to update. >> IBM NPU PCI id is unlikely to change ever but NVIDIA keeps making >> new devices which work in those P9 boxes, are you going to keep >> adding those ids to nvlink2gpu_vfio_pci_table? > > Certainly, as needed. PCI list updates is normal for the kernel. > >> btw can the id list have only vendor ids and not have device ids? > > The PCI matcher is quite flexable, see the other patch from Max for > the igd ah cool, do this for NVIDIA GPUs then please, I just discovered another P9 system sold with NVIDIA T4s which is not in your list. > But best practice is to be as narrow as possible as I hope this will > eventually impact module autoloading and other details. The amount of device specific knowledge is too little to tie it up to device ids, it is a generic PCI driver with quirks. We do not have a separate drivers for the hardware which requires quirks. And how do you hope this should impact autoloading? -- Alexey