summaryrefslogtreecommitdiff
path: root/app/test-pmd
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2013-05-30 19:12:39 +0200
committerThomas Monjalon <thomas.monjalon@6wind.com>2013-09-17 14:09:22 +0200
commiteee16c964cd6b90622c36a7976ad951313b2ccd3 (patch)
tree138c186cb51c366e497bcbdb67be0033e93771d7 /app/test-pmd
parentc7f4888629bd4a36a34f499f80412369e90a8222 (diff)
downloaddpdk-eee16c964cd6b90622c36a7976ad951313b2ccd3.zip
dpdk-eee16c964cd6b90622c36a7976ad951313b2ccd3.tar.gz
dpdk-eee16c964cd6b90622c36a7976ad951313b2ccd3.tar.xz
pci: support multiple PCI regions per device
Need to change PCI code to support multiple I/O regions on a single device. Some devices like VMXNET3 have multiple PCI memory regions, and some have none. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Intel
Diffstat (limited to 'app/test-pmd')
-rw-r--r--app/test-pmd/config.c2
-rw-r--r--app/test-pmd/testpmd.h10
2 files changed, 7 insertions, 5 deletions
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 0b66671..6d636ff 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -308,7 +308,7 @@ port_reg_off_is_invalid(portid_t port_id, uint32_t reg_off)
(unsigned)reg_off);
return 1;
}
- pci_len = ports[port_id].dev_info.pci_dev->mem_resource.len;
+ pci_len = ports[port_id].dev_info.pci_dev->mem_resource[0].len;
if (reg_off >= pci_len) {
printf("Port %d: register offset %u (0x%X) out of port PCI "
"resource (length=%"PRIu64")\n",
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index c54bd99..cd3edb7 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -375,8 +375,9 @@ port_pci_reg_read(struct rte_port *port, uint32_t reg_off)
void *reg_addr;
uint32_t reg_v;
- reg_addr = (void *)((char *)port->dev_info.pci_dev->mem_resource.addr +
- reg_off);
+ reg_addr = (void *)
+ ((char *)port->dev_info.pci_dev->mem_resource[0].addr +
+ reg_off);
reg_v = *((volatile uint32_t *)reg_addr);
return rte_le_to_cpu_32(reg_v);
}
@@ -389,8 +390,9 @@ port_pci_reg_write(struct rte_port *port, uint32_t reg_off, uint32_t reg_v)
{
void *reg_addr;
- reg_addr = (void *)((char *)port->dev_info.pci_dev->mem_resource.addr +
- reg_off);
+ reg_addr = (void *)
+ ((char *)port->dev_info.pci_dev->mem_resource[0].addr +
+ reg_off);
*((volatile uint32_t *)reg_addr) = rte_cpu_to_le_32(reg_v);
}