Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp284263pxf; Wed, 10 Mar 2021 06:26:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJykmvh61HDVL9u8ZblJYoECQXomd7XF4Rmr77qrkEclr6m28uz8vO8S99zuIxellGwjhuPr X-Received: by 2002:a50:cdd1:: with SMTP id h17mr3601477edj.178.1615386393202; Wed, 10 Mar 2021 06:26:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615386393; cv=none; d=google.com; s=arc-20160816; b=yB8pUfaSD2O36GAznjQBdMvNEGtuDdtxWWzpe4YGyiaCaRJhZUOwluzuptk0dKlos7 bItgaFPVkE4tIAB93Shs8KsrmQgTMP+jeH/uuUjFwcjIywnek3Ouk3IqK+xxauNXaplH 2AOcxLOPEFh3uJLL/cUXklTdIjSHUhH5yIsVHPbL6g0QQyu+/ZKbPYjwHuFPDmHOqqMY 4Gd2WyOWaL4gURdfhh1sdV02WeTpNPDOSeaArgLJWCvFk7PDMPsa3tfnyPQ0XzbfRCjL DQ6oO0y28pBnsUJVXq0mWP608lnwB3VM3/FpM1NbcVpEE/djsd217sy0M79Q1WcRlwvC 0doQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=ia4RFpicq2fRuAPgXhAozb2Coa1dHuagLeIfRQj8pNQ=; b=fuer4mlfYprO+zYaMGhdOfKqmh6HklDwTkM/eoIC18A+0I027Lk8fVbE5vwwx7S21A 11ftj4Gq+0quCLG5DQx0cGDjFsrLnXea0FItckKBFEms62KfFbalPHwE7t1PL09uOBJ4 5jd4qaeC21/yn//LsGbdqJoD9Hwb2/m9fTVxCNdquXqacopaAQHF7vQTioEgHDILvafV H3uFdDpnhSqWbdfvkRa9A25ECIAJ4qTs1xSO07W0eh84VkxEoJSY612ARqZ41qT+Pt/Z 4SSM7b5QL5JtgUsK65AUxNavgjHgwvdUWW6bt6sqj7MefhpC6dq/bQUPmRGWnzEEPYJi wmUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ozlabs-ru.20150623.gappssmtp.com header.s=20150623 header.b=MVAAnh5a; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t13si12063612ejr.172.2021.03.10.06.26.09; Wed, 10 Mar 2021 06:26:33 -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; dkim=pass header.i=@ozlabs-ru.20150623.gappssmtp.com header.s=20150623 header.b=MVAAnh5a; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232659AbhCJOZM (ORCPT + 99 others); Wed, 10 Mar 2021 09:25:12 -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-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