error : dereferencing pointer to incomplete type using dpdk 18.08

265 Views Asked by At

I am getting the below compilation errors in memcmp. Source code is pasted below the error:

: error: dereferencing pointer to incomplete type
                  if((memcmp((const void *)&pci_dev->addr,(const void *)&Input[iLoop].guestpci,sizeof(pci_dev->addr))==0) && (memcmp((const void *)&gBtgData.nic_port[port].mac_addr,(const void *)&Input[iLoop].mac_addr,sizeof(gBtgData.nic_port[port].mac_addr))==0))
                                                   ^
: error: dereferencing pointer to incomplete type
                  if((memcmp((const void *)&pci_dev->addr,(const void *)&Input[iLoop].guestpci,sizeof(pci_dev->addr))==0) && (memcmp((const void *)&gBtgData.nic_port[port].mac_addr,(const void *)&Input[iLoop].mac_addr,sizeof(gBtgData.nic_port[port].mac_addr))==0))
                                                                                                             ^

Code:

struct rte_eth_dev_info dev_info;
const struct rte_pci_device *pci_dev;
rte_eth_dev_info_get(port, &dev_info);
pci_dev = RTE_DEV_TO_PCI(dev_info.device);


memcmp((const void *)&pci_dev->addr,(const void *)&Input[iLoop].guestpci,sizeof(pcii
_dev->addr))==0) && (rte_memcmp((const void *)&gBtgData.nic_port[port].mac_addr,(const void *)&Input[iLoop]..
mac_addr,sizeof(gBtgData.nic_port[port].mac_addr))==0)

Could you please let me know how to fix this error.

Thanks,

2

There are 2 best solutions below

1
user3509719 On

I have included the headers , rte_pci.h and rte_dev.h.I am not sure whats the issue.

2
AdamTL On

DPDK in version 18.08 doesn't have the rte_pci_device struct: https://doc.dpdk.org/api-18.08/rte__pci_8h.html

You were probably using a wrong documentation version.