From 5e305acc2ec401688ee6c1ba2765b483ae953e07 Mon Sep 17 00:00:00 2001 From: Intel Date: Thu, 20 Dec 2012 00:00:00 +0100 Subject: [PATCH] igb: various updates Signed-off-by: Intel --- lib/librte_pmd_e1000/igb_ethdev.c | 17 ++++++++++------- lib/librte_pmd_e1000/igb_rxtx.c | 6 ++++++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/lib/librte_pmd_e1000/igb_ethdev.c b/lib/librte_pmd_e1000/igb_ethdev.c index c6130f51ca..514b5377bf 100644 --- a/lib/librte_pmd_e1000/igb_ethdev.c +++ b/lib/librte_pmd_e1000/igb_ethdev.c @@ -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); diff --git a/lib/librte_pmd_e1000/igb_rxtx.c b/lib/librte_pmd_e1000/igb_rxtx.c index 648011d837..3cb4109174 100644 --- a/lib/librte_pmd_e1000/igb_rxtx.c +++ b/lib/librte_pmd_e1000/igb_rxtx.c @@ -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. */ -- 2.20.1