X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fpcap%2Frte_eth_pcap.c;h=418fc528bd9bbb450cb3f41ec795038f868ce898;hb=6751f6deb798394da41467ee6e4cbd10d78ff156;hp=5202086dbc81baf556ed3ea7b8dc056547a1be9c;hpb=77e14d2271b0083c999c95ae3fb99f9669123572;p=dpdk.git diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c index 5202086dbc..418fc528bd 100644 --- a/drivers/net/pcap/rte_eth_pcap.c +++ b/drivers/net/pcap/rte_eth_pcap.c @@ -123,9 +123,10 @@ static int open_single_iface(const char *iface, pcap_t **pcap); static struct ether_addr eth_addr = { .addr_bytes = { 0, 0, 0, 0x1, 0x2, 0x3 } }; static const char *drivername = "Pcap PMD"; static struct rte_eth_link pmd_link = { - .link_speed = 10000, + .link_speed = ETH_SPEED_NUM_10G, .link_duplex = ETH_LINK_FULL_DUPLEX, - .link_status = 0 + .link_status = ETH_LINK_DOWN, + .link_autoneg = ETH_LINK_SPEED_FIXED, }; static int @@ -428,7 +429,7 @@ eth_dev_start(struct rte_eth_dev *dev) status_up: - dev->data->dev_link.link_status = 1; + dev->data->dev_link.link_status = ETH_LINK_UP; return 0; } @@ -479,7 +480,7 @@ eth_dev_stop(struct rte_eth_dev *dev) } status_down: - dev->data->dev_link.link_status = 0; + dev->data->dev_link.link_status = ETH_LINK_DOWN; } static int @@ -821,7 +822,7 @@ rte_pmd_init_internals(const char *name, const unsigned nb_rx_queues, goto error; /* reserve an ethdev entry */ - *eth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_VIRTUAL); + *eth_dev = rte_eth_dev_allocate(name); if (*eth_dev == NULL) goto error; @@ -977,8 +978,8 @@ rte_pmd_pcap_devinit(const char *name, const char *params) unsigned numa_node, using_dumpers = 0; int ret; struct rte_kvargs *kvlist; - struct rx_pcaps pcaps; - struct tx_pcaps dumpers; + struct rx_pcaps pcaps = {0}; + struct tx_pcaps dumpers = {0}; RTE_LOG(INFO, PMD, "Initializing pmd_pcap for %s\n", name); @@ -1083,10 +1084,15 @@ rte_pmd_pcap_devuninit(const char *name) } static struct rte_driver pmd_pcap_drv = { - .name = "eth_pcap", .type = PMD_VDEV, .init = rte_pmd_pcap_devinit, .uninit = rte_pmd_pcap_devuninit, }; -PMD_REGISTER_DRIVER(pmd_pcap_drv); +PMD_REGISTER_DRIVER(pmd_pcap_drv, net_pcap); +DRIVER_REGISTER_PARAM_STRING(net_pcap, + "rx_pcap= " + "tx_pcap= " + "rx_iface= " + "tx_iface= " + "iface=");