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 2380EC433E0 for ; Wed, 10 Mar 2021 14:25:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E0FA464FF6 for ; Wed, 10 Mar 2021 14:25:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233025AbhCJOZN (ORCPT ); Wed, 10 Mar 2021 09:25:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231591AbhCJOY4 (ORCPT ); Wed, 10 Mar 2021 09:24:56 -0500 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 611BBC061760 for ; Wed, 10 Mar 2021 06:24:56 -0800 (PST) Received: by mail-pg1-x52d.google.com with SMTP id o38so11501994pgm.9 for ; Wed, 10 Mar 2021 06:24:56 -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=ia4RFpicq2fRuAPgXhAozb2Coa1dHuagLeIfRQj8pNQ=; b=MVAAnh5akGxaYjBBsx/wd8dd5mvwQkezHzzvAcU0d3DczYATYUbjWj9CxafssTwVdh REID571/jUKlKRb3gGXQIlmV97PHAQyskUXSEstmL5xmEQibOXsFipYb2XnIpvfU/T9o tw83tRACD2PPz3STkY9W0iyfEEMWvShwcUJhhroXzZPJa4iu4/uuJGifbuCZ1GdvUO/3 qAEqnVpVVKcnT+Jgqa6JsFXIGmQzsk3jlQZSKNaw+CgA2tdZkeXuIGPyeTntOeYHuNQN 5u99ovhof1usctC3jN4IBI++x0C5EDQWVXrvs09hQp3zP9acru0Y93MNL+ipZ8lBvpmm NiLw== 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=ia4RFpicq2fRuAPgXhAozb2Coa1dHuagLeIfRQj8pNQ=; b=YWoMOJPEiAlbcEKlzpg3Vu2v3VTOVIJYxXPzJnIFlOa1XQf4V++yrgT/1MyhuUKGM5 3zKiXwvjazJCsbeXCY49U8IIEM9KuSoS7c59MS3QDdlw/lswwHezwvHvidSQJamx/IZr QVmchsXG5X1jdbyBSrG9W3Ar5RP8jv3oIcsMj4pmxsrbuuOzCohyVGyyP9YAVFcDiz/o vssyQ5gjFfatOC7E9jZ1h6bVzse+GxgYFD18v96ItGZBYMyKbWxIGvcWp5uX27IrhMQc QGr5i84pIY1nro7Wl1fT4FhN7NOXjA6Srngwb8vYlS4ypU1Uw6K0SYH39PAAec7HpECp FkRg== X-Gm-Message-State: AOAM530shP7JtQMXNxmR9wyOevbUrT0ev/0YCiTEwlMjZ2pIGcfluXE9 rPU69qjsTl79w7B7XZt7E57KqA== X-Google-Smtp-Source: ABdhPJx/UEee10lhYSYD3qYfveLX/q/dS1C6S7LjHVDoMUNs4sdEMcr8xQaGtWjRqety3E84OglSew== X-Received: by 2002:a63:5b5d:: with SMTP id l29mr2978518pgm.272.1615386295912; Wed, 10 Mar 2021 06:24:55 -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 j3sm3099058pjf.36.2021.03.10.06.24.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Mar 2021 06:24:55 -0800 (PST) Subject: Re: [PATCH 8/9] vfio/pci: export nvlink2 support into vendor vfio_pci drivers To: Jason Gunthorpe , Max Gurtovoy Cc: 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> From: Alexey Kardashevskiy Message-ID: <3b772357-7448-5fa7-9ecc-c13c08df95c3@ozlabs.ru> Date: Thu, 11 Mar 2021 01:24:47 +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: <20210310130246.GW2356281@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/03/2021 00:02, Jason Gunthorpe wrote: > On Wed, Mar 10, 2021 at 02:57:57PM +0200, Max Gurtovoy wrote: > >>>> +    .err_handler        = &vfio_pci_core_err_handlers, >>>> +}; >>>> + >>>> +#ifdef CONFIG_VFIO_PCI_DRIVER_COMPAT >>>> +struct pci_driver *get_nvlink2gpu_vfio_pci_driver(struct pci_dev *pdev) >>>> +{ >>>> +    if (pci_match_id(nvlink2gpu_vfio_pci_driver.id_table, pdev)) >>>> +        return &nvlink2gpu_vfio_pci_driver; >>> >>> >>> Why do we need matching PCI ids here instead of looking at the FDT which >>> will work better? >> >> what is FDT ? any is it better to use it instead of match_id ? > > This is emulating the device_driver match for the pci_driver. No it is not, it is a device tree info which lets to skip the linux PCI discovery part (the firmware does it anyway) but it tells nothing about which drivers to bind. > I don't think we can combine FDT matching with pci_driver, can we? It is a c function calling another c function, all within vfio-pci, this is not called by the generic pci code. -- Alexey