> > Hi, > > I have a question about how to know corresponding device from port > number. > For example, if I have 4 Ethernet devices and 2 Ring PMDs, I will get 6 ports > during initialization. > In the case, how can I know which port corresponds last Ring PMD?
[BR] Firstly, to identify the ring PMD's vs the ethernet device PMDs you can use the information in the rte_eth_dev structure. For each device x, (0 <= x <=5), if you check rte_eth_devices[x], the ring pmd's will have a NULL driver pointer and the pci address given in the pci_dev structure will be all-zeros. As for distinguishing two different ring ethdevs from each other, I'm not aware of any way to do this, they will just have different eth_dev indexes.