crypto/dpaa2_sec: support event crypto adapter
[dpdk.git] / drivers / net / vhost / rte_eth_vhost.c
index 0d000c7..a7604ff 100644 (file)
@@ -400,7 +400,6 @@ eth_vhost_rx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
 
        for (i = 0; likely(i < nb_rx); i++) {
                bufs[i]->port = r->port;
-               bufs[i]->ol_flags = 0;
                bufs[i]->vlan_tci = 0;
 
                if (r->internal->vlan_strip)
@@ -492,12 +491,7 @@ eth_dev_configure(struct rte_eth_dev *dev __rte_unused)
        struct pmd_internal *internal = dev->data->dev_private;
        const struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode;
 
-       internal->vlan_strip = rxmode->hw_vlan_strip;
-
-       if (rxmode->hw_vlan_filter)
-               VHOST_LOG(WARNING,
-                       "vhost(%s): vlan filtering not available\n",
-                       internal->dev_name);
+       internal->vlan_strip = !!(rxmode->offloads & DEV_RX_OFFLOAD_VLAN_STRIP);
 
        return 0;
 }
@@ -1073,6 +1067,10 @@ eth_dev_info(struct rte_eth_dev *dev,
        dev_info->max_rx_queues = internal->max_queues;
        dev_info->max_tx_queues = internal->max_queues;
        dev_info->min_rx_bufsize = 0;
+
+       dev_info->tx_offload_capa = DEV_TX_OFFLOAD_MULTI_SEGS |
+                               DEV_TX_OFFLOAD_VLAN_INSERT;
+       dev_info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP;
 }
 
 static int
@@ -1346,8 +1344,7 @@ rte_pmd_vhost_probe(struct rte_vdev_device *dev)
 
        VHOST_LOG(INFO, "Initializing pmd_vhost for %s\n", name);
 
-       if (rte_eal_process_type() == RTE_PROC_SECONDARY &&
-           strlen(rte_vdev_device_args(dev)) == 0) {
+       if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
                eth_dev = rte_eth_dev_attach_secondary(name);
                if (!eth_dev) {
                        VHOST_LOG(ERR, "Failed to probe %s\n", name);
@@ -1355,6 +1352,7 @@ rte_pmd_vhost_probe(struct rte_vdev_device *dev)
                }
                /* TODO: request info from primary to set up Rx and Tx */
                eth_dev->dev_ops = &ops;
+               eth_dev->device = &dev->device;
                rte_eth_dev_probing_finish(eth_dev);
                return 0;
        }
@@ -1437,6 +1435,9 @@ rte_pmd_vhost_remove(struct rte_vdev_device *dev)
        if (eth_dev == NULL)
                return -ENODEV;
 
+       if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+               return rte_eth_dev_release_port_secondary(eth_dev);
+
        eth_dev_close(eth_dev);
 
        rte_free(vring_states[eth_dev->data->port_id]);
@@ -1458,9 +1459,7 @@ RTE_PMD_REGISTER_PARAM_STRING(net_vhost,
        "iface=<ifc> "
        "queues=<int>");
 
-RTE_INIT(vhost_init_log);
-static void
-vhost_init_log(void)
+RTE_INIT(vhost_init_log)
 {
        vhost_logtype = rte_log_register("pmd.net.vhost");
        if (vhost_logtype >= 0)