igbvf: fix mac type for 82576
[dpdk.git] / lib / librte_pmd_e1000 / igb_rxtx.c
index 7e7bd4b..7fe1780 100644 (file)
@@ -33,7 +33,6 @@
 
 #include <sys/queue.h>
 
-#include <endian.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -1239,6 +1238,8 @@ eth_igb_tx_queue_setup(struct rte_eth_dev *dev,
        txq->pthresh = tx_conf->tx_thresh.pthresh;
        txq->hthresh = tx_conf->tx_thresh.hthresh;
        txq->wthresh = tx_conf->tx_thresh.wthresh;
+       if (txq->wthresh > 0 && hw->mac.type == e1000_82576)
+               txq->wthresh = 1;
        txq->queue_id = queue_idx;
        txq->reg_idx = (uint16_t)((RTE_ETH_DEV_SRIOV(dev).active == 0) ?
                queue_idx : RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx + queue_idx);
@@ -1358,6 +1359,8 @@ eth_igb_rx_queue_setup(struct rte_eth_dev *dev,
        rxq->pthresh = rx_conf->rx_thresh.pthresh;
        rxq->hthresh = rx_conf->rx_thresh.hthresh;
        rxq->wthresh = rx_conf->rx_thresh.wthresh;
+       if (rxq->wthresh > 0 && hw->mac.type == e1000_82576)
+               rxq->wthresh = 1;
        rxq->drop_en = rx_conf->rx_drop_en;
        rxq->rx_free_thresh = rx_conf->rx_free_thresh;
        rxq->queue_id = queue_idx;
@@ -1753,8 +1756,7 @@ igb_dev_mq_rx_configure(struct rte_eth_dev *dev)
                /*
                * SRIOV inactive scheme
                */
-               if (dev->data->nb_rx_queues > 1)
-                       switch (dev->data->dev_conf.rxmode.mq_mode) {
+               switch (dev->data->dev_conf.rxmode.mq_mode) {
                        case ETH_MQ_RX_RSS:
                                igb_rss_configure(dev);
                                break;
@@ -1767,9 +1769,7 @@ igb_dev_mq_rx_configure(struct rte_eth_dev *dev)
                        default: 
                                igb_rss_disable(dev);
                                break;
-                       }
-               else
-                       igb_rss_disable(dev);
+               }
        }
  
        return 0;
@@ -2077,6 +2077,11 @@ eth_igbvf_rx_init(struct rte_eth_dev *dev)
 
        hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
+       /* setup MTU */
+       e1000_rlpml_set_vf(hw,
+               (uint16_t)(dev->data->dev_conf.rxmode.max_rx_pkt_len +
+               VLAN_TAG_SIZE));
+
        /* Configure and enable each RX queue. */
        rctl_bsize = 0;
        dev->rx_pkt_burst = eth_igb_recv_pkts;
@@ -2149,7 +2154,7 @@ eth_igbvf_rx_init(struct rte_eth_dev *dev)
                rxdctl &= 0xFFF00000;
                rxdctl |= (rxq->pthresh & 0x1F);
                rxdctl |= ((rxq->hthresh & 0x1F) << 8);
-               if (hw->mac.type == e1000_82576) {
+               if (hw->mac.type == e1000_vfadapt) {
                        /* 
                         * Workaround of 82576 VF Erratum
                         * force set WTHRESH to 1