net/netvsc: split send buffers from Tx descriptors
[dpdk.git] / drivers / net / netvsc / hn_ethdev.c
index 159116f..ac66108 100644 (file)
@@ -257,15 +257,19 @@ static int hn_dev_info_get(struct rte_eth_dev *dev,
        dev_info->max_rx_queues = hv->max_queues;
        dev_info->max_tx_queues = hv->max_queues;
 
-       rc = hn_rndis_get_offload(hv, dev_info);
-       if (rc != 0)
-               return rc;
+       dev_info->tx_desc_lim.nb_min = 1;
+       dev_info->tx_desc_lim.nb_max = 4096;
+
+       if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+               return 0;
 
-       rc = hn_vf_info_get(hv, dev_info);
+       /* fills in rx and tx offload capability */
+       rc = hn_rndis_get_offload(hv, dev_info);
        if (rc != 0)
                return rc;
 
-       return 0;
+       /* merges the offload and queues of vf */
+       return hn_vf_info_get(hv, dev_info);
 }
 
 static int hn_rss_reta_update(struct rte_eth_dev *dev,
@@ -822,6 +826,10 @@ hn_dev_start(struct rte_eth_dev *dev)
        if (error)
                hn_rndis_set_rxfilter(hv, 0);
 
+       /* Initialize Link state */
+       if (error == 0)
+               hn_dev_link_update(dev, 0);
+
        return error;
 }
 
@@ -929,6 +937,9 @@ eth_hn_dev_init(struct rte_eth_dev *eth_dev)
        eth_dev->tx_pkt_burst = &hn_xmit_pkts;
        eth_dev->rx_pkt_burst = &hn_recv_pkts;
 
+       /* Since Hyper-V only supports one MAC address, just use local data */
+       eth_dev->data->mac_addrs = &hv->mac_addr;
+
        /*
         * for secondary processes, we don't initialize any further as primary
         * has already done this work.
@@ -936,9 +947,6 @@ eth_hn_dev_init(struct rte_eth_dev *eth_dev)
        if (rte_eal_process_type() != RTE_PROC_PRIMARY)
                return 0;
 
-       /* Since Hyper-V only supports one MAC address, just use local data */
-       eth_dev->data->mac_addrs = &hv->mac_addr;
-
        hv->vmbus = vmbus;
        hv->rxbuf_res = &vmbus->resource[HV_RECV_BUF_MAP];
        hv->chim_res  = &vmbus->resource[HV_SEND_BUF_MAP];
@@ -977,7 +985,7 @@ eth_hn_dev_init(struct rte_eth_dev *eth_dev)
        if  (err)
                goto failed;
 
-       err = hn_tx_pool_init(eth_dev);
+       err = hn_chim_init(eth_dev);
        if (err)
                goto failed;
 
@@ -1013,7 +1021,7 @@ eth_hn_dev_init(struct rte_eth_dev *eth_dev)
 failed:
        PMD_INIT_LOG(NOTICE, "device init failed");
 
-       hn_tx_pool_uninit(eth_dev);
+       hn_chim_uninit(eth_dev);
        hn_detach(hv);
        return err;
 }
@@ -1037,7 +1045,7 @@ eth_hn_dev_uninit(struct rte_eth_dev *eth_dev)
        eth_dev->rx_pkt_burst = NULL;
 
        hn_detach(hv);
-       hn_tx_pool_uninit(eth_dev);
+       hn_chim_uninit(eth_dev);
        rte_vmbus_chan_close(hv->primary->chan);
        rte_free(hv->primary);
        ret = rte_eth_dev_owner_delete(hv->owner.id);