aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>2009-06-04 12:01:06 -0400
committerDavid S. Miller <davem@davemloft.net>2009-06-07 08:20:23 -0400
commitbfde493ee279b345d31e3178832971606b5b854f (patch)
tree6861aef857bf3e081769c639af3f8379c4240ae9
parentdf647b5ca3c3a84e5e5f8e7da36b5ffc17276ec7 (diff)
ixgbe: Add hardware defines for Flow Director for 82599
Flow Director is a Rx filter mechanism designed to match Rx flows back to the same CPU that the flow's Tx occurred from. This patch adds the first piece, the defines for the hardware registers, to enable this feature in 82599 hardware. 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>
-rw-r--r--drivers/net/ixgbe/ixgbe_type.h147
1 files changed, 147 insertions, 0 deletions
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h
index 4402552eb3ec..68cac3674f9a 100644
--- a/drivers/net/ixgbe/ixgbe_type.h
+++ b/drivers/net/ixgbe/ixgbe_type.h
@@ -231,6 +231,34 @@
231#define IXGBE_RETA(_i) (0x05C00 + ((_i) * 4)) /* 32 of these (0-31) */ 231#define IXGBE_RETA(_i) (0x05C00 + ((_i) * 4)) /* 32 of these (0-31) */
232#define IXGBE_RSSRK(_i) (0x05C80 + ((_i) * 4)) /* 10 of these (0-9) */ 232#define IXGBE_RSSRK(_i) (0x05C80 + ((_i) * 4)) /* 10 of these (0-9) */
233 233
234/* Flow Director registers */
235#define IXGBE_FDIRCTRL 0x0EE00
236#define IXGBE_FDIRHKEY 0x0EE68
237#define IXGBE_FDIRSKEY 0x0EE6C
238#define IXGBE_FDIRDIP4M 0x0EE3C
239#define IXGBE_FDIRSIP4M 0x0EE40
240#define IXGBE_FDIRTCPM 0x0EE44
241#define IXGBE_FDIRUDPM 0x0EE48
242#define IXGBE_FDIRIP6M 0x0EE74
243#define IXGBE_FDIRM 0x0EE70
244
245/* Flow Director Stats registers */
246#define IXGBE_FDIRFREE 0x0EE38
247#define IXGBE_FDIRLEN 0x0EE4C
248#define IXGBE_FDIRUSTAT 0x0EE50
249#define IXGBE_FDIRFSTAT 0x0EE54
250#define IXGBE_FDIRMATCH 0x0EE58
251#define IXGBE_FDIRMISS 0x0EE5C
252
253/* Flow Director Programming registers */
254#define IXGBE_FDIRSIPv6(_i) (0x0EE0C + ((_i) * 4)) /* 3 of these (0-2) */
255#define IXGBE_FDIRIPSA 0x0EE18
256#define IXGBE_FDIRIPDA 0x0EE1C
257#define IXGBE_FDIRPORT 0x0EE20
258#define IXGBE_FDIRVLAN 0x0EE24
259#define IXGBE_FDIRHASH 0x0EE28
260#define IXGBE_FDIRCMD 0x0EE2C
261
234/* Transmit DMA registers */ 262/* Transmit DMA registers */
235#define IXGBE_TDBAL(_i) (0x06000 + ((_i) * 0x40)) /* 32 of these (0-31)*/ 263#define IXGBE_TDBAL(_i) (0x06000 + ((_i) * 0x40)) /* 32 of these (0-31)*/
236#define IXGBE_TDBAH(_i) (0x06004 + ((_i) * 0x40)) 264#define IXGBE_TDBAH(_i) (0x06004 + ((_i) * 0x40))
@@ -1652,6 +1680,9 @@
1652#define IXGBE_RXDADV_ERR_SHIFT 20 /* RDESC.ERRORS shift */ 1680#define IXGBE_RXDADV_ERR_SHIFT 20 /* RDESC.ERRORS shift */
1653#define IXGBE_RXDADV_ERR_FCEOFE 0x80000000 /* FCoEFe/IPE */ 1681#define IXGBE_RXDADV_ERR_FCEOFE 0x80000000 /* FCoEFe/IPE */
1654#define IXGBE_RXDADV_ERR_FCERR 0x00700000 /* FCERR/FDIRERR */ 1682#define IXGBE_RXDADV_ERR_FCERR 0x00700000 /* FCERR/FDIRERR */
1683#define IXGBE_RXDADV_ERR_FDIR_LEN 0x00100000 /* FDIR Length error */
1684#define IXGBE_RXDADV_ERR_FDIR_DROP 0x00200000 /* FDIR Drop error */
1685#define IXGBE_RXDADV_ERR_FDIR_COLL 0x00400000 /* FDIR Collision error */
1655#define IXGBE_RXDADV_ERR_HBO 0x00800000 /*Header Buffer Overflow */ 1686#define IXGBE_RXDADV_ERR_HBO 0x00800000 /*Header Buffer Overflow */
1656#define IXGBE_RXDADV_ERR_CE 0x01000000 /* CRC Error */ 1687#define IXGBE_RXDADV_ERR_CE 0x01000000 /* CRC Error */
1657#define IXGBE_RXDADV_ERR_LE 0x02000000 /* Length Error */ 1688#define IXGBE_RXDADV_ERR_LE 0x02000000 /* Length Error */
@@ -1784,6 +1815,82 @@
1784 1815
1785#endif 1816#endif
1786 1817
1818enum ixgbe_fdir_pballoc_type {
1819 IXGBE_FDIR_PBALLOC_64K = 0,
1820 IXGBE_FDIR_PBALLOC_128K,
1821 IXGBE_FDIR_PBALLOC_256K,
1822};
1823#define IXGBE_FDIR_PBALLOC_SIZE_SHIFT 16
1824
1825/* Flow Director register values */
1826#define IXGBE_FDIRCTRL_PBALLOC_64K 0x00000001
1827#define IXGBE_FDIRCTRL_PBALLOC_128K 0x00000002
1828#define IXGBE_FDIRCTRL_PBALLOC_256K 0x00000003
1829#define IXGBE_FDIRCTRL_INIT_DONE 0x00000008
1830#define IXGBE_FDIRCTRL_PERFECT_MATCH 0x00000010
1831#define IXGBE_FDIRCTRL_REPORT_STATUS 0x00000020
1832#define IXGBE_FDIRCTRL_REPORT_STATUS_ALWAYS 0x00000080
1833#define IXGBE_FDIRCTRL_DROP_Q_SHIFT 8
1834#define IXGBE_FDIRCTRL_FLEX_SHIFT 16
1835#define IXGBE_FDIRCTRL_SEARCHLIM 0x00800000
1836#define IXGBE_FDIRCTRL_MAX_LENGTH_SHIFT 24
1837#define IXGBE_FDIRCTRL_FULL_THRESH_MASK 0xF0000000
1838#define IXGBE_FDIRCTRL_FULL_THRESH_SHIFT 28
1839
1840#define IXGBE_FDIRTCPM_DPORTM_SHIFT 16
1841#define IXGBE_FDIRUDPM_DPORTM_SHIFT 16
1842#define IXGBE_FDIRIP6M_DIPM_SHIFT 16
1843#define IXGBE_FDIRM_VLANID 0x00000001
1844#define IXGBE_FDIRM_VLANP 0x00000002
1845#define IXGBE_FDIRM_POOL 0x00000004
1846#define IXGBE_FDIRM_L3P 0x00000008
1847#define IXGBE_FDIRM_L4P 0x00000010
1848#define IXGBE_FDIRM_FLEX 0x00000020
1849#define IXGBE_FDIRM_DIPv6 0x00000040
1850
1851#define IXGBE_FDIRFREE_FREE_MASK 0xFFFF
1852#define IXGBE_FDIRFREE_FREE_SHIFT 0
1853#define IXGBE_FDIRFREE_COLL_MASK 0x7FFF0000
1854#define IXGBE_FDIRFREE_COLL_SHIFT 16
1855#define IXGBE_FDIRLEN_MAXLEN_MASK 0x3F
1856#define IXGBE_FDIRLEN_MAXLEN_SHIFT 0
1857#define IXGBE_FDIRLEN_MAXHASH_MASK 0x7FFF0000
1858#define IXGBE_FDIRLEN_MAXHASH_SHIFT 16
1859#define IXGBE_FDIRUSTAT_ADD_MASK 0xFFFF
1860#define IXGBE_FDIRUSTAT_ADD_SHIFT 0
1861#define IXGBE_FDIRUSTAT_REMOVE_MASK 0xFFFF0000
1862#define IXGBE_FDIRUSTAT_REMOVE_SHIFT 16
1863#define IXGBE_FDIRFSTAT_FADD_MASK 0x00FF
1864#define IXGBE_FDIRFSTAT_FADD_SHIFT 0
1865#define IXGBE_FDIRFSTAT_FREMOVE_MASK 0xFF00
1866#define IXGBE_FDIRFSTAT_FREMOVE_SHIFT 8
1867#define IXGBE_FDIRPORT_DESTINATION_SHIFT 16
1868#define IXGBE_FDIRVLAN_FLEX_SHIFT 16
1869#define IXGBE_FDIRHASH_BUCKET_VALID_SHIFT 15
1870#define IXGBE_FDIRHASH_SIG_SW_INDEX_SHIFT 16
1871
1872#define IXGBE_FDIRCMD_CMD_MASK 0x00000003
1873#define IXGBE_FDIRCMD_CMD_ADD_FLOW 0x00000001
1874#define IXGBE_FDIRCMD_CMD_REMOVE_FLOW 0x00000002
1875#define IXGBE_FDIRCMD_CMD_QUERY_REM_FILT 0x00000003
1876#define IXGBE_FDIRCMD_CMD_QUERY_REM_HASH 0x00000007
1877#define IXGBE_FDIRCMD_FILTER_UPDATE 0x00000008
1878#define IXGBE_FDIRCMD_IPv6DMATCH 0x00000010
1879#define IXGBE_FDIRCMD_L4TYPE_UDP 0x00000020
1880#define IXGBE_FDIRCMD_L4TYPE_TCP 0x00000040
1881#define IXGBE_FDIRCMD_L4TYPE_SCTP 0x00000060
1882#define IXGBE_FDIRCMD_IPV6 0x00000080
1883#define IXGBE_FDIRCMD_CLEARHT 0x00000100
1884#define IXGBE_FDIRCMD_DROP 0x00000200
1885#define IXGBE_FDIRCMD_INT 0x00000400
1886#define IXGBE_FDIRCMD_LAST 0x00000800
1887#define IXGBE_FDIRCMD_COLLISION 0x00001000
1888#define IXGBE_FDIRCMD_QUEUE_EN 0x00008000
1889#define IXGBE_FDIRCMD_RX_QUEUE_SHIFT 16
1890#define IXGBE_FDIRCMD_VT_POOL_SHIFT 24
1891#define IXGBE_FDIR_INIT_DONE_POLL 10
1892#define IXGBE_FDIRCMD_CMD_POLL 10
1893
1787/* Transmit Descriptor - Legacy */ 1894/* Transmit Descriptor - Legacy */
1788struct ixgbe_legacy_tx_desc { 1895struct ixgbe_legacy_tx_desc {
1789 u64 buffer_addr; /* Address of the descriptor's data buffer */ 1896 u64 buffer_addr; /* Address of the descriptor's data buffer */
@@ -1957,6 +2064,45 @@ typedef u32 ixgbe_physical_layer;
1957#define IXGBE_PHYSICAL_LAYER_10GBASE_KR 0x0800 2064#define IXGBE_PHYSICAL_LAYER_10GBASE_KR 0x0800
1958#define IXGBE_PHYSICAL_LAYER_10GBASE_XAUI 0x1000 2065#define IXGBE_PHYSICAL_LAYER_10GBASE_XAUI 0x1000
1959 2066
2067/* Software ATR hash keys */
2068#define IXGBE_ATR_BUCKET_HASH_KEY 0xE214AD3D
2069#define IXGBE_ATR_SIGNATURE_HASH_KEY 0x14364D17
2070
2071/* Software ATR input stream offsets and masks */
2072#define IXGBE_ATR_VLAN_OFFSET 0
2073#define IXGBE_ATR_SRC_IPV6_OFFSET 2
2074#define IXGBE_ATR_SRC_IPV4_OFFSET 14
2075#define IXGBE_ATR_DST_IPV6_OFFSET 18
2076#define IXGBE_ATR_DST_IPV4_OFFSET 30
2077#define IXGBE_ATR_SRC_PORT_OFFSET 34
2078#define IXGBE_ATR_DST_PORT_OFFSET 36
2079#define IXGBE_ATR_FLEX_BYTE_OFFSET 38
2080#define IXGBE_ATR_VM_POOL_OFFSET 40
2081#define IXGBE_ATR_L4TYPE_OFFSET 41
2082
2083#define IXGBE_ATR_L4TYPE_MASK 0x3
2084#define IXGBE_ATR_L4TYPE_IPV6_MASK 0x4
2085#define IXGBE_ATR_L4TYPE_UDP 0x1
2086#define IXGBE_ATR_L4TYPE_TCP 0x2
2087#define IXGBE_ATR_L4TYPE_SCTP 0x3
2088#define IXGBE_ATR_HASH_MASK 0x7fff
2089
2090/* Flow Director ATR input struct. */
2091struct ixgbe_atr_input {
2092 /* Byte layout in order, all values with MSB first:
2093 *
2094 * vlan_id - 2 bytes
2095 * src_ip - 16 bytes
2096 * dst_ip - 16 bytes
2097 * src_port - 2 bytes
2098 * dst_port - 2 bytes
2099 * flex_bytes - 2 bytes
2100 * vm_pool - 1 byte
2101 * l4type - 1 byte
2102 */
2103 u8 byte_stream[42];
2104};
2105
1960enum ixgbe_eeprom_type { 2106enum ixgbe_eeprom_type {
1961 ixgbe_eeprom_uninitialized = 0, 2107 ixgbe_eeprom_uninitialized = 0,
1962 ixgbe_eeprom_spi, 2108 ixgbe_eeprom_spi,
@@ -2348,6 +2494,7 @@ struct ixgbe_info {
2348#define IXGBE_ERR_SFP_NOT_SUPPORTED -19 2494#define IXGBE_ERR_SFP_NOT_SUPPORTED -19
2349#define IXGBE_ERR_SFP_NOT_PRESENT -20 2495#define IXGBE_ERR_SFP_NOT_PRESENT -20
2350#define IXGBE_ERR_SFP_NO_INIT_SEQ_PRESENT -21 2496#define IXGBE_ERR_SFP_NO_INIT_SEQ_PRESENT -21
2497#define IXGBE_ERR_FDIR_REINIT_FAILED -23
2351#define IXGBE_NOT_IMPLEMENTED 0x7FFFFFFF 2498#define IXGBE_NOT_IMPLEMENTED 0x7FFFFFFF
2352 2499
2353#endif /* _IXGBE_TYPE_H_ */ 2500#endif /* _IXGBE_TYPE_H_ */