From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id BBEE3A0561;
	Thu, 18 Mar 2021 23:00:24 +0100 (CET)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id A0013140F72;
	Thu, 18 Mar 2021 23:00:24 +0100 (CET)
Received: from mga02.intel.com (mga02.intel.com [134.134.136.20])
 by mails.dpdk.org (Postfix) with ESMTP id D9E81140F6C;
 Thu, 18 Mar 2021 23:00:22 +0100 (CET)
IronPort-SDR: DBgZrZEQYOTU4mY4kbTaTzj/s9wn8wHJOfXoWUCb8bx/GCrasK69tCm/jbXYIKAiuCSZvhCHIj
 d0ZV6eszTTlg==
X-IronPort-AV: E=McAfee;i="6000,8403,9927"; a="176910804"
X-IronPort-AV: E=Sophos;i="5.81,259,1610438400"; d="scan'208";a="176910804"
Received: from orsmga004.jf.intel.com ([10.7.209.38])
 by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 18 Mar 2021 15:00:21 -0700
IronPort-SDR: 8FFbE/tGCsSap5Wkk3tr+c2Pvt8vq9KRsZwsYWFpp1tockgLrZguyUBlZNhUWYLYgNTfzCRp3w
 GAF3vtsUZ5GQ==
X-IronPort-AV: E=Sophos;i="5.81,259,1610438400"; d="scan'208";a="523414706"
Received: from rmenon-desk.amr.corp.intel.com (HELO [10.166.30.253])
 ([10.166.30.253])
 by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 18 Mar 2021 15:00:21 -0700
To: Thomas Monjalon <thomas@monjalon.net>
Cc: dev@dpdk.org, dmitry.kozliuk@gmail.com, stable@dpdk.org,
 Tal Shnaiderman <talshn@mellanox.com>,
 Narcisa Vasile <navasile@linux.microsoft.com>,
 John Alexander <john.alexander@datapath.co.uk>,
 Pallavi Kadam <pallavi.kadam@intel.com>, matan@nvidia.com,
 viacheslavo@nvidia.com
References: <20210316231153.724029-1-thomas@monjalon.net>
 <4cf26015-a332-5a5e-bd20-bea7658aab11@intel.com> <4579147.AC5mi5QAvU@thomas>
From: Ranjit Menon <ranjit.menon@intel.com>
Message-ID: <e8a46def-fa3d-2a2f-7205-05a7f1245d3f@intel.com>
Date: Thu, 18 Mar 2021 15:00:21 -0700
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101
 Thunderbird/68.12.1
MIME-Version: 1.0
In-Reply-To: <4579147.AC5mi5QAvU@thomas>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Content-Language: en-US
Subject: Re: [dpdk-dev] [PATCH] bus/pci: fix Windows kernel driver categories
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>


On 3/18/2021 12:49 AM, Thomas Monjalon wrote:
> 18/03/2021 00:17, Ranjit Menon:
>> Hi Thomas,
>>
>> On 3/16/2021 4:11 PM, Thomas Monjalon wrote:
>>> In Windows probing, the value RTE_PCI_KDRV_NONE was used
>>> instead of RTE_PCI_KDRV_UNKNOWN (mlx case),
>>> and RTE_PCI_KDRV_NIC_UIO (FreeBSD) was re-used
>>> instead of having a new RTE_PCI_KDRV_NET_UIO for Windows NetUIO.
>> Shouldn't the mlx case actually remain RTE_PCI_KDRV_NONE?
>>
>> mlx does not require a UIO-like kernel driver...No? And NONE implies that no kernel driver is used/required.
>> Not sure what is correct here.
> No this is a bifurcated model, meaning kernel and userland
> work together. The PCI device is bound to the kernel driver,
> but the driver is not listed because no special treatment is required.
>
>>> While adding the new value RTE_PCI_KDRV_NET_UIO,
>>> the enum of kernel driver categories is annotated.
>>>
>>> Fixes: b762221ac24f ("bus/pci: support Windows with bifurcated drivers")
>>> Fixes: c76ec01b4591 ("bus/pci: support netuio on Windows")
>>> Cc: stable@dpdk.org
>>>
>>> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
>>> ---
>>>    drivers/bus/pci/rte_bus_pci.h | 13 +++++++------
>>>    drivers/bus/pci/windows/pci.c | 14 +++++++-------
>>>    2 files changed, 14 insertions(+), 13 deletions(-)
>>>
>>> diff --git a/drivers/bus/pci/rte_bus_pci.h b/drivers/bus/pci/rte_bus_pci.h
>>> index fdda046515..3d009cc74b 100644
>>> --- a/drivers/bus/pci/rte_bus_pci.h
>>> +++ b/drivers/bus/pci/rte_bus_pci.h
>>> @@ -52,12 +52,13 @@ TAILQ_HEAD(rte_pci_driver_list, rte_pci_driver);
>>>    struct rte_devargs;
>>>    
>>>    enum rte_pci_kernel_driver {
>>> -	RTE_PCI_KDRV_UNKNOWN = 0,
>>> -	RTE_PCI_KDRV_IGB_UIO,
>>> -	RTE_PCI_KDRV_VFIO,
>>> -	RTE_PCI_KDRV_UIO_GENERIC,
>>> -	RTE_PCI_KDRV_NIC_UIO,
>>> -	RTE_PCI_KDRV_NONE,
>>> +	RTE_PCI_KDRV_UNKNOWN = 0,  /* not listed - may be a bifurcated driver */
>>> +	RTE_PCI_KDRV_IGB_UIO,      /* igb_uio for Linux */
>>> +	RTE_PCI_KDRV_VFIO,         /* VFIO for Linux */
>>> +	RTE_PCI_KDRV_UIO_GENERIC,  /* uio_generic for Linux */
>>> +	RTE_PCI_KDRV_NIC_UIO,      /* nic_uio for FreeBSD */
>>> +	RTE_PCI_KDRV_NONE,         /* error */
>>> +	RTE_PCI_KDRV_NET_UIO,      /* NetUIO for Windows */
>>>    };
>>>    
>> Any chance we can re-order the enums, so that _NONE and _UNKNOWN are at
>> the top?
> No, it would break the ABI.
>
>> This will change the value, and break code where this value was
>> hard-coded. But how likely is that...?
> The problem is when loading the new PCI bus driver with an old device driver.
>
>
>
OK. Thanks for the explanation, Thomas.

ranjit m.