ethdev: rename memzones allocated for DMA
[dpdk.git] / lib / librte_ethdev / rte_ethdev.c
index 4930eb6..571f0e8 100644 (file)
@@ -126,6 +126,8 @@ static const struct {
        RTE_RX_OFFLOAD_BIT2STR(TIMESTAMP),
        RTE_RX_OFFLOAD_BIT2STR(SECURITY),
        RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC),
+       RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
+       RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
@@ -157,6 +159,7 @@ static const struct {
        RTE_TX_OFFLOAD_BIT2STR(SECURITY),
        RTE_TX_OFFLOAD_BIT2STR(UDP_TNL_TSO),
        RTE_TX_OFFLOAD_BIT2STR(IP_TNL_TSO),
+       RTE_TX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
 };
 
 #undef RTE_TX_OFFLOAD_BIT2STR
@@ -359,6 +362,18 @@ rte_eth_dev_attach_secondary(const char *name)
        return eth_dev;
 }
 
+int
+rte_eth_dev_release_port_secondary(struct rte_eth_dev *eth_dev)
+{
+       if (eth_dev == NULL)
+               return -EINVAL;
+
+       _rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_DESTROY, NULL);
+       eth_dev->state = RTE_ETH_DEV_UNUSED;
+
+       return 0;
+}
+
 int
 rte_eth_dev_release_port(struct rte_eth_dev *eth_dev)
 {
@@ -3478,9 +3493,8 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *dev, const char *ring_name,
        char z_name[RTE_MEMZONE_NAMESIZE];
        const struct rte_memzone *mz;
 
-       snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d",
-                dev->device->driver->name, ring_name,
-                dev->data->port_id, queue_id);
+       snprintf(z_name, sizeof(z_name), "eth_p%d_q%d_%s",
+                dev->data->port_id, queue_id, ring_name);
 
        mz = rte_memzone_lookup(z_name);
        if (mz)
@@ -3575,9 +3589,10 @@ rte_eth_dev_destroy(struct rte_eth_dev *ethdev,
                        return ret;
        }
 
-       if (rte_eal_process_type() == RTE_PROC_PRIMARY)
-               rte_free(ethdev->data->dev_private);
+       if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+               return rte_eth_dev_release_port_secondary(ethdev);
 
+       rte_free(ethdev->data->dev_private);
        ethdev->data->dev_private = NULL;
 
        return rte_eth_dev_release_port(ethdev);