Skip to contentSkip to conversation

windows/netuio: fix pci resouce translation

PATCH In review William Tu 1 participant 2 messages Oct 8, 2021

lore
Share & tools
lore

William Tu

author
#0 lore raw

PATCH 1/1 windows/netuio: fix pci resouce translation

When BAR array is filled like this
* Bar[4] = c844000c <if this one is not the CM_RESOURCE_MEMORY_BAR>
* Bar[5] = null
ex:
while ((descriptor->Type != CmResourceTypeMemory) ||

                 !(descriptor->Flags & CM_RESOURCE_MEMORY_BAR));

returns true, the loop continue and the decriptor will be NULL, but it's not an error. So I fix it by setting the status to STATUS_SUCCESS.

---
Found the issue when adding the e1000 PMD support.
http://inbox.dpdk.org/dev/[email protected]/T/#u

---
 windows/netuio/netuio_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
windows/netuio/netuio_dev.c +1 -1
index b2deb10..0dd0055 100644
@@ -207,7 +207,7 @@ netuio_map_hw_resources(WDFDEVICE Device, WDFCMRESLIST Resources, WDFCMRESLIST R
             next_descriptor++;
 
             if (descriptor == NULL) {
-                status = STATUS_DEVICE_CONFIGURATION_ERROR;
+                status = STATUS_SUCCESS;
                 goto end;
             }
         } while ((descriptor->Type != CmResourceTypeMemory) ||
Signature · 1 line
2.31.1
author
#1 lore raw
Quoted 7 lines · William Tu

When BAR array is filled like this
* Bar[4] = c844000c <if this one is not the CM_RESOURCE_MEMORY_BAR>
* Bar[5] = null
ex:
while ((descriptor->Type != CmResourceTypeMemory) ||

                 !(descriptor->Flags & CM_RESOURCE_MEMORY_BAR));
Quoted 8 lines

returns true, the loop continue and the decriptor will be NULL, but it's not an error. So I fix it by setting the status to STATUS_SUCCESS.

---
Found the issue when adding the e1000 PMD support.
http://inbox.dpdk.org/dev/[email protected]/T/#u
---

Sorry, there are some format/spelling errors in this patch. I will fix and resend v2.
William