aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>2009-07-16 11:50:12 -0400
committerDavid S. Miller <davem@davemloft.net>2009-07-17 12:47:33 -0400
commitf4ec443b2b27ecb401eee35a7bea330438556c7e (patch)
tree32cdb246f0d9789589e6eddac104642c65c357bf /drivers
parentc482c568577a2b31716e1019f2868bda7cf5629c (diff)
ixgbe: Remove legacy descriptor support
The ethtool offline test is the only consumer of the legacy descriptors. Update that path to only use advanced descriptors, and remove all support for legacy descriptors. Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ixgbe/ixgbe.h4
-rw-r--r--drivers/net/ixgbe/ixgbe_ethtool.c33
-rw-r--r--drivers/net/ixgbe/ixgbe_type.h31
3 files changed, 19 insertions, 49 deletions
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h
index cd22323cfd22..2a93e116f5a7 100644
--- a/drivers/net/ixgbe/ixgbe.h
+++ b/drivers/net/ixgbe/ixgbe.h
@@ -229,10 +229,6 @@ struct ixgbe_q_vector {
229#define IXGBE_TX_CTXTDESC_ADV(R, i) \ 229#define IXGBE_TX_CTXTDESC_ADV(R, i) \
230 (&(((struct ixgbe_adv_tx_context_desc *)((R).desc))[i])) 230 (&(((struct ixgbe_adv_tx_context_desc *)((R).desc))[i]))
231 231
232#define IXGBE_GET_DESC(R, i, type) (&(((struct type *)((R).desc))[i]))
233#define IXGBE_TX_DESC(R, i) IXGBE_GET_DESC(R, i, ixgbe_legacy_tx_desc)
234#define IXGBE_RX_DESC(R, i) IXGBE_GET_DESC(R, i, ixgbe_legacy_rx_desc)
235
236#define IXGBE_MAX_JUMBO_FRAME_SIZE 16128 232#define IXGBE_MAX_JUMBO_FRAME_SIZE 16128
237#ifdef IXGBE_FCOE 233#ifdef IXGBE_FCOE
238/* Use 3K as the baby jumbo frame size for FCoE */ 234/* Use 3K as the baby jumbo frame size for FCoE */
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index 2a978008fd6e..1464b33f1b8e 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -1440,7 +1440,7 @@ static int ixgbe_setup_desc_rings(struct ixgbe_adapter *adapter)
1440 goto err_nomem; 1440 goto err_nomem;
1441 } 1441 }
1442 1442
1443 tx_ring->size = tx_ring->count * sizeof(struct ixgbe_legacy_tx_desc); 1443 tx_ring->size = tx_ring->count * sizeof(union ixgbe_adv_tx_desc);
1444 tx_ring->size = ALIGN(tx_ring->size, 4096); 1444 tx_ring->size = ALIGN(tx_ring->size, 4096);
1445 if (!(tx_ring->desc = pci_alloc_consistent(pdev, tx_ring->size, 1445 if (!(tx_ring->desc = pci_alloc_consistent(pdev, tx_ring->size,
1446 &tx_ring->dma))) { 1446 &tx_ring->dma))) {
@@ -1454,7 +1454,7 @@ static int ixgbe_setup_desc_rings(struct ixgbe_adapter *adapter)
1454 IXGBE_WRITE_REG(&adapter->hw, IXGBE_TDBAH(0), 1454 IXGBE_WRITE_REG(&adapter->hw, IXGBE_TDBAH(0),
1455 ((u64) tx_ring->dma >> 32)); 1455 ((u64) tx_ring->dma >> 32));
1456 IXGBE_WRITE_REG(&adapter->hw, IXGBE_TDLEN(0), 1456 IXGBE_WRITE_REG(&adapter->hw, IXGBE_TDLEN(0),
1457 tx_ring->count * sizeof(struct ixgbe_legacy_tx_desc)); 1457 tx_ring->count * sizeof(union ixgbe_adv_tx_desc));
1458 IXGBE_WRITE_REG(&adapter->hw, IXGBE_TDH(0), 0); 1458 IXGBE_WRITE_REG(&adapter->hw, IXGBE_TDH(0), 0);
1459 IXGBE_WRITE_REG(&adapter->hw, IXGBE_TDT(0), 0); 1459 IXGBE_WRITE_REG(&adapter->hw, IXGBE_TDT(0), 0);
1460 1460
@@ -1472,7 +1472,7 @@ static int ixgbe_setup_desc_rings(struct ixgbe_adapter *adapter)
1472 IXGBE_WRITE_REG(&adapter->hw, IXGBE_TXDCTL(0), reg_data); 1472 IXGBE_WRITE_REG(&adapter->hw, IXGBE_TXDCTL(0), reg_data);
1473 1473
1474 for (i = 0; i < tx_ring->count; i++) { 1474 for (i = 0; i < tx_ring->count; i++) {
1475 struct ixgbe_legacy_tx_desc *desc = IXGBE_TX_DESC(*tx_ring, i); 1475 union ixgbe_adv_tx_desc *desc = IXGBE_TX_DESC_ADV(*tx_ring, i);
1476 struct sk_buff *skb; 1476 struct sk_buff *skb;
1477 unsigned int size = 1024; 1477 unsigned int size = 1024;
1478 1478
@@ -1486,13 +1486,18 @@ static int ixgbe_setup_desc_rings(struct ixgbe_adapter *adapter)
1486 tx_ring->tx_buffer_info[i].length = skb->len; 1486 tx_ring->tx_buffer_info[i].length = skb->len;
1487 tx_ring->tx_buffer_info[i].dma = 1487 tx_ring->tx_buffer_info[i].dma =
1488 pci_map_single(pdev, skb->data, skb->len, 1488 pci_map_single(pdev, skb->data, skb->len,
1489 PCI_DMA_TODEVICE); 1489 PCI_DMA_TODEVICE);
1490 desc->buffer_addr = cpu_to_le64(tx_ring->tx_buffer_info[i].dma); 1490 desc->read.buffer_addr =
1491 desc->lower.data = cpu_to_le32(skb->len); 1491 cpu_to_le64(tx_ring->tx_buffer_info[i].dma);
1492 desc->lower.data |= cpu_to_le32(IXGBE_TXD_CMD_EOP | 1492 desc->read.cmd_type_len = cpu_to_le32(skb->len);
1493 IXGBE_TXD_CMD_IFCS | 1493 desc->read.cmd_type_len |= cpu_to_le32(IXGBE_TXD_CMD_EOP |
1494 IXGBE_TXD_CMD_RS); 1494 IXGBE_TXD_CMD_IFCS |
1495 desc->upper.data = 0; 1495 IXGBE_TXD_CMD_RS);
1496 desc->read.olinfo_status = 0;
1497 if (adapter->hw.mac.type == ixgbe_mac_82599EB)
1498 desc->read.olinfo_status |=
1499 (skb->len << IXGBE_ADVTXD_PAYLEN_SHIFT);
1500
1496 } 1501 }
1497 1502
1498 /* Setup Rx Descriptor ring and Rx buffers */ 1503 /* Setup Rx Descriptor ring and Rx buffers */
@@ -1508,7 +1513,7 @@ static int ixgbe_setup_desc_rings(struct ixgbe_adapter *adapter)
1508 goto err_nomem; 1513 goto err_nomem;
1509 } 1514 }
1510 1515
1511 rx_ring->size = rx_ring->count * sizeof(struct ixgbe_legacy_rx_desc); 1516 rx_ring->size = rx_ring->count * sizeof(union ixgbe_adv_rx_desc);
1512 rx_ring->size = ALIGN(rx_ring->size, 4096); 1517 rx_ring->size = ALIGN(rx_ring->size, 4096);
1513 if (!(rx_ring->desc = pci_alloc_consistent(pdev, rx_ring->size, 1518 if (!(rx_ring->desc = pci_alloc_consistent(pdev, rx_ring->size,
1514 &rx_ring->dma))) { 1519 &rx_ring->dma))) {
@@ -1566,8 +1571,8 @@ static int ixgbe_setup_desc_rings(struct ixgbe_adapter *adapter)
1566 IXGBE_WRITE_REG(&adapter->hw, IXGBE_RXCTRL, rctl); 1571 IXGBE_WRITE_REG(&adapter->hw, IXGBE_RXCTRL, rctl);
1567 1572
1568 for (i = 0; i < rx_ring->count; i++) { 1573 for (i = 0; i < rx_ring->count; i++) {
1569 struct ixgbe_legacy_rx_desc *rx_desc = 1574 union ixgbe_adv_rx_desc *rx_desc =
1570 IXGBE_RX_DESC(*rx_ring, i); 1575 IXGBE_RX_DESC_ADV(*rx_ring, i);
1571 struct sk_buff *skb; 1576 struct sk_buff *skb;
1572 1577
1573 skb = alloc_skb(IXGBE_RXBUFFER_2048 + NET_IP_ALIGN, GFP_KERNEL); 1578 skb = alloc_skb(IXGBE_RXBUFFER_2048 + NET_IP_ALIGN, GFP_KERNEL);
@@ -1580,7 +1585,7 @@ static int ixgbe_setup_desc_rings(struct ixgbe_adapter *adapter)
1580 rx_ring->rx_buffer_info[i].dma = 1585 rx_ring->rx_buffer_info[i].dma =
1581 pci_map_single(pdev, skb->data, IXGBE_RXBUFFER_2048, 1586 pci_map_single(pdev, skb->data, IXGBE_RXBUFFER_2048,
1582 PCI_DMA_FROMDEVICE); 1587 PCI_DMA_FROMDEVICE);
1583 rx_desc->buffer_addr = 1588 rx_desc->read.pkt_addr =
1584 cpu_to_le64(rx_ring->rx_buffer_info[i].dma); 1589 cpu_to_le64(rx_ring->rx_buffer_info[i].dma);
1585 memset(skb->data, 0x00, skb->len); 1590 memset(skb->data, 0x00, skb->len);
1586 } 1591 }
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h
index fa87309dc087..8fb6ade0c629 100644
--- a/drivers/net/ixgbe/ixgbe_type.h
+++ b/drivers/net/ixgbe/ixgbe_type.h
@@ -1893,27 +1893,6 @@ enum ixgbe_fdir_pballoc_type {
1893#define IXGBE_FDIR_INIT_DONE_POLL 10 1893#define IXGBE_FDIR_INIT_DONE_POLL 10
1894#define IXGBE_FDIRCMD_CMD_POLL 10 1894#define IXGBE_FDIRCMD_CMD_POLL 10
1895 1895
1896/* Transmit Descriptor - Legacy */
1897struct ixgbe_legacy_tx_desc {
1898 u64 buffer_addr; /* Address of the descriptor's data buffer */
1899 union {
1900 __le32 data;
1901 struct {
1902 __le16 length; /* Data buffer length */
1903 u8 cso; /* Checksum offset */
1904 u8 cmd; /* Descriptor control */
1905 } flags;
1906 } lower;
1907 union {
1908 __le32 data;
1909 struct {
1910 u8 status; /* Descriptor status */
1911 u8 css; /* Checksum start */
1912 __le16 vlan;
1913 } fields;
1914 } upper;
1915};
1916
1917/* Transmit Descriptor - Advanced */ 1896/* Transmit Descriptor - Advanced */
1918union ixgbe_adv_tx_desc { 1897union ixgbe_adv_tx_desc {
1919 struct { 1898 struct {
@@ -1928,16 +1907,6 @@ union ixgbe_adv_tx_desc {
1928 } wb; 1907 } wb;
1929}; 1908};
1930 1909
1931/* Receive Descriptor - Legacy */
1932struct ixgbe_legacy_rx_desc {
1933 __le64 buffer_addr; /* Address of the descriptor's data buffer */
1934 __le16 length; /* Length of data DMAed into data buffer */
1935 __le16 csum; /* Packet checksum */
1936 u8 status; /* Descriptor status */
1937 u8 errors; /* Descriptor Errors */
1938 __le16 vlan;
1939};
1940
1941/* Receive Descriptor - Advanced */ 1910/* Receive Descriptor - Advanced */
1942union ixgbe_adv_rx_desc { 1911union ixgbe_adv_rx_desc {
1943 struct { 1912 struct {