ixgbe: Support for Intel(R) 10GbE PCI Express adapters - Take #2
Subsystems (3)
cover ixgbe: Support for Intel(R) 10GbE PCI Express adapters - Take #2
This patch adds support for the Intel(R) 82598 based PCI Express 10GbE adapters.
Please find the full driver as a patch to latest linus-2.6 tree here:
git-pull git://lost.foo-projects.org/~aveerani/git/linux-2.6 ixgbe
Changes from the last submission...
1. Suspend, resume support is added
2. PCI error recovery support
3. Bit fields usage is removed and replaced with #defines.
4. typedef boolean_t is replaced with bool.
5. Ethtool functionality for eeprom and regiters dump and adapter identification.
6. RxDescriptor, TxDescriptors and XsumRx parameters are removed from the module param list. They can be handled via ethtool.
7. NAPI mode uses sigle Rx queue and so fake netdev usage is removed.
8. Non-NAPI mode is added.
9. LLTX is not used and tx_lock usage in xmit_frame is cleand up.
10. Performance and bug fixes.
thanks,
Ayyappan
PATCH 1/1 ixgbe: Driver for Intel 82598 based 10GbE PCI Express family of adapters
This patch incorporates most of the comments/feedback got on previous submission..
Also, this patch implements feature flags, Multiple Rx queues, single Rx queue in NAPI mode, supports Tx/Rx checksum offloads, TCP Segmentation offload, MSIX, pcket split in Rx side etc..
---
Documentation/networking/ixgbe.txt | 188 ++ MAINTAINERS | 15 drivers/net/Kconfig | 39 drivers/net/Makefile | 1 drivers/net/ixgbe/Makefile | 36 drivers/net/ixgbe/ixgbe.h | 216 +++ drivers/net/ixgbe/ixgbe_82598.c | 605 ++++++++ drivers/net/ixgbe/ixgbe_api.c | 637 ++++++++ drivers/net/ixgbe/ixgbe_api.h | 89 + drivers/net/ixgbe/ixgbe_common.c | 1726 ++++++++++++++++++++++ drivers/net/ixgbe/ixgbe_common.h | 73 + drivers/net/ixgbe/ixgbe_ethtool.c | 870 +++++++++++ drivers/net/ixgbe/ixgbe_main.c | 2853 ++++++++++++++++++++++++++++++++++++ drivers/net/ixgbe/ixgbe_osdep.h | 69 + drivers/net/ixgbe/ixgbe_param.c | 572 +++++++ drivers/net/ixgbe/ixgbe_phy.c | 583 +++++++ drivers/net/ixgbe/ixgbe_phy.h | 64 + drivers/net/ixgbe/ixgbe_type.h | 1390 ++++++++++++++++++ 18 files changed, 10026 insertions(+), 0 deletions(-)
Documentation/networking/ixgbe.txt new file +188 -0
@@ -0,0 +1,188 @@ +Linux* Base Driver for the 10 Gigabit Family of Adapters +================================================================ + +July 09, 2007 + + +Contents +======== + +- In This Release +- Identifying Your Adapter +- Command Line Parameters +- Support + +In This Release +=============== + +This file describes the Linux* Base Driver for the 10 Gigabit PCI Express +Family of Adapters. This driver supports the 2.6.x kernel. This driver +includes support for Itanium(R)2-based systems. + +The following features are now available in supported kernels: + - Native VLANs + - Channel Bonding (teaming) + - SNMP + +Channel Bonding documentation can be found in the Linux kernel source: +/Documentation/networking/bonding.txt + +Instructions on updating ethtool can be found in the section "Additional +Configurations" later in this document. + + +Identifying Your Adapter +======================== + +The following Intel network adapters are compatible with the drivers in this +release: + +Controller Adapter Name Physical Layer +---------- ------------ -------------- +82598 Intel(R) 10GbE-LR/LRM/SR + Server Adapters 10G Base -SR (850 nm optical fiber) + 10G Base -LRM (850 nm optical fiber) + 10G Base -LR (1310 nm optical fiber) + +For more information on how to identify your adapter, go to the Adapter & +Driver ID Guide at: + + http://support.intel.com/support/network/sb/CS-012904.htm + +For the latest Intel network drivers for Linux, refer to the following +website. In the search field, enter your adapter name or type, or use the +networking link on the left to search for your adapter: + + http://downloadfinder.intel.com/scripts-df/support_intel.asp + +Command Line Parameters +======================= + +If the driver is built as a module, the following optional parameters are +used by entering them on the command line with the modprobe command using +this syntax: + + modprobe ixgbe [<option>=<VAL1>,<VAL2>,...] + +For example, with two PRO/10GbE PCI Express adapters, entering: + + modprobe ixgbe TxDescriptors=80,128 + +loads the ixgbe driver with 80 TX resources for the first adapter and 128 TX +resources for the second adapter. + +The default value for each parameter is generally the recommended setting, +unless otherwise noted. + + +RxQueues +-------- +Valid Range: 1, 2, 4, 8 +Default Value: 8 + Number of RX queues. + + +RxFCHighThresh +-------------- +Valid Range: 1,536 - 262,136 (0x600 - 0x3FFF8, 8 byte granularity) +Default Value: 196,608 (0x30000) + Receive Flow control high threshold (when we send a pause frame) + + +RxFCLowThresh +------------- +Valid Range: 64 - 262,136 (0x40 - 0x3FFF8, 8 byte granularity) + * must be less than high threshold by at least 8 bytes +Default Value: 163,840 (0x28000) +Receive Flow control low threshold (when we send a resume frame) + + +RxBufferMode +------------ +Valid Range: 0-2 +Default Value: 2 +0 = Driver will use single buffer for Rx packets. +1 = Driver will use packet split mode for Rx. Packet header will be +received in header buffer and payload will be received in data buffer. +2. = Optimal mode. Driver will use single buffer mode for non-Jumbo +configurations and packet split mode for Jumbo configurations. + + +InterruptType +------------- +Valid Range: 0-2 0 = Legacy Int, 1 = MSI and 2 = MSIX +Default Value: 2 + Interrupt type + + +FCReqTimeout +------------ +Valid Range: 1 - 65535 +Default Value: 65535 (0xffff) (will send an xon if we recover) + Flow control request timeout (how long to pause the link partner's tx) + + +InterruptThrottleRate +--------------------- +Valid Range: 100-100000 (0=off, 1=dynamic) +Default Value: + Interrupt Throttle Rate (interrupts/sec) + + +FlowControl +----------- +Valid Range: 0-3 +0 - No Flow Control +1 - Rx only, respond to PAUSE frames but do not generate them +2 - Tx only, generate PAUSE frames but ignore them on receive +3 - Full Flow Control Support +Default Value: 1 - Rx only + User Specified Flow Control Override + + +LLIPort +------- +Valid Range: 0 - 65535 +Default Value: 0 (disabled) + + LLI is configured with the LLIPort command-line parameter, which specifies + which TCP should general Low Latency Interrupts. + + For example, using LLIPort=80 would cause the board to generate an + immediate interrupt upon receipt of any packet sent to TCP port 80 on the + local machine. + + +LLIPush +------- +Valid Range: 0-1 +Default Value: 0 (disabled) + + LLIPush can be set to be enabled or disabled (default). It is most + effective in an environment with many small transactions. + NOTE: Enabling LLIPush may allow a denial of service attack. + + +LLISize +------- +Valid Range: 0-1500 +Default Value: 0 (disabled) + + LLISize causes an immediate interrupt if the board receives a packet smaller + than the specified size. + + +Support +======= + +For general information, go to the Intel support website at: + + http://support.intel.com + +or the Intel Wired Networking project hosted by Sourceforge at: + + http://sourceforge.net/projects/e1000 + +If an issue is identified with the released source code on the supported +kernel with a supported adapter, email the specific information related +to the issue to [email protected]
MAINTAINERS +15 -0
@@ -1955,6 +1955,21 @@ L: [email protected] W: http://sourceforge.net/projects/e1000/ S: Supported +INTEL PRO/10GbE PCI Express SUPPORT +P: Jeff Kirsher +M: [email protected] +P: Ayyappan Veeraiyan +M: [email protected] +P: John Ronciak +M: [email protected] +P: Jesse Brandeburg +M: [email protected] +P: Auke Kok +M: [email protected] +L: [email protected] +W: http://sourceforge.net/projects/e1000/ +S: Supported + INTEL PRO/WIRELESS 2100 NETWORK CONNECTION SUPPORT P: Yi Zhu M: [email protected]
drivers/net/Kconfig +39 -0
@@ -2449,6 +2449,45 @@ config IXGB_NAPI If in doubt, say N. +config IXGBE + tristate "Intel(R) PRO/10GbE PCI Express adapters support" + depends on PCI + ---help--- + This driver supports Intel(R) PRO/10GbE PCI Express family of + adapters. For more information on how to identify your adapter, go + to the Adapter & Driver ID Guide at: + + <http://support.intel.com/support/network/adapter/pro100/21397.htm> + + For general information and support, go to the Intel support + website at: + + <http://support.intel.com> + + More specific information on configuring the driver is in + <file:Documentation/networking/ixgbe.txt>. + + To compile this driver as a module, choose M here and read + <file:Documentation/networking/net-modules.txt>. The module + will be called ixgbe. + +config IXGBE_NAPI + bool "Use Rx Polling (NAPI) (EXPERIMENTAL)" + depends on IXGBE && EXPERIMENTAL + help + NAPI is a new driver API designed to reduce CPU and interrupt load + when the driver is receiving lots of packets from the card. It is + still somewhat experimental and thus not yet enabled by default. + + If your estimated Rx load is 10kpps or more, or if the card will be + deployed on potentially unfriendly networks (e.g. in a firewall), + then say Y here. + + See <file:Documentation/networking/NAPI_HOWTO.txt> for more + information. + + If in doubt, say N. + config S2IO tristate "S2IO 10Gbe XFrame NIC" depends on PCI
drivers/net/Makefile +1 -0
@@ -5,6 +5,7 @@ obj-$(CONFIG_E1000) += e1000/ obj-$(CONFIG_IBM_EMAC) += ibm_emac/ obj-$(CONFIG_IXGB) += ixgb/ +obj-$(CONFIG_IXGBE) += ixgbe/ obj-$(CONFIG_CHELSIO_T1) += chelsio/ obj-$(CONFIG_CHELSIO_T3) += cxgb3/ obj-$(CONFIG_EHEA) += ehea/
drivers/net/ixgbe/Makefile new file +36 -0
@@ -0,0 +1,36 @@ +################################################################################ +# +# Intel PRO/10GbE PCI Express Linux driver +# Copyright(c) 1999 - 2007 Intel Corporation. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms and conditions of the GNU General Public License, +# version 2, as published by the Free Software Foundation. +# +# This program is distributed in the hope it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# +# The full GNU General Public License is included in this distribution in +# the file called "COPYING". +# +# Contact Information: +# Linux NICS <[email protected]> +# e1000-devel Mailing List <[email protected]> +# Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 +# +################################################################################ + +# +# Makefile for the Intel(R) PRO/10GbE PCI Express ethernet driver +# + +obj-$(CONFIG_IXGBE) += ixgbe.o + +ixgbe-objs := ixgbe_main.o ixgbe_common.o ixgbe_api.o ixgbe_ethtool.o \ + ixgbe_param.o ixgbe_82598.o ixgbe_phy.o
drivers/net/ixgbe/ixgbe.h new file +216 -0
216 lines not on this page · raw message
drivers/net/ixgbe/ixgbe_82598.c new file +605 -0
605 lines not on this page · raw message
drivers/net/ixgbe/ixgbe_api.c new file +637 -0
637 lines not on this page · raw message
drivers/net/ixgbe/ixgbe_api.h new file +89 -0
89 lines not on this page · raw message
drivers/net/ixgbe/ixgbe_common.c new file +1726 -0
1,156 lines not on this page · raw message
drivers/net/ixgbe/ixgbe_common.h new file +73 -0
73 lines not on this page · raw message
drivers/net/ixgbe/ixgbe_ethtool.c new file +870 -0
870 lines not on this page · raw message
drivers/net/ixgbe/ixgbe_main.c new file +2853 -0
2,853 lines not on this page · raw message
drivers/net/ixgbe/ixgbe_osdep.h new file +69 -0
69 lines not on this page · raw message
drivers/net/ixgbe/ixgbe_param.c new file +572 -0
572 lines not on this page · raw message
drivers/net/ixgbe/ixgbe_phy.c new file +583 -0
583 lines not on this page · raw message
drivers/net/ixgbe/ixgbe_phy.h new file +64 -0
64 lines not on this page · raw message
drivers/net/ixgbe/ixgbe_type.h new file +1390 -0
1,390 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Quoted 2 lines · [email protected] wrote:
7. NAPI mode uses sigle Rx queue and so fake netdev usage is removed.
8. Non-NAPI mode is added.
Honestly I'm not sure about drivers that have both NAPI and non-NAPI paths.
Several existing drivers do this, and in almost every case, I tend to feel the driver would benefit from picking one approach, rather than doing both.
Doing both tends to signal that the author hasn't bothered to measure the differences between various approaches, and pick a clear winner.
I strongly prefer NAPI combined with hardware interrupt mitigation -- it helps with multiple net interfaces balance load across the system, at times of high load -- but I'm open to other solutions as well.
So... what are your preferences? What is the setup that gets closest to wire speed under Linux? :)
Jeff
Quoted 5 lines · Jeff Garzik
[email protected] wrote:
Doing both tends to signal that the author hasn't bothered to measure the differences between various approaches, and pick a clear winner.
I did pick NAPI in our previous submission based on various tests. But to get 10Gig line rate we need to use multiple Rx queues which will need fake netdevs.. Since fake netdevs weren't acceptable, I added non-NAPI support which gets 10Gig line rate with multi-rx. I am ok with removing NAPI support till the work of separating the netdevs and NAPI work is done..
Quoted 1 line
I strongly prefer NAPI combined with hardware interrupt mitigation --
it
Quoted 3 lines
helps with multiple net interfaces balance load across the system, at times of high load -- but I'm open to other solutions as well.
Majority of tests we did here, we saw NAPI is better. But for some specific test cases (especially if we add the SW RSC i.e. LRO), we saw better throughput and CPU utilization with non-NAPI.
Quoted 2 lines
So... what are your preferences? What is the setup that gets closest to wire speed under Linux? :)
With SW LRO, non-NAPI is better but without LRO, NAPI is better but NAPI needs multiple Rx queues. So given the limitations, non-NPAI is my preference now.
I will post the performance numbers later today..
Quoted 2 lines
Jeff
Thanks..
Ayyappan
Quoted 7 lines · Ayyappan
Quoted 5 lines · Jeff Garzik
[email protected] wrote:
Doing both tends to signal that the author hasn't bothered to measure the differences between various approaches, and pick a clear winner.
Quoted 6 lines
I did pick NAPI in our previous submission based on various tests. But to get 10Gig line rate we need to use multiple Rx queues which will need fake netdevs.. Since fake netdevs weren't acceptable, I added non-NAPI support which gets 10Gig line rate with multi-rx. I am ok with removing NAPI support till the work of separating the netdevs and NAPI work is done..
That sounds fine to me. Separating netdev and NAPI is the right way to go. Maybe note that in a TODO list at the top of the driver.
Quoted 3 lines
With SW LRO, non-NAPI is better but without LRO, NAPI is better but NAPI needs multiple Rx queues. So given the limitations, non-NPAI is my preference now.
On the subject of SW LRO: We are really looking for a generic implementation, hopefully authored by one or more interested parties. This is something we definitely do not want to reinvent over and over in new drivers -- and in the one or two drivers it exists today, should be removed once the generic code is in place.
If Intel could assist with that effort, that would be very helpful.
Quoted 1 line
I will post the performance numbers later today..
Thanks,
Jeff
Quoted 4 lines · [email protected] wrote:
This patch adds support for the Intel(R) 82598 based PCI Express 10GbE adapters.
Please find the full driver as a patch to latest linus-2.6 tree here:
git-pullgit://lost.foo-projects.org/~aveerani/git/linux-2.6ixgbe
Andrew, I rebased this with the new driver code, so you might need to drop the old version.
Cheers,
Auke
On 7/10/07, Jeff Garzik <[email protected]> wrote:
Veeraiyan, Ayyappan wrote:
> On 7/10/07, Jeff Garzik <[email protected]> wrote:
>> [email protected] wrote:
>>
> I will post the performance numbers later today..
Sorry for not responding earlier. We faced couple of issues like setup, and false alarms..
Anyway here are the numbers..
Recv Send Send Utilization Service
Demand
SocketSocketMessageElapsed Send Recv Send Recv
Size Size Size Time Throughput local remotelocal remote
Bytes Bytes Bytes sec 10^6bits/s % s % s us/KB us/KB
87380 65536 128 60 2261.34 13.82 4.25 4.006 1.233
128
87380 65536 256 60 3332.51 14.19 5.67 2.79 1.115
256
87380 65536 512 60.01 4262.24 14.38 6.9 2.21 1.062
512
87380 65536 1024 60 4659.18 14.4 7.39 2.026 1.039
1024
87380 65536 2048 60.01 6177.87 14.36 14.99 1.524 1.59
2048
87380 65536 4096 60.01 9410.29 11.58 14.6 0.807 1.017
4096
87380 65536 8192 60.01 9324.62 11.13 14.33 0.782 1.007
8192
87380 65536 16384 60.01 9371.35 11.07 14.28 0.774 0.999
16384
87380 65536 32768 60.02 9385.81 10.83 14.27 0.756 0.997
32768
87380 65536 65536 60.01 9363.5 10.73 14.26 0.751 0.998
65536
TCP SENDFILE TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to n0417 (10.0.4.17) port 0 AF_INET : cpu bind
Recv Send Send Utilization Service Demand Socket Socket Message Elapsed Send Recv Send Recv Size Size Size Time Throughput local remote local remote bytes bytes bytes secs. 10^6bits/s % S % S us/KB us/KB
87380 65536 65536 60.02 9399.61 2.22 14.53 0.155
1.013
87380 65536 65536 60.02 9348.01 2.46 14.39 0.173
1.009
87380 65536 65536 60.02 9403.36 2.26 14.37 0.158
1.001
87380 65536 65536 60.01 9332.22 2.23 14.51 0.157
1.019
Bidirectional test.
87380 65536 65536 60.01 7809.57 28.66 30.02 2.405 2.519
TX
87380 65536 65536 60.01 7592.90 28.66 30.02 2.474 2.591
RX
------------------------------
87380 65536 65536 60.01 7629.73 28.32 29.64 2.433 2.546
RX
87380 65536 65536 60.01 7926.99 28.32 29.64 2.342 2.450
TX
Signle netperf stream between 2 quad-core Xeon based boxes. Tested on 2.6.20 and 2.6.22 kernels. Driver uses NAPI and LRO.
To summarize, we are seeing the line-rate with NAPI (single Rx queue) and Rx CPU utilization is around 14%. In back to back scenarios, NAPI (combined with LRO) performs clearly better. In multiple client scenarios, Non-NAPI with multiple Rx queues performs better. I am continuously doing more benchmarking and submit a patch to pick one this week.
But going forward if NAPI supports multiple Rx queues natively, I believe that would perform much better in most of the cases.
Also, did you get a chance to review the driver take #2? I like to implement the review comments (if any) as early as possible, and submit another version.
Thanks...
Ayyappan
-
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 13 lines
Bidirectional test.
87380 65536 65536 60.01 7809.57 28.66 30.02 2.405 2.519
TX
87380 65536 65536 60.01 7592.90 28.66 30.02 2.474 2.591
RX
------------------------------
87380 65536 65536 60.01 7629.73 28.32 29.64 2.433 2.546
RX
87380 65536 65536 60.01 7926.99 28.32 29.64 2.342 2.450
TX
Quoted 2 lines
Signle netperf stream between 2 quad-core Xeon based boxes. Tested on 2.6.20 and 2.6.22 kernels. Driver uses NAPI and LRO.
The bidirectional looks like a two concurrent stream (TCP_STREAM + TCP_MAERTS) test right?
If you want a single-stream bidirectional test, then with the top of trunk netperf you can use:
./configure --enable-burst
make install # yadda yadda
netperf -t TCP_RR -H <remote> -f m -v 2 -l 60 -c -C -- -r 64K -b 12
which will cause netperf to have 13, 64K transactions in flight at one time on the connection, which for a 64K request size has been sufficient, thusfar anyway, to saturate things. As there is no select/poll/whatever call in netperf TCP_RR it might be necessary to include test-specific -s and -S options to make sure the socket buffer (SO_SNDBUF) is large enough that none of those send() calls ever block, lest both ends end-up blocked in a send() call.
The -f m will switch the output from transactions/s to megabits per second and is the part requiring the top of trunk netperf. The -v 2 stuff causes extra stuff to give bitrates in each direction and transaction/s rate as well as computed average latency. That is also in top of trunk, otherwise, for 2.4.3 you can skip that and do the math to conver to megabits/s yourself and not get all the other derived values.
rick jones
Quoted 6 lines · Rick Jones
The bidirectional looks like a two concurrent stream (
TCP_STREAM+TCP_MAERTS)
test right?If you want a single-stream bidirectional test, then with the top of
trunk
Quoted 2 lines
netperf you can use:
Thanks for the feedback Rick. We haven't used the netperf trunk. The person who actually got these numbers will be trying the netperf trunk little later and we will post the results..
Quoted 3 lines
Thanks for the feedback Rick. We haven't used the netperf trunk. The person who actually got these numbers will be trying the netperf trunk little later and we will post the results..
Just in case someone has top-of-trunk worries, the basic single-stream, bidirectional stuff is in the 2.4.3 released bits. It is the "user friendly" netperf-does-the-math bit that is top of trunk :)
rick