net/ixgbe: revert default PF device name
[dpdk.git] / drivers / net / i40e / i40e_rxtx.c
index ec1ce54..62985c3 100644 (file)
@@ -40,9 +40,6 @@
 /* Base address of the HW descriptor ring should be 128B aligned. */
 #define I40E_RING_BASE_ALIGN   128
 
-#define I40E_SIMPLE_FLAGS ((uint32_t)ETH_TXQ_FLAGS_NOMULTSEGS | \
-                                       ETH_TXQ_FLAGS_NOOFFLOADS)
-
 #define I40E_TXD_CMD (I40E_TX_DESC_CMD_EOP | I40E_TX_DESC_CMD_RS)
 
 #ifdef RTE_LIBRTE_IEEE1588
@@ -1240,7 +1237,7 @@ i40e_tx_free_bufs(struct i40e_tx_queue *txq)
        for (i = 0; i < txq->tx_rs_thresh; i++)
                rte_prefetch0((txep + i)->mbuf);
 
-       if (txq->txq_flags & (uint32_t)ETH_TXQ_FLAGS_NOREFCOUNT) {
+       if (txq->offloads & DEV_TX_OFFLOAD_MBUF_FAST_FREE) {
                for (i = 0; i < txq->tx_rs_thresh; ++i, ++txep) {
                        rte_mempool_put(txep->mbuf->pool, txep->mbuf);
                        txep->mbuf = NULL;
@@ -1860,6 +1857,7 @@ i40e_dev_rx_queue_setup(struct rte_eth_dev *dev,
        rxq->drop_en = rx_conf->rx_drop_en;
        rxq->vsi = vsi;
        rxq->rx_deferred_start = rx_conf->rx_deferred_start;
+       rxq->offloads = rx_conf->offloads;
 
        /* Allocate the maximun number of RX ring hardware descriptor. */
        len = I40E_MAX_RING_DESC;
@@ -2108,11 +2106,9 @@ i40e_dev_tx_queue_setup_runtime(struct rte_eth_dev *dev,
                                 dev->data->nb_tx_queues)) {
                /**
                 * If it is the first queue to setup,
-                * set all flags to default and call
+                * set all flags and call
                 * i40e_set_tx_function.
                 */
-               ad->tx_simple_allowed = true;
-               ad->tx_vec_allowed = true;
                i40e_set_tx_function_flag(dev, txq);
                i40e_set_tx_function(dev);
                return 0;
@@ -2128,9 +2124,8 @@ i40e_dev_tx_queue_setup_runtime(struct rte_eth_dev *dev,
        }
        /* check simple tx conflict */
        if (ad->tx_simple_allowed) {
-               if (((txq->txq_flags & I40E_SIMPLE_FLAGS) !=
-                    I40E_SIMPLE_FLAGS) ||
-                   txq->tx_rs_thresh < RTE_PMD_I40E_TX_MAX_BURST) {
+               if (txq->offloads != 0 ||
+                               txq->tx_rs_thresh < RTE_PMD_I40E_TX_MAX_BURST) {
                        PMD_DRV_LOG(ERR, "No-simple tx is required.");
                        return -EINVAL;
                }
@@ -2302,7 +2297,7 @@ i40e_dev_tx_queue_setup(struct rte_eth_dev *dev,
        txq->queue_id = queue_idx;
        txq->reg_idx = reg_idx;
        txq->port_id = dev->data->port_id;
-       txq->txq_flags = tx_conf->txq_flags;
+       txq->offloads = tx_conf->offloads;
        txq->vsi = vsi;
        txq->tx_deferred_start = tx_conf->tx_deferred_start;
 
@@ -2955,7 +2950,6 @@ i40e_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 
        qinfo->conf.tx_free_thresh = txq->tx_free_thresh;
        qinfo->conf.tx_rs_thresh = txq->tx_rs_thresh;
-       qinfo->conf.txq_flags = txq->txq_flags;
        qinfo->conf.tx_deferred_start = txq->tx_deferred_start;
 }
 
@@ -3080,18 +3074,21 @@ i40e_set_tx_function_flag(struct rte_eth_dev *dev, struct i40e_tx_queue *txq)
                I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 
        /* Use a simple Tx queue (no offloads, no multi segs) if possible */
-       if (((txq->txq_flags & I40E_SIMPLE_FLAGS) == I40E_SIMPLE_FLAGS)
-                       && (txq->tx_rs_thresh >= RTE_PMD_I40E_TX_MAX_BURST)) {
-               if (txq->tx_rs_thresh <= RTE_I40E_TX_MAX_FREE_BUF_SZ) {
-                       PMD_INIT_LOG(DEBUG, "Vector tx"
-                                    " can be enabled on this txq.");
-
-               } else {
-                       ad->tx_vec_allowed = false;
-               }
-       } else {
-               ad->tx_simple_allowed = false;
-       }
+       ad->tx_simple_allowed = (txq->offloads == 0 &&
+                       txq->tx_rs_thresh >= RTE_PMD_I40E_TX_MAX_BURST);
+       ad->tx_vec_allowed = (ad->tx_simple_allowed &&
+                       txq->tx_rs_thresh <= RTE_I40E_TX_MAX_FREE_BUF_SZ);
+
+       if (ad->tx_vec_allowed)
+               PMD_INIT_LOG(DEBUG, "Vector Tx can be enabled on Tx queue %u.",
+                               txq->queue_id);
+       else if (ad->tx_simple_allowed)
+               PMD_INIT_LOG(DEBUG, "Simple Tx can be enabled on Tx queue %u.",
+                               txq->queue_id);
+       else
+               PMD_INIT_LOG(DEBUG,
+                               "Neither simple nor vector Tx enabled on Tx queue %u\n",
+                               txq->queue_id);
 }
 
 void __attribute__((cold))