ethdev: support metadata as flow rule criteria
[dpdk.git] / lib / librte_ethdev / rte_ethdev.c
index 178800a..51d9069 100644 (file)
@@ -160,6 +160,7 @@ static const struct {
        RTE_TX_OFFLOAD_BIT2STR(UDP_TNL_TSO),
        RTE_TX_OFFLOAD_BIT2STR(IP_TNL_TSO),
        RTE_TX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
+       RTE_TX_OFFLOAD_BIT2STR(MATCH_METADATA),
 };
 
 #undef RTE_TX_OFFLOAD_BIT2STR
@@ -1384,6 +1385,16 @@ rte_eth_dev_close(uint16_t port_id)
        dev->data->dev_started = 0;
        (*dev->dev_ops->dev_close)(dev);
 
+       /* check behaviour flag - temporary for PMD migration */
+       if ((dev->data->dev_flags & RTE_ETH_DEV_CLOSE_REMOVE) != 0) {
+               /* new behaviour: send event + reset state + free all data */
+               rte_eth_dev_release_port(dev);
+               return;
+       }
+       RTE_ETHDEV_LOG(DEBUG, "Port closing is using an old behaviour.\n"
+                       "The driver %s should migrate to the new behaviour.\n",
+                       dev->device->driver->name);
+       /* old behaviour: only free queue arrays */
        dev->data->nb_rx_queues = 0;
        rte_free(dev->data->rx_queues);
        dev->data->rx_queues = NULL;