DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ranjit Menon <ranjit.menon@intel.com>
To: Tal Shnaiderman <talshn@nvidia.com>,
	Pallavi Kadam <pallavi.kadam@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	NBU-Contact-Thomas Monjalon <thomas@monjalon.net>
Cc: "dmitry.kozliuk@gmail.com" <dmitry.kozliuk@gmail.com>,
	"Narcisa.Vasile@microsoft.com" <Narcisa.Vasile@microsoft.com>
Subject: Re: [dpdk-dev] [PATCH] bus/pci: netuio interface for windows
Date: Tue, 15 Sep 2020 13:13:20 -0700	[thread overview]
Message-ID: <5097faac-6d2e-2186-8585-e24b3f432d99@intel.com> (raw)
In-Reply-To: <BY5PR12MB43239FBEA0A986065BD4D78DA4220@BY5PR12MB4323.namprd12.prod.outlook.com>

Hi, Tal

On 9/13/2020 11:42 AM, Tal Shnaiderman wrote:
>> Subject: [PATCH] bus/pci: netuio interface for windows
>>
>> This patch adds implementations to probe PCI devices bound to netuio with
>> the help of "netuio" class device changes.
>> Now Windows will support both "netuio" and "net" device class and can set
>> kernel driver type based on the device class selection.
>>
>> Note: Few definitions and structures have been copied from
>> netuio_interface.h file from ("[v3] windows/netuio: add Windows NetUIO
>> kernel driver") series and this will be fixed once the exact path for netuio
>> source code is known.
>>
>> Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
>> Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
>> ---
>>   drivers/bus/pci/windows/pci.c | 293 +++++++++++++++++++++++++++++--
>> ---
>>   1 file changed, 257 insertions(+), 36 deletions(-)
>>
>> diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c
>> index c80bd5571..38db87a2a 100644
>> --- a/drivers/bus/pci/windows/pci.c
>> +++ b/drivers/bus/pci/windows/pci.c
> I think it will be better to split the pci implementation into 2 files and add pci_netuio.c
> (similarly to Linux with pci_uio.c and pci_vfio.c), moving all of the netuio-specific definitions and functions in this patch to the new file.
>
> [snip]
I think this is a good suggestion. We'll work on this in V2.
>> -int
>> -rte_pci_scan(void)
>> +static int
>> +pci_scan_device_class(const GUID *guid)
>>   {
>>          int   ret = -1;
>>          DWORD device_index = 0, found_device = 0;
>>          HDEVINFO dev_info;
>>          SP_DEVINFO_DATA device_info_data;
>> +       const char *class;
>>
>> -       /* for debug purposes, PCI can be disabled */
>> -       if (!rte_eal_has_pci())
>> -               return 0;
>> +       if (IsEqualGUID((const void *)guid,
>> +           (const void *)&GUID_DEVCLASS_NETUIO))
>> +               class = netuio_class;
>> +       else
>> +               class = net_class;
>>
>> -       dev_info = SetupDiGetClassDevs(&GUID_DEVCLASS_NET, TEXT("PCI"),
>> NULL,
>> -                               DIGCF_PRESENT);
>> +       dev_info = SetupDiGetClassDevs(guid, TEXT("PCI"), NULL,
>> + DIGCF_PRESENT);
> Is there a way to get both GUID_DEVCLASS_NET and GUID_DEVCLASS_NETUIO in a single call here?
> We could avoid calling this function twice if we could get all of the devices.

Yes. I think we have a way to make it work so that we can avoid calling 
this function twice.

We can scan for all device classes and then only filter out net and 
netuio class devices.

>>          if (dev_info == INVALID_HANDLE_VALUE) {
>>                  RTE_LOG_WIN32_ERR("SetupDiGetClassDevs(pci_scan)");
>> -               RTE_LOG(ERR, EAL, "Unable to enumerate PCI devices.\n");
>> +               RTE_LOG(ERR, EAL, "Unable to enumerate %s PCI devices.\n",
>> +                           class);
>>                  goto end;
>>          }
>>
>> @@ -415,7 +614,8 @@ rte_pci_scan(void)
>>                  device_info_data.cbSize = sizeof(SP_DEVINFO_DATA);
>>          }
>>
>> -       RTE_LOG(DEBUG, EAL, "PCI scan found %lu devices\n", found_device);
>> +       RTE_LOG(DEBUG, EAL, "PCI scan found %lu %s devices\n",
>> +               found_device, class);
>>          ret = 0;
>>   end:
>>          if (dev_info != INVALID_HANDLE_VALUE) @@ -423,3 +623,24 @@
>> rte_pci_scan(void)
>>
>>          return ret;
>>   }
>> +
>> +/*
>> + * Scan the contents of the PCI bus looking for devices  */ int
>> +rte_pci_scan(void)
>> +{
>> +       int   ret = -1;
>> +
>> +       /* for debug purposes, PCI can be disabled */
>> +       if (!rte_eal_has_pci())
>> +               return 0;
>> +
>> +       /* first, scan for netUIO class devices */
>> +       ret = pci_scan_device_class(&GUID_DEVCLASS_NETUIO);
> ret is overwritten later on.
>
>> +
>> +       /* then, scan for the standard net class devices */
>> +       ret = pci_scan_device_class(&GUID_DEVCLASS_NET);
>> +
>> +       return ret;
>> +}
>> --
>> 2.18.0.windows.1
> thanks,
ranjit m.

  reply	other threads:[~2020-09-15 20:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-11  1:59 Pallavi Kadam
2020-09-13 18:42 ` Tal Shnaiderman
2020-09-15 20:13   ` Ranjit Menon [this message]
2020-09-15 23:28 ` [dpdk-dev] [PATCH v2] " Pallavi Kadam
2020-09-16  1:54   ` Stephen Hemminger
2020-09-17  0:48     ` Ranjit Menon
2020-09-17  1:20       ` Ranjit Menon
2020-09-21 21:08   ` [dpdk-dev] [PATCH v3] " Pallavi Kadam
2020-09-22  3:05     ` [dpdk-dev] [PATCH v4] " Pallavi Kadam
2020-09-25  1:53       ` [dpdk-dev] [PATCH v5] " Pallavi Kadam
2020-09-29  8:28         ` Tal Shnaiderman
2020-09-29 17:29           ` Ranjit Menon
2020-09-30  7:58             ` Tal Shnaiderman
2020-10-06 23:31           ` Kadam, Pallavi
2020-10-06 21:57         ` [dpdk-dev] [PATCH v6] " Pallavi Kadam
2020-10-08 17:46           ` Tal Shnaiderman
2020-10-08 18:56           ` [dpdk-dev] [PATCH v7] " Pallavi Kadam
2020-10-08 21:50             ` Tal Shnaiderman
2020-10-09  2:12             ` Narcisa Ana Maria Vasile
2020-10-14 20:27               ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5097faac-6d2e-2186-8585-e24b3f432d99@intel.com \
    --to=ranjit.menon@intel.com \
    --cc=Narcisa.Vasile@microsoft.com \
    --cc=dev@dpdk.org \
    --cc=dmitry.kozliuk@gmail.com \
    --cc=pallavi.kadam@intel.com \
    --cc=talshn@nvidia.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).