igb: various updates
authorIntel <intel.com>
Wed, 19 Dec 2012 23:00:00 +0000 (00:00 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 25 Jul 2013 13:40:55 +0000 (15:40 +0200)
Signed-off-by: Intel
lib/librte_pmd_e1000/igb_ethdev.c
lib/librte_pmd_e1000/igb_rxtx.c

index c6130f5..514b537 100644 (file)
@@ -614,9 +614,6 @@ eth_igb_start(struct rte_eth_dev *dev)
                E1000_WRITE_REG(hw, E1000_EITR(0), 0xFFFF);
        }
 
-       /* Don't reset the phy next time init gets called */
-       hw->phy.reset_disable = 1;
-
        /* Setup link speed and duplex */
        switch (dev->data->dev_conf.link_speed) {
        case ETH_LINK_SPEED_AUTONEG:
@@ -662,11 +659,17 @@ eth_igb_start(struct rte_eth_dev *dev)
        }
        e1000_setup_link(hw);
 
-       PMD_INIT_LOG(DEBUG, "<<");
-
        /* check if lsc interrupt feature is enabled */
-       if (dev->data->dev_conf.intr_conf.lsc != 0)
-               return eth_igb_interrupt_setup(dev);
+       if (dev->data->dev_conf.intr_conf.lsc != 0) {
+               ret = eth_igb_interrupt_setup(dev);
+               if (ret) {
+                       PMD_INIT_LOG(ERR, "Unable to setup interrupts");
+                       igb_dev_clear_queues(dev);
+                       return ret;
+               }
+       }
+
+       PMD_INIT_LOG(DEBUG, "<<");
 
        return (0);
 
index 648011d..3cb4109 100644 (file)
@@ -130,6 +130,7 @@ struct igb_rx_queue {
        uint8_t             hthresh;    /**< Host threshold register. */
        uint8_t             wthresh;    /**< Write-back threshold register. */
        uint8_t             crc_len;    /**< 0 if CRC stripped, 4 otherwise. */
+       uint8_t             drop_en;  /**< If not 0, set SRRCTL.Drop_En. */
 };
 
 /**
@@ -1385,6 +1386,7 @@ 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;
+       rxq->drop_en = rx_conf->rx_drop_en;
        rxq->rx_free_thresh = rx_conf->rx_free_thresh;
        rxq->queue_id = queue_idx;
        rxq->port_id = dev->data->port_id;
@@ -1695,6 +1697,10 @@ eth_igb_rx_init(struct rte_eth_dev *dev)
                        dev->data->scattered_rx = 1;
                }
 
+               /* Set if packets are dropped when no descriptors available */
+               if (rxq->drop_en)
+                       srrctl |= E1000_SRRCTL_DROP_EN;
+
                E1000_WRITE_REG(hw, E1000_SRRCTL(i), srrctl);
 
                /* Enable this RX queue. */