summaryrefslogtreecommitdiffstats
path: root/sys/dev/bge/if_bgereg.h
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2009-11-22 21:16:30 +0000
committeryongari <yongari@FreeBSD.org>2009-11-22 21:16:30 +0000
commit33b0b9f0e9af6a61858f23dd610353152d5204cd (patch)
tree72737c0c382c4cbcf61b624d35d9b23da511bcea /sys/dev/bge/if_bgereg.h
parent5f64e015852893c9efef5c33eaa00bbe2ac87b6f (diff)
downloadFreeBSD-src-33b0b9f0e9af6a61858f23dd610353152d5204cd.zip
FreeBSD-src-33b0b9f0e9af6a61858f23dd610353152d5204cd.tar.gz
Implement TSO for BCM5755 or newer controllers. Some controllers
seem to require a special firmware to use TSO. But the firmware is not available to FreeBSD and Linux claims that the TSO performed by the firmware is slower than hardware based TSO. Moreover the firmware based TSO has one known bug which can't handle TSO if ethernet header + IP/TCP header is greater than 80 bytes. The workaround for the TSO bug exist but it seems it's too expensive than not using TSO at all. Some hardwares also have the TSO bug so limit the TSO to the controllers that are not affected TSO issues (e.g. 5755 or higher). While I'm here set VLAN tag bit to all descriptors that belengs to a frame instead of the first descriptor of a frame. The datasheet is not clear how to handle VLAN tag bit but it worked either way in my testing. This makes it simplify TSO configuration a little bit. Big thanks to davidch@ who sent me detailed TSO information. Without this I was not able to implement it. Tested by: current
Diffstat (limited to 'sys/dev/bge/if_bgereg.h')
-rw-r--r--sys/dev/bge/if_bgereg.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/bge/if_bgereg.h b/sys/dev/bge/if_bgereg.h
index 2fb849f..cefe516 100644
--- a/sys/dev/bge/if_bgereg.h
+++ b/sys/dev/bge/if_bgereg.h
@@ -1402,6 +1402,8 @@
#define BGE_RDMAMODE_MBUF_SBD_CRPT_ATTN 0x00002000
#define BGE_RDMAMODE_FIFO_SIZE_128 0x00020000
#define BGE_RDMAMODE_FIFO_LONG_BURST 0x00030000
+#define BGE_RDMAMODE_TSO4_ENABLE 0x08000000
+#define BGE_RDMAMODE_TSO6_ENABLE 0x10000000
/* Read DMA status register */
#define BGE_RDMASTAT_PCI_TGT_ABRT_ATTN 0x00000004
@@ -1949,11 +1951,11 @@ struct bge_tx_bd {
uint16_t bge_flags;
uint16_t bge_len;
uint16_t bge_vlan_tag;
- uint16_t bge_rsvd;
+ uint16_t bge_mss;
#else
uint16_t bge_len;
uint16_t bge_flags;
- uint16_t bge_rsvd;
+ uint16_t bge_mss;
uint16_t bge_vlan_tag;
#endif
};
@@ -2482,7 +2484,8 @@ struct bge_gib {
#define BGE_JSLOTS 384
#define BGE_NSEG_JUMBO 4
-#define BGE_NSEG_NEW 32
+#define BGE_NSEG_NEW 32
+#define BGE_TSOSEG_SZ 4096
/* Maximum DMA address for controllers that have 40bit DMA address bug. */
#if (BUS_SPACE_MAXADDR < 0xFFFFFFFFFF)
@@ -2602,6 +2605,7 @@ struct bge_softc {
#define BGE_FLAG_MSI 0x00000100
#define BGE_FLAG_PCIX 0x00000200
#define BGE_FLAG_PCIE 0x00000400
+#define BGE_FLAG_TSO 0x00000800
#define BGE_FLAG_5700_FAMILY 0x00001000
#define BGE_FLAG_5705_PLUS 0x00002000
#define BGE_FLAG_5714_FAMILY 0x00004000
OpenPOWER on IntegriCloud