···11-S2IO Technologies XFrame 10 Gig adapter.22--------------------------------------------11+Release notes for Neterion's (Formerly S2io) Xframe I/II PCI-X 10GbE driver.3244-I. Module loadable parameters.55-When loaded as a module, the driver provides a host of Module loadable66-parameters, so the device can be tuned as per the users needs.77-A list of the Module params is given below.88-(i) ring_num: This can be used to program the number of99- receive rings used in the driver.1010-(ii) ring_len: This defines the number of descriptors each ring1111- can have. There can be a maximum of 8 rings.1212-(iii) frame_len: This is an array of size 8. Using this we can 1313- set the maximum size of the received frame that can1414- be steered into the corrsponding receive ring. 1515-(iv) fifo_num: This defines the number of Tx FIFOs thats used in1616- the driver. 1717-(v) fifo_len: Each element defines the number of 1818- Tx descriptors that can be associated with each 1919- corresponding FIFO. There are a maximum of 8 FIFOs.2020-(vi) tx_prio: This is a bool, if module is loaded with a non-zero2121- value for tx_prio multi FIFO scheme is activated.2222-(vii) rx_prio: This is a bool, if module is loaded with a non-zero2323- value for tx_prio multi RING scheme is activated.2424-(viii) latency_timer: The value given against this param will be2525- loaded into the latency timer register in PCI Config2626- space, else the register is left with its reset value.33+Contents44+=======55+- 1. Introduction66+- 2. Identifying the adapter/interface77+- 3. Features supported88+- 4. Command line parameters99+- 5. Performance suggestions1010+- 6. Available Downloads 27112828-II. Performance tuning.2929- By changing a few sysctl parameters.3030- Copy the following lines into a file and run the following command,3131- "sysctl -p <file_name>"3232-### IPV4 specific settings3333-net.ipv4.tcp_timestamps = 0 # turns TCP timestamp support off, default 1, reduces CPU use3434-net.ipv4.tcp_sack = 0 # turn SACK support off, default on3535-# on systems with a VERY fast bus -> memory interface this is the big gainer3636-net.ipv4.tcp_rmem = 10000000 10000000 10000000 # sets min/default/max TCP read buffer, default 4096 87380 1747603737-net.ipv4.tcp_wmem = 10000000 10000000 10000000 # sets min/pressure/max TCP write buffer, default 4096 16384 1310723838-net.ipv4.tcp_mem = 10000000 10000000 10000000 # sets min/pressure/max TCP buffer space, default 31744 32256 327683939-4040-### CORE settings (mostly for socket and UDP effect)4141-net.core.rmem_max = 524287 # maximum receive socket buffer size, default 1310714242-net.core.wmem_max = 524287 # maximum send socket buffer size, default 1310714343-net.core.rmem_default = 524287 # default receive socket buffer size, default 655354444-net.core.wmem_default = 524287 # default send socket buffer size, default 655354545-net.core.optmem_max = 524287 # maximum amount of option memory buffers, default 102404646-net.core.netdev_max_backlog = 300000 # number of unprocessed input packets before kernel starts dropping them, default 3004747----End of performance tuning file---1212+1313+1. Introduction:1414+This Linux driver supports Neterion's Xframe I PCI-X 1.0 and1515+Xframe II PCI-X 2.0 adapters. It supports several features 1616+such as jumbo frames, MSI/MSI-X, checksum offloads, TSO, UFO and so on.1717+See below for complete list of features.1818+All features are supported for both IPv4 and IPv6.1919+2020+2. Identifying the adapter/interface:2121+a. Insert the adapter(s) in your system.2222+b. Build and load driver 2323+# insmod s2io.ko2424+c. View log messages2525+# dmesg | tail -402626+You will see messages similar to:2727+eth3: Neterion Xframe I 10GbE adapter (rev 3), Version 2.0.9.1, Intr type INTA2828+eth4: Neterion Xframe II 10GbE adapter (rev 2), Version 2.0.9.1, Intr type INTA2929+eth4: Device is on 64 bit 133MHz PCIX(M1) bus3030+3131+The above messages identify the adapter type(Xframe I/II), adapter revision,3232+driver version, interface name(eth3, eth4), Interrupt type(INTA, MSI, MSI-X).3333+In case of Xframe II, the PCI/PCI-X bus width and frequency are displayed3434+as well.3535+3636+To associate an interface with a physical adapter use "ethtool -p <ethX>".3737+The corresponding adapter's LED will blink multiple times.3838+3939+3. Features supported:4040+a. Jumbo frames. Xframe I/II supports MTU upto 9600 bytes,4141+modifiable using ifconfig command.4242+4343+b. Offloads. Supports checksum offload(TCP/UDP/IP) on transmit4444+and receive, TSO.4545+4646+c. Multi-buffer receive mode. Scattering of packet across multiple4747+buffers. Currently driver supports 2-buffer mode which yields4848+significant performance improvement on certain platforms(SGI Altix,4949+IBM xSeries).5050+5151+d. MSI/MSI-X. Can be enabled on platforms which support this feature5252+(IA64, Xeon) resulting in noticeable performance improvement(upto 7%5353+on certain platforms).5454+5555+e. NAPI. Compile-time option(CONFIG_S2IO_NAPI) for better Rx interrupt 5656+moderation.5757+5858+f. Statistics. Comprehensive MAC-level and software statistics displayed5959+using "ethtool -S" option.6060+6161+g. Multi-FIFO/Ring. Supports up to 8 transmit queues and receive rings, 6262+with multiple steering options.6363+6464+4. Command line parameters6565+a. tx_fifo_num6666+Number of transmit queues6767+Valid range: 1-86868+Default: 16969+7070+b. rx_ring_num7171+Number of receive rings7272+Valid range: 1-87373+Default: 17474+7575+c. tx_fifo_len7676+Size of each transmit queue7777+Valid range: Total length of all queues should not exceed 81927878+Default: 40967979+8080+d. rx_ring_sz 8181+Size of each receive ring(in 4K blocks)8282+Valid range: Limited by memory on system8383+Default: 30 8484+8585+e. intr_type8686+Specifies interrupt type. Possible values 1(INTA), 2(MSI), 3(MSI-X)8787+Valid range: 1-38888+Default: 1 8989+9090+5. Performance suggestions9191+General:9292+a. Set MTU to maximum(9000 for switch setup, 9600 in back-to-back configuration)9393+b. Set TCP windows size to optimal value. 9494+For instance, for MTU=1500 a value of 210K has been observed to result in 9595+good performance.9696+# sysctl -w net.ipv4.tcp_rmem="210000 210000 210000"9797+# sysctl -w net.ipv4.tcp_wmem="210000 210000 210000"9898+For MTU=9000, TCP window size of 10 MB is recommended.9999+# sysctl -w net.ipv4.tcp_rmem="10000000 10000000 10000000"100100+# sysctl -w net.ipv4.tcp_wmem="10000000 10000000 10000000"101101+102102+Transmit performance:103103+a. By default, the driver respects BIOS settings for PCI bus parameters. 104104+However, you may want to experiment with PCI bus parameters 105105+max-split-transactions(MOST) and MMRBC (use setpci command). 106106+A MOST value of 2 has been found optimal for Opterons and 3 for Itanium. 107107+It could be different for your hardware. 108108+Set MMRBC to 4K**.109109+110110+For example you can set 111111+For opteron112112+#setpci -d 17d5:* 62=1d 113113+For Itanium114114+#setpci -d 17d5:* 62=3d 115115+116116+For detailed description of the PCI registers, please see Xframe User Guide.117117+118118+b. Ensure Transmit Checksum offload is enabled. Use ethtool to set/verify this 119119+parameter.120120+c. Turn on TSO(using "ethtool -K")121121+# ethtool -K <ethX> tso on122122+123123+Receive performance:124124+a. By default, the driver respects BIOS settings for PCI bus parameters. 125125+However, you may want to set PCI latency timer to 248.126126+#setpci -d 17d5:* LATENCY_TIMER=f8127127+For detailed description of the PCI registers, please see Xframe User Guide.128128+b. Use 2-buffer mode. This results in large performance boost on129129+on certain platforms(eg. SGI Altix, IBM xSeries).130130+c. Ensure Receive Checksum offload is enabled. Use "ethtool -K ethX" command to 131131+set/verify this option.132132+d. Enable NAPI feature(in kernel configuration Device Drivers ---> Network 133133+device support ---> Ethernet (10000 Mbit) ---> S2IO 10Gbe Xframe NIC) to 134134+bring down CPU utilization.135135+136136+** For AMD opteron platforms with 8131 chipset, MMRBC=1 and MOST=1 are 137137+recommended as safe parameters.138138+For more information, please review the AMD8131 errata at139139+http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/26310.pdf140140+141141+6. Available Downloads142142+Neterion "s2io" driver in Red Hat and Suse 2.6-based distributions is kept up 143143+to date, also the latest "s2io" code (including support for 2.4 kernels) is 144144+available via "Support" link on the Neterion site: http://www.neterion.com.145145+146146+For Xframe User Guide (Programming manual), visit ftp site ns1.s2io.com,147147+user: linuxdocs password: HALdocs148148+149149+7. Support 150150+For further support please contact either your 10GbE Xframe NIC vendor (IBM, 151151+HP, SGI etc.) or click on the "Support" link on the Neterion site: 152152+http://www.neterion.com.48153
···1203120312041204config IBM_EMAC_PHY_RX_CLK_FIX12051205 bool "PHY Rx clock workaround"12061206- depends on IBM_EMAC && (405EP || 440GX || 440EP)12061206+ depends on IBM_EMAC && (405EP || 440GX || 440EP || 440GR)12071207 help12081208 Enable this if EMAC attached to a PHY which doesn't generate12091209 RX clock if there is no link, if this is the case, you will ···22572257 information.2258225822592259 If in doubt, say N.22602260-22612261-config 2BUFF_MODE22622262- bool "Use 2 Buffer Mode on Rx side."22632263- depends on S2IO22642264- ---help---22652265- On enabling the 2 buffer mode, the received frame will be22662266- split into 2 parts before being DMA'ed to the hosts memory.22672267- The parts are the ethernet header and ethernet payload. 22682268- This is useful on systems where DMA'ing to to unaligned 22692269- physical memory loactions comes with a heavy price.22702270- If not sure please say N.2271226022722261endmenu22732262
···130130131131 skb = fep->rx_skbuff[curidx];132132133133- dma_unmap_single(fep->dev, skb->data,133133+ dma_unmap_single(fep->dev, CBDR_BUFADDR(bdp),134134 L1_CACHE_ALIGN(PKT_MAXBUF_SIZE),135135 DMA_FROM_DEVICE);136136···144144145145 skb = fep->rx_skbuff[curidx];146146147147- dma_unmap_single(fep->dev, skb->data,147147+ dma_unmap_single(fep->dev, CBDR_BUFADDR(bdp),148148 L1_CACHE_ALIGN(PKT_MAXBUF_SIZE),149149 DMA_FROM_DEVICE);150150···268268269269 skb = fep->rx_skbuff[curidx];270270271271- dma_unmap_single(fep->dev, skb->data,271271+ dma_unmap_single(fep->dev, CBDR_BUFADDR(bdp),272272 L1_CACHE_ALIGN(PKT_MAXBUF_SIZE),273273 DMA_FROM_DEVICE);274274···278278279279 skb = fep->rx_skbuff[curidx];280280281281- dma_unmap_single(fep->dev, skb->data,281281+ dma_unmap_single(fep->dev, CBDR_BUFADDR(bdp),282282 L1_CACHE_ALIGN(PKT_MAXBUF_SIZE),283283 DMA_FROM_DEVICE);284284···399399 fep->stats.collisions++;400400401401 /* unmap */402402- dma_unmap_single(fep->dev, skb->data, skb->len, DMA_TO_DEVICE);402402+ dma_unmap_single(fep->dev, CBDR_BUFADDR(bdp),403403+ skb->len, DMA_TO_DEVICE);403404404405 /*405406 * Free the sk buffer associated with this last transmit. ···548547{549548 struct fs_enet_private *fep = netdev_priv(dev);550549 struct sk_buff *skb;550550+ cbd_t *bdp;551551 int i;552552553553 /*554554 * Reset SKB transmit buffers. 555555 */556556- for (i = 0; i < fep->tx_ring; i++) {556556+ for (i = 0, bdp = fep->tx_bd_base; i < fep->tx_ring; i++, bdp++) {557557 if ((skb = fep->tx_skbuff[i]) == NULL)558558 continue;559559560560 /* unmap */561561- dma_unmap_single(fep->dev, skb->data, skb->len, DMA_TO_DEVICE);561561+ dma_unmap_single(fep->dev, CBDR_BUFADDR(bdp),562562+ skb->len, DMA_TO_DEVICE);562563563564 fep->tx_skbuff[i] = NULL;564565 dev_kfree_skb(skb);···569566 /*570567 * Reset SKB receive buffers 571568 */572572- for (i = 0; i < fep->rx_ring; i++) {569569+ for (i = 0, bdp = fep->rx_bd_base; i < fep->rx_ring; i++, bdp++) {573570 if ((skb = fep->rx_skbuff[i]) == NULL)574571 continue;575572576573 /* unmap */577577- dma_unmap_single(fep->dev, skb->data,574574+ dma_unmap_single(fep->dev, CBDR_BUFADDR(bdp),578575 L1_CACHE_ALIGN(PKT_MAXBUF_SIZE),579576 DMA_FROM_DEVICE);580577
+21-1
drivers/net/ibm_emac/ibm_emac.h
···2626/* This is a simple check to prevent use of this driver on non-tested SoCs */2727#if !defined(CONFIG_405GP) && !defined(CONFIG_405GPR) && !defined(CONFIG_405EP) && \2828 !defined(CONFIG_440GP) && !defined(CONFIG_440GX) && !defined(CONFIG_440SP) && \2929- !defined(CONFIG_440EP) && !defined(CONFIG_NP405H)2929+ !defined(CONFIG_440EP) && !defined(CONFIG_NP405H) && !defined(CONFIG_440SPE) && \3030+ !defined(CONFIG_440GR)3031#error "Unknown SoC. Please, check chip user manual and make sure EMAC defines are OK"3132#endif3233···246245#define EMAC_STACR_PCDA_MASK 0x1f247246#define EMAC_STACR_PCDA_SHIFT 5248247#define EMAC_STACR_PRA_MASK 0x1f248248+249249+/*250250+ * For the 440SPe, AMCC inexplicably changed the polarity of251251+ * the "operation complete" bit in the MII control register.252252+ */253253+#if defined(CONFIG_440SPE)254254+static inline int emac_phy_done(u32 stacr)255255+{256256+ return !(stacr & EMAC_STACR_OC);257257+};258258+#define EMAC_STACR_START EMAC_STACR_OC259259+260260+#else /* CONFIG_440SPE */261261+static inline int emac_phy_done(u32 stacr)262262+{263263+ return stacr & EMAC_STACR_OC;264264+};265265+#define EMAC_STACR_START 0266266+#endif /* !CONFIG_440SPE */249267250268/* EMACx_TRTR */251269#if !defined(CONFIG_IBM_EMAC4)
+11-9
drivers/net/ibm_emac/ibm_emac_core.c
···8787 */8888static u32 busy_phy_map;89899090-#if defined(CONFIG_IBM_EMAC_PHY_RX_CLK_FIX) && (defined(CONFIG_405EP) || defined(CONFIG_440EP))9090+#if defined(CONFIG_IBM_EMAC_PHY_RX_CLK_FIX) && \9191+ (defined(CONFIG_405EP) || defined(CONFIG_440EP) || defined(CONFIG_440GR))9192/* 405EP has "EMAC to PHY Control Register" (CPC0_EPCTL) which can help us9293 * with PHY RX clock problem.9393- * 440EP has more sane SDR0_MFR register implementation than 440GX, which9494+ * 440EP/440GR has more sane SDR0_MFR register implementation than 440GX, which9495 * also allows controlling each EMAC clock9596 */9697static inline void EMAC_RX_CLK_TX(int idx)···101100102101#if defined(CONFIG_405EP)103102 mtdcr(0xf3, mfdcr(0xf3) | (1 << idx));104104-#else /* CONFIG_440EP */103103+#else /* CONFIG_440EP || CONFIG_440GR */105104 SDR_WRITE(DCRN_SDR_MFR, SDR_READ(DCRN_SDR_MFR) | (0x08000000 >> idx));106105#endif107106···547546548547 /* Wait for management interface to become idle */549548 n = 10;550550- while (!(in_be32(&p->stacr) & EMAC_STACR_OC)) {549549+ while (!emac_phy_done(in_be32(&p->stacr))) {551550 udelay(1);552551 if (!--n)553552 goto to;···557556 out_be32(&p->stacr,558557 EMAC_STACR_BASE(emac_opb_mhz()) | EMAC_STACR_STAC_READ |559558 (reg & EMAC_STACR_PRA_MASK)560560- | ((id & EMAC_STACR_PCDA_MASK) << EMAC_STACR_PCDA_SHIFT));559559+ | ((id & EMAC_STACR_PCDA_MASK) << EMAC_STACR_PCDA_SHIFT)560560+ | EMAC_STACR_START);561561562562 /* Wait for read to complete */563563 n = 100;564564- while (!((r = in_be32(&p->stacr)) & EMAC_STACR_OC)) {564564+ while (!emac_phy_done(r = in_be32(&p->stacr))) {565565 udelay(1);566566 if (!--n)567567 goto to;···596594597595 /* Wait for management interface to be idle */598596 n = 10;599599- while (!(in_be32(&p->stacr) & EMAC_STACR_OC)) {597597+ while (!emac_phy_done(in_be32(&p->stacr))) {600598 udelay(1);601599 if (!--n)602600 goto to;···607605 EMAC_STACR_BASE(emac_opb_mhz()) | EMAC_STACR_STAC_WRITE |608606 (reg & EMAC_STACR_PRA_MASK) |609607 ((id & EMAC_STACR_PCDA_MASK) << EMAC_STACR_PCDA_SHIFT) |610610- (val << EMAC_STACR_PHYD_SHIFT));608608+ (val << EMAC_STACR_PHYD_SHIFT) | EMAC_STACR_START);611609612610 /* Wait for write to complete */613611 n = 100;614614- while (!(in_be32(&p->stacr) & EMAC_STACR_OC)) {612612+ while (!emac_phy_done(in_be32(&p->stacr))) {615613 udelay(1);616614 if (!--n)617615 goto to;
+3-2
drivers/net/ibm_emac/ibm_emac_mal.h
···3232 * reflect the fact that 40x and 44x have slightly different MALs. --ebs3333 */3434#if defined(CONFIG_405GP) || defined(CONFIG_405GPR) || defined(CONFIG_405EP) || \3535- defined(CONFIG_440EP) || defined(CONFIG_NP405H)3535+ defined(CONFIG_440EP) || defined(CONFIG_440GR) || defined(CONFIG_NP405H)3636#define MAL_VERSION 13737-#elif defined(CONFIG_440GP) || defined(CONFIG_440GX) || defined(CONFIG_440SP)3737+#elif defined(CONFIG_440GP) || defined(CONFIG_440GX) || defined(CONFIG_440SP) || \3838+ defined(CONFIG_440SPE)3839#define MAL_VERSION 23940#else4041#error "Unknown SoC, please check chip manual and choose MAL 'version'"
···7272 /* list of all PHYs on bus */7373 struct phy_device *phy_map[PHY_MAX_ADDR];74747575+ /* Phy addresses to be ignored when probing */7676+ u32 phy_mask;7777+7578 /* Pointer to an array of interrupts, each PHY's7679 * interrupt at the index matching its address */7780 int *irq;