MCPcopy Create free account
hub / github.com/F-Stack/f-stack / eth_ixgbe_pci_probe

Function eth_ixgbe_pci_probe

dpdk/drivers/net/ixgbe/ixgbe_ethdev.c:1763–1831  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1761}
1762
1763static int
1764eth_ixgbe_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
1765 struct rte_pci_device *pci_dev)
1766{
1767 char name[RTE_ETH_NAME_MAX_LEN];
1768 struct rte_eth_dev *pf_ethdev;
1769 struct rte_eth_devargs eth_da;
1770 int i, retval;
1771
1772 if (pci_dev->device.devargs) {
1773 retval = rte_eth_devargs_parse(pci_dev->device.devargs->args,
1774 &eth_da);
1775 if (retval)
1776 return retval;
1777 } else
1778 memset(&eth_da, 0, sizeof(eth_da));
1779
1780 if (eth_da.nb_representor_ports > 0 &&
1781 eth_da.type != RTE_ETH_REPRESENTOR_VF) {
1782 PMD_DRV_LOG(ERR, "unsupported representor type: %s",
1783 pci_dev->device.devargs->args);
1784 return -ENOTSUP;
1785 }
1786
1787 retval = rte_eth_dev_create(&pci_dev->device, pci_dev->device.name,
1788 sizeof(struct ixgbe_adapter),
1789 eth_dev_pci_specific_init, pci_dev,
1790 eth_ixgbe_dev_init, NULL);
1791
1792 if (retval || eth_da.nb_representor_ports < 1)
1793 return retval;
1794
1795 pf_ethdev = rte_eth_dev_allocated(pci_dev->device.name);
1796 if (pf_ethdev == NULL)
1797 return -ENODEV;
1798
1799 /* probe VF representor ports */
1800 for (i = 0; i < eth_da.nb_representor_ports; i++) {
1801 struct ixgbe_vf_info *vfinfo;
1802 struct ixgbe_vf_representor representor;
1803
1804 vfinfo = *IXGBE_DEV_PRIVATE_TO_P_VFDATA(
1805 pf_ethdev->data->dev_private);
1806 if (vfinfo == NULL) {
1807 PMD_DRV_LOG(ERR,
1808 "no virtual functions supported by PF");
1809 break;
1810 }
1811
1812 representor.vf_id = eth_da.representor_ports[i];
1813 representor.switch_domain_id = vfinfo->switch_domain_id;
1814 representor.pf_ethdev = pf_ethdev;
1815
1816 /* representor port net_bdf_port */
1817 snprintf(name, sizeof(name), "net_%s_representor_%d",
1818 pci_dev->device.name,
1819 eth_da.representor_ports[i]);
1820

Callers

nothing calls this directly

Calls 5

rte_eth_devargs_parseFunction · 0.85
memsetFunction · 0.85
rte_eth_dev_createFunction · 0.85
rte_eth_dev_allocatedFunction · 0.85
snprintfFunction · 0.85

Tested by

no test coverage detected