DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-kmods] windows/netuio: fix bar parsing
@ 2022-08-02 19:10 Pallavi Kadam
  2022-08-06 21:01 ` Dmitry Kozlyuk
  2022-08-11 22:17 ` [dpdk-kmods v2] windows/netuio: fix BAR parsing Pallavi Kadam
  0 siblings, 2 replies; 10+ messages in thread
From: Pallavi Kadam @ 2022-08-02 19:10 UTC (permalink / raw)
  To: dev
  Cc: thomas, ranjit.menon, dmitry.kozliuk, Narcisa.Vasile, roretzla,
	qiao.liu, pallavi.kadam

For certain PCIe devices, BAR values are not continuous.
This patch maps all the BARs and avoids skipping the next BAR addresses.

Fixes: e28aabd88279 ("windows/netuio: introduce NetUIO kernel driver")
Cc: navasile@microsoft.com

Signed-off-by: Qiao Liu <qiao.liu@intel.com>
Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
---
 windows/netuio/netuio_dev.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/windows/netuio/netuio_dev.c b/windows/netuio/netuio_dev.c
index b2deb10..e2cac3e 100644
--- a/windows/netuio/netuio_dev.c
+++ b/windows/netuio/netuio_dev.c
@@ -172,6 +172,7 @@ netuio_map_hw_resources(WDFDEVICE Device, WDFCMRESLIST Resources, WDFCMRESLIST R
     ULONG next_descriptor = 0;
     ULONG curr_bar = 0;
     ULONG prev_bar = 0;
+    BOOLEAN bar_done = FALSE;
 
    /*
     * ResourcesTranslated report MMIO BARs in the correct order, but their
@@ -197,7 +198,8 @@ netuio_map_hw_resources(WDFDEVICE Device, WDFCMRESLIST Resources, WDFCMRESLIST R
     for (INT bar_index = 0; bar_index < PCI_MAX_BAR; bar_index++) {
         prev_bar = curr_bar;
         curr_bar = pci_config.u.type0.BaseAddresses[bar_index];
-        if (curr_bar == 0 || (prev_bar & PCI_TYPE_64BIT)) {
+        if (curr_bar == 0 || ((prev_bar & PCI_TYPE_64BIT) && (bar_done))) {
+            bar_done = FALSE;
             continue;
         }
 
@@ -219,6 +221,7 @@ netuio_map_hw_resources(WDFDEVICE Device, WDFCMRESLIST Resources, WDFCMRESLIST R
         ctx->bar[bar_index].virt_addr = MmMapIoSpace(descriptor->u.Memory.Start,
                                                      descriptor->u.Memory.Length,
                                                      MmNonCached);
+        bar_done = TRUE;
         if (ctx->bar[bar_index].virt_addr == NULL) {
             status = STATUS_INSUFFICIENT_RESOURCES;
             goto end;
-- 
2.31.1.windows.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-08-29  8:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-02 19:10 [dpdk-kmods] windows/netuio: fix bar parsing Pallavi Kadam
2022-08-06 21:01 ` Dmitry Kozlyuk
2022-08-08 20:40   ` Kadam, Pallavi
2022-08-09  0:33   ` Kadam, Pallavi
2022-08-09  9:15     ` Dmitry Kozlyuk
2022-08-11 22:21       ` Kadam, Pallavi
2022-08-11 22:17 ` [dpdk-kmods v2] windows/netuio: fix BAR parsing Pallavi Kadam
2022-08-18  2:51   ` Liu, Qiao
2022-08-19 18:13   ` Menon, Ranjit
2022-08-29  8:04     ` Thomas Monjalon

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).