X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fsoftnic%2Frte_eth_softnic.c;h=e3243940cba7abce4e6f907e4f8d5fd976ac68b5;hb=ee27edbe0c10ec8337c4cc4d2935a751d0da605f;hp=b0c134152fd691ee16c36511631d0a339730bd5a;hpb=5f19dee604ed5760d819743d1d364493ead2aae6;p=dpdk.git diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c index b0c134152f..e3243940cb 100644 --- a/drivers/net/softnic/rte_eth_softnic.c +++ b/drivers/net/softnic/rte_eth_softnic.c @@ -725,13 +725,26 @@ pmd_probe(struct rte_vdev_device *vdev) uint16_t hard_port_id; int numa_node; void *dev_private; + struct rte_eth_dev *eth_dev; + const char *name = rte_vdev_device_name(vdev); - RTE_LOG(INFO, PMD, - "Probing device \"%s\"\n", - rte_vdev_device_name(vdev)); + RTE_LOG(INFO, PMD, "Probing device \"%s\"\n", name); /* Parse input arguments */ params = rte_vdev_device_args(vdev); + + if (rte_eal_process_type() == RTE_PROC_SECONDARY && + strlen(params) == 0) { + eth_dev = rte_eth_dev_attach_secondary(name); + if (!eth_dev) { + RTE_LOG(ERR, PMD, "Failed to probe %s\n", name); + return -1; + } + /* TODO: request info from primary to set up Rx and Tx */ + eth_dev->dev_ops = &pmd_ops; + return 0; + } + if (!params) return -EINVAL;