update Intel copyright years to 2014
[dpdk.git] / lib / librte_pmd_e1000 / igb_rxtx.c
index 2da0e8e..9e3bec5 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  * 
- *   Copyright(c) 2010-2013 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
  *   All rights reserved.
  * 
  *   Redistribution and use in source and binary forms, with or without
@@ -1134,16 +1134,16 @@ igb_reset_tx_queue_stat(struct igb_tx_queue *txq)
 static void
 igb_reset_tx_queue(struct igb_tx_queue *txq, struct rte_eth_dev *dev)
 {
+       static const union e1000_adv_tx_desc zeroed_desc = { .read = {
+                       .buffer_addr = 0}};
        struct igb_tx_entry *txe = txq->sw_ring;
-       uint32_t size;
        uint16_t i, prev;
        struct e1000_hw *hw;
 
        hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-       size = sizeof(union e1000_adv_tx_desc) * txq->nb_tx_desc;
        /* Zero out HW ring memory */
-       for (i = 0; i < size; i++) {
-               ((volatile char *)txq->tx_ring)[i] = 0;
+       for (i = 0; i < txq->nb_tx_desc; i++) {
+               txq->tx_ring[i] = zeroed_desc;
        }
 
        /* Initialize ring entries */
@@ -1295,13 +1295,13 @@ eth_igb_rx_queue_release(void *rxq)
 static void
 igb_reset_rx_queue(struct igb_rx_queue *rxq)
 {
-       unsigned size;
+       static const union e1000_adv_rx_desc zeroed_desc = { .read = {
+                       .pkt_addr = 0}};
        unsigned i;
 
        /* Zero out HW ring memory */
-       size = sizeof(union e1000_adv_rx_desc) * rxq->nb_rx_desc;
-       for (i = 0; i < size; i++) {
-               ((volatile char *)rxq->rx_ring)[i] = 0;
+       for (i = 0; i < rxq->nb_rx_desc; i++) {
+               rxq->rx_ring[i] = zeroed_desc;
        }
 
        rxq->rx_tail = 0;
@@ -1935,8 +1935,11 @@ eth_igb_rx_init(struct rte_eth_dev *dev)
        if (dev->data->dev_conf.rxmode.hw_strip_crc) {
                rctl |= E1000_RCTL_SECRC; /* Strip Ethernet CRC. */
 
-               /* set STRCRC bit in all queues for Powerville/Springville */
-               if (hw->mac.type == e1000_i350 || hw->mac.type == e1000_i210) {
+               /* set STRCRC bit in all queues */
+               if (hw->mac.type == e1000_i350 ||
+                   hw->mac.type == e1000_i210 ||
+                   hw->mac.type == e1000_i211 ||
+                   hw->mac.type == e1000_i354) {
                        for (i = 0; i < dev->data->nb_rx_queues; i++) {
                                rxq = dev->data->rx_queues[i];
                                uint32_t dvmolr = E1000_READ_REG(hw,
@@ -1948,8 +1951,11 @@ eth_igb_rx_init(struct rte_eth_dev *dev)
        } else {
                rctl &= ~E1000_RCTL_SECRC; /* Do not Strip Ethernet CRC. */
 
-               /* clear STRCRC bit in all queues for Powerville/Springville */
-               if (hw->mac.type == e1000_i350 || hw->mac.type == e1000_i210) {
+               /* clear STRCRC bit in all queues */
+               if (hw->mac.type == e1000_i350 ||
+                   hw->mac.type == e1000_i210 ||
+                   hw->mac.type == e1000_i211 ||
+                   hw->mac.type == e1000_i354) {
                        for (i = 0; i < dev->data->nb_rx_queues; i++) {
                                rxq = dev->data->rx_queues[i];
                                uint32_t dvmolr = E1000_READ_REG(hw,