History log of /freebsd-9.3-release/sys/dev/cxgbe/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
267926 26-Jun-2014 np

Merge r267757, which was MFC'd to stable/9 as r267882:

cxgbe(4): Update the bundled T4 and T5 firmwares to versions 1.11.27.0.

Approved by: re (glebius)
Obtained from: Chelsio

267698 21-Jun-2014 np

Merge r267600, which was MFC'd to stable/9 as r267695.

cxgbe(4): Fix bug in the fast rx buffer recycle path. In some cases rx
buffers were getting recycled when they should have been left alone.

Approved by: re (gjb)

267654 20-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


267247 09-Jun-2014 np

MFC r267082:

cxgbe(4): Properly account for the freelist buffers used when returning
early from service_iq due to a budget restriction. This fixes a potential
rx hang when using INTx.

Approved by: re@ (gjb)


266973 02-Jun-2014 np

MFC r266908:

cxgbe(4): Fix a NULL dereference when the very first call to
get_scatter_segment() in get_fl_payload() fails. While here,
fix the code to adjust fl_bufs_used when a failure occurs for
any other scatter segment.

Approved by: re (glebius)


265582 07-May-2014 np

MFC r259527, r260210 (by adrian@), r261533, r261536, r261537, r261558 (by
scottl@), r263317, r263412, r263457, and r264621 (by emax@).

r259527:
Do not create a hardware IPv6 server if the listen address is not
in6addr_any and is not in the CLIP table either. This fixes a reported
TOE+IPv6 NULL-dereference panic in do_pass_open_rpl().

While here, stop creating hardware servers for any loopback address.
It's just a waste of server tids.

r260210:
Add an option to enable or disable the small RX packet copying that
is done to improve performance of small frames.

When doing RX packing, the RX copying isn't necessarily required.

r261533:
cxgbe(4): Use the port's tx channel to identify it to t4_clr_port_stats.

r261536:
cxgbe(4): The T5 allows for a different freelist starvation threshold
for queues with buffer packing. Use the correct value to calculate a
freelist's low water mark.

r261537:
cxgbe(4): Use the rx channel map (instead of the tx channel map) as the
congestion channel map.

r261558:
Add a new sysctl, dev.cxgbe.N.rsrv_noflow, and a companion tunable,
hw.cxgbe.rsrv_noflow. When set, queue 0 of the port is reserved for
TX packets without a flowid. The hash value of packets with a flowid
is bumped up by 1. The intent is to provide a private queue for
link-level packets like LACP that is unlikely to overflow or suffer
deep queue latency.

r263317:
cxgbe(4): significant rx rework.

- More flexible cluster size selection, including the ability to fall
back to a safe cluster size (PAGE_SIZE from zone_jumbop by default) in
case an allocation of a larger size fails.
- A single get_fl_payload() function that assembles the payload into an
mbuf chain for any kind of freelist. This replaces two variants: one
for freelists with buffer packing enabled and another for those without.
- Buffer packing with any sized cluster. It was limited to 4K clusters
only before this change.
- Enable buffer packing for TOE rx queues as well.
- Statistics and tunables to go with all these changes. The driver's
man page will be updated separately.

r263412:
cxgbe(4): if_iqdrops statistic should include tunnel congestion drops.

r263457:
cxgbe(4): Recognize the "spider" configuration where a T5 card's 40G
QSFP port is presented as 4 distinct 10G SFP+ ports to the driver.

r264621:
use correct (integer) type for the temperature sysctl


265553 07-May-2014 np

MFC r259103 and r259382.

r259103:
cxgbe(4): save a copy of the RSS map for each port for the driver's use.

r259382:
Read card capabilities after firmware initialization, instead of setting
them up as part of firmware initialization (which the driver gets to do
only if it's the master driver).

Read the range of tids available for the ETHOFLD functionality if it's
enabled.

New is_ftid() and is_etid() functions to test whether a tid falls within
the range of filter tids or ETHOFLD tids respectively.


265552 07-May-2014 np

MFC r258879:
cxgbe(4): T4_SET_SCHED_CLASS and T4_SET_SCHED_QUEUE ioctls to program
scheduling classes in the chip and to bind tx queue(s) to a scheduling
class respectively. These can be used for various kinds of tx traffic
throttling (to force selected tx queues to drain at a fixed Kbps rate,
or a % of the port's total bandwidth, or at a fixed pps rate, etc.).


265551 07-May-2014 np

MFC r257772, r258441, and r258689.

r257772:
cxgbe(4): Tidy up the display for payload memory statistics (pm_stats).

# sysctl -n dev.t4nex.0.misc.pm_stats
# sysctl -n dev.t5nex.0.misc.pm_stats

r258441:
cxgbe(4): update the internal list of device features.

r258689:
Disable an assertion that relies on some code[1] that isn't in HEAD yet.

[1] http://lists.freebsd.org/pipermail/freebsd-net/2013-August/036573.html


265549 07-May-2014 np

MFC r257654
cxgbe(4): Exclude MPS_RPLC_MAP_CTL (0x11114) from the register dump. Turns
out it's a write-only register with strange side effects on read.


265486 07-May-2014 np

MFC r256477:
cxgbe(4): Store the log2 of the # of doorbells per BAR2 page for both
ingress and egress queues, and for both T4 and T5. These values are
used by the T4/T5 iWARP driver.


265483 07-May-2014 np

MFC r256459:
cxgbe(4): Update T4 and T5 firmwares to 1.9.12.0


265482 07-May-2014 np

MFC r255198, r255410, and r255411.

r255198:
For TOE connections, the window scale factor in CPL_PASS_ACCEPT_REQ is
set to 15 to indicate that the peer did not send a window scale option
with its SYN. Do not send a window scale option in the SYN|ACK reply
in that case.

r255410:
Fix a miscalculation that caused cxgbe/tom to auto-increment
a TOE socket's tx buffer size too aggressively.

r255411:
Rework the tx credit mechanism between the cxgbe/tom driver
and the card. This helps smooth out some burstiness in the
exchange.


265481 07-May-2014 np

MFC r255050, r255052.

r255050:
Implement support for rx buffer packing. Enable it by default for T5
cards.

This is a T4 and T5 chip feature which lets the chip deliver multiple
Ethernet frames in a single buffer. This is more efficient within the
chip, in the driver, and reduces wastage of space in rx buffers.

- Always allocate rx buffers from the jumbop zone, no matter what the
MTU is. Do not use the normal cluster refcounting mechanism.
- Reserve space for an mbuf and a refcount in the cluster itself and let
the chip DMA multiple frames in the rest.
- Use the embedded mbuf for the first frame and allocate mbufs on the
fly for any additional frames delivered in the cluster. Each of these
mbufs has a reference on the underlying cluster.

r255052:
Fix the sysctl that displays whether buffer packing is enabled
or not.


265478 07-May-2014 np

MFC r253701, r253829, r253873, r253889, r253890, r254577, r254727, and r254933.

r253701:
Display a string instead of a numeric code in the linkdnrc sysctl.

r253829:
Display SGE tunables in the sysctl tree.

dev.t5nex.0.fl_pktshift: payload DMA offset in rx buffer (bytes)
dev.t5nex.0.fl_pad: payload pad boundary (bytes)
dev.t5nex.0.spg_len: status page size (bytes)
dev.t5nex.0.cong_drop: congestion drop setting

r253873:
Set up congestion manager context properly for T5 based cards.

r253889:
Fix previous commit (r253873). "cong" has one bit per channel but the
congestion channel map has 1 nibble per channel. So bits wxyz need to
be blown up into 000w000x000y000z.

r253890:
Display temperature sensor data. Shows -1 if sensor not
available on the card.

# sysctl dev.t4nex.0.temperature
# sysctl dev.t5nex.0.temperature

r254577:
Display P/N information in the description.

r254727:
There is no need to hold the freelist lock around alloc/free of
software descriptors. This also silences WITNESS warnings when
the software descriptors are allocated with M_WAITOK.

r254933:
Use correct mailbox and PCIe PF number when querying RDMA parameters.


265459 06-May-2014 np

r253688:
Reserve room for ioctls that aren't in this copy of the driver yet.


262807 05-Mar-2014 dumbbell

MFC r254610, r254611, r254617, r254620:

Implement atomic_swap() and atomic_testandset().
Implement atomic_cmpset_64() and atomic_swap_64() for i386.

The following revisions were merged at the same time, to avoid build
breakage:
o r256118
o r256119
o r256131


253777 29-Jul-2013 np

MFC r253407:
Specify a timeout for the PL block.

Approved by: re (kib)


253776 29-Jul-2013 np

MFC r253217,253699

r253217:
Attach to the 4x10G T540-CR card.

r253699:
Expand the list of devices claimed by cxgbe(4).

Approved by: re (kib)


252814 05-Jul-2013 np

- MFC r252661, r252705, r252711, r252715, r252716, r252724, r252728,
r252747.
- Connect t3_tom and t4_tom to the build (r252555 enables them).

r252661:
- Include the T5 firmware with the driver.
- Update the T4 firmware to the latest.
- Minor reorganization and updates to the version macros, etc.

r252705:
- Read all TP parameters in one place.
- Read the filter mode, calculate various shifts, and use them
properly during active open (in select_ntuple).

r252711:
The T5 allows the driver to specify the ISS. Do so; use the ISS picked
by the kernel.

r252715:
Ring the egress queue's doorbell as soon as there are 8 or more
descriptors ready to be processed.

r252716:
Pay attention to TCP_NODELAY when it's set/unset after the connection
is established.

r252724:
On-the-fly changes to the interrupt coalescing timer should apply to the
TOE rx queues too.

r252728:
- Make note of interface MTU change if the rx queues exist, and not just
when the interface is up.
- Add a tunable to control the TOE's rx coalesce feature (enabled by
default as it always has been). Consider the interface MTU or the
coalesce size when deciding which cluster zone to use to fill the
offload rx queue's free list. The tunable is:
dev.{t4nex,t5nex}.<N>.toe.rx_coalesce

r252747:
- Show the reason why link is down if this information is available.
- Display the temperature and PHY firmware version of the BT PHY.


252495 02-Jul-2013 np

MFC all cxgbe(4) changes missing from stable/9:
r248925, r249368, r249370, r249376, r249382, r249383, r249385, r249391,
r249392, r249393, r249627, r249629, r250090, r250092, r250093, r250117,
r250218, r250221, r250614, r251213, r251317, r251358, r251434, r251518,
r251638, r252312, r252469, r252470, r250697(kib).

r248925:
Support for Chelsio's 40G Terminator 5 (aka T5) ASIC.
...

r249368:
Set and display the IP fragment bit correctly when dealing with
the filter mode.

r249370:
cxgbe(4): Ensure that the MOD_LOAD handler runs before either t4nex or
t5nex attach to their devices.

r249376:
- Explain clearly why a different firmware is being installed (if/when
it is being installed). Improve other error messages while here.

- Select special FPGA specific configuration profile when appropriate.

r249382:
There is no need for elaborate queries and error checking when trying to
set FW4MSG_ENCAP.

r249383:
Get rid of a couple of stray \n's.

r249385:
cxgbe/tom: Slight simplification of code that calculates options2.

r249391:
Auto-reduce the holdoff timers that are greater than the maximum value
allowed by the hardware.

r249392:
Cosmetic change (s/wrwc/wcwr/;s/WRWC/WCWR/).

r249393:
Add pciids of the T5 based cards. The ones that I haven't tested with
cxgbe(4) are disabled for now. This will change.

r249627:
cxgbe/tom: Update the CLIP table on the chip when there are changes
to the list of IPv6 addresses on the system. The table is used for
TOE+IPv6 only.

r249629:
cxgbe(4): Refuse to install T5 firmwares on a T4 card (and vice versa).

r250090:
cxgbe(4): Some updates to shared code.

r250092:
- Provide accurate ifmedia information so that 40G ports/transceivers are
displayed properly in ifconfig, etc.

- Use the same number of tx and rx queues for a 40G port as for a 10G port.

r250093:
Attach to the T580 (2 x 40G) card.

r250117:
Fix DDP breakage introduced in r248925. Bitwise OR has higher
precedence than ternary conditional.

r250218:
cxgbe/tom: Do not use M_PROTO1 to mark rx zero-copy mbufs as special.
All the M_PROTOn flags are clobbered when an mbuf is appended to the
socket buffer.

r250221:
cxgbe: Switch to a better way to install firmware.

r250614:
Deal correctly with 40G ports that don't have any transceiver plugged
in. Do not claim that they have unknown tranceivers.

r251213:
cxgbe(4): Some more debug sysctls. These work on both T4 and T5 based
cards.

r251317:
cxgbe(4): t4fw_cfg must be explicitly loaded if the driver is being
loaded via loader.conf.

r251358:
cxgbe(4): Provide accurate hit count for filters on T5 cards. The
location within the TCB and the size have both changed.

r251434:
cxgbe(4): Never install a firmware if hw.cxgbe.fw_install is 0.

r251518:
cxgbe/tom: Fix bad signed/unsigned mixup in the stid allocator. This
fixes a panic when allocating a mixture of IPv6 and IPv4 stids.

r251638:
cxgbe/tom: Allow caller to select the queue (control or data) used to
send the CPL_SET_TCB_FIELD request in t4_set_tcb_field().

r252312:
Update T5 register ranges. This is so that regdump skips over registers
with read side-effects.

r252469:
Add a sysctl to get the number of filters available.

sysctl dev.t4nex.<N>.nfilters
sysctl dev.t5nex.<N>.nfilters

r252470:
Count the number of hits for a filter by default.

r250697:
Add dependencies on the firmware, which allows the loading of the cxgb
and cxgbe modules.


248078 09-Mar-2013 marius

MFC: r243857 (partial)

Mechanically substitute flags from historic mbuf allocator with
malloc(9) flags in sys/dev.


247434 28-Feb-2013 np

MFC r245243, r245274, r245276, r245434, r245441, r245448, r245467,
r245468, r245517, r245518, r245520, r245567, r245933, r245935, r245936,
r245937, r246093, r246385, r246575, r247062, r247122, r247289, r247291,
r247347, r247355, and r241733.

Note that TCP_OFFLOAD is not enabled in 9 yet and so some of these MFCs
don't really affect functionality. But they do help future MFCs
(related to TCP_OFFLOAD or not) by minimizing diffs with the driver in
head.

r245243:
cxgbe(4): updates to the configuration file that controls how hardware
resources are partitioned.

- Reduce the number of virtual interfaces reserved for PF4. This leaves
spare room in the source MAC table and allows the driver to setup
filters that rewrite the source MAC address.

- Reduce the number of filters and use the freed up space for the CLIP
(Compressed Local IPv6 addresses) table. This is a prerequisite for
IPv6 TOE support which will follow separately in a series of commits.

r245274:
cxgbe(4): Add functions to help synchronize "slow" operations (those not
on the fast data path) and use them instead of frobbing the adapter lock
and busy flag directly.

Other changes made while reworking all slow operations:
- Wait for the reply to a filter request (add/delete). This guarantees
that the operation is complete by the time the ioctl returns.
- Tidy up the tid_info structure.
- Do not allow the tx queue size to be set to something that's not a
power of 2.

r245276:
Overhaul the stid allocator so that it can be used for IPv6 servers
too. The entry for an IPv6 server in the TCAM takes up the equivalent
of two ordinary stids and must be properly aligned too.

r245434:
cxgbe(4): Updates to the hardware L2 table management code.

- Add full support for IPv6 addresses.

- Read the size of the L2 table during attach. Do not assume that PCIe
physical function 4 of the card has all of the table to itself.

- Use FNV instead of Jenkins to hash L3 addresses and drop the private
copy of jhash.h from the driver.

r245441:
cxgbe/tom: Miscellaneous updates for TOE+IPv6 support (more to follow).

- Teach find_best_mtu_idx() to deal with IPv6 endpoints.

- Install correct protosw in offloaded TCP/IPv6 sockets when DDP is
enabled.

- Move set_tcp_ddp_ulp_mode to t4_tom.c so that t4_tom.h can be included
without having to drag in t4_msg.h too. This was bothering the iWARP
driver for some reason.

r245448:
cxgbe/tom: Basic CLIP table management.

This is the Compressed Local IPv6 table on the chip. To save space, the
chip uses an index into this table instead of a full IPv6 address in
some of its hardware data structures.

For now the driver fills this table with all the local IPv6 addresses
that it sees at the time the table is initialized. I'll improve this
later so that the table is updated whenever new IPv6 addresses are
configured or existing ones deleted.

r245467:
cxgbe/tom: Add support for fully offloaded TCP/IPv6 connections (active open).

r245468:
cxgbe/tom: Add support for fully offloaded TCP/IPv6 connections (passive open).

r245517:
cxgbe: Fix the for_each_foo macros -- the last argument should not share
its name with any member of struct sge.

r245518:
cxgbe: Do a more thorough job in the CLEAR_STATS ioctl.

r245520:
Allow "ivlan" (inner VLAN) to be used as an alias for "vlan" when
specifying match criteria. "vlan" continues to be valid here, and it
continues to be valid when deleting, rewriting, inserting, or stacking
an 802.1q tag to a matching packet.

r245567:
cxgbe: Make the for_each macros safer to use by turning them
into a single statement each.

r245933:
cxgbe/tom: List IFCAP_TOE6 as supported now that all the required pieces
are in place. You still have to enable it explicitly, after loading the
t4_tom KLD.

r245935:
Add a couple of missing error codes. Treat CPL_ERR_KEEPALV_NEG_ADVICE as
negative advice and not a fatal error.

r245936:
Force the 404-BT card (4 x 1G) to use the "uwire" configuration file.

r245937:
Install an extra hold on the newly allocated synq entry so that it
cannot be freed while do_pass_accept_req is running. This closes a race
where do_pass_establish on another CPU (the driver chose a different
queue for the new tid) expands the synq entry into a full PCB and then
releases the only hold on it, all while do_pass_accept_req is still
running.

r246093:
Provide a statistic to track the number of drops in each of the port's
txq's buf_ring. The aggregate for all the queues of a port is already
provided in ifnet->if_snd.ifq_drops.

r246385:
Busy-wait when cold.

r246575:
Do not hold locks around hardware context reads.

r247062:
cxgbe(4): Assume that CSUM_TSO in the transmit path implies CSUM_IP and
CSUM_TCP too. They are all set explicitly by the kernel usually.

r247122:
cxgbe(4): Add sysctls to extract debug information from the chip:

dev.t4nex.X.misc.cim_la logic analyzer dump
dev.t4nex.X.misc.cim_qcfg queue configuration
dev.t4nex.X.misc.cim_ibq_xxx inbound queues
dev.t4nex.X.misc.cim_obq_xxx outbound queues

r247289:
cxgbe(4): Update firmware to 1.8.4.0.

r247291:
cxgbe(4): Ask the card's firmware to pad up tiny CPLs by encapsulating
them in a firmware message if it is able to do so. This works out
better for one of the FIFOs in the chip.

r247347:
cxgbe(4): Consider all the API versions of the interfaces exported by
the firmware (instead of just the main firmware version) when evaluating
firmware compatibility. Document the new "hw.cxgbe.fw_install" knob
being introduced here.

This should fix kern/173584 too. Setting hw.cxgbe.fw_install=2 will
mostly do what was requested in the PR but it's a bit more intelligent
in that it won't reinstall the same firmware repeatedly if the knob is
left set.

r247355:
cxgbe(4): Report unusual out of band errors from the firmware.

r241733 (by ed@):
Prefer __containerof() over __member2struct().

The former works better with qualifiers, but also properly type checks
the input pointer.


245145 08-Jan-2013 np

MFC r244551, r244580.

r244551:
cxgbe(4): must hold a write-lock on the table while allocating an L2
entry for switching.

r244580:
cxgbe(4): Add support for the T440-LP-CR card. This is the 4x10G low
profile card with a QSFP+ transceiver.


243952 06-Dec-2012 np

MFC r243680, r243681.

r243680:
cxgbe/tom: Add a flag to indicate that the L2 table entry for an
embryonic connection has been setup and never attempt to abort a tid
before this is done. This fixes a bad race where a listening socket is
closed when the driver is in the middle of step (b) here. The symptom
of this were "ARP miss" errors from the driver followed by tid leaks.

A hardware-offloaded passive open works this way:

a) A SYN "hits" the TCAM entry for a server tid and the chip delivers it
to the queue associated with the server tid (say, queue A). It waits
for a response from the driver telling it what to do.

b) The driver decides it is ok to proceed. It adds the new tid to the
list of embryonic connections associated with the server tid and then
hands off the SYN to the kernel's syncache to make sure that the kernel
okays it too. If it does then the driver provides an L2 table entry,
queue id (say, queue B), etc. and instructs the chip to send the SYN/ACK
response.

c) The chip delivers a status to queue B depending on how the third step
of the 3-way handshake goes. The driver removes the tid from its list
of embryonic connections and either expands the syncache entry or
destroys the tid. In any case all subsequent messages for the new tid
will be delivered to queue B, not queue A. Anything running in queue B
knows that the L2 entry has long been setup and the new flag is of no
interest from here on. If the listener is closed it will deal with
so_comp as normal.

r243681:
cxgbe/tom: Handle the case where the chip falls out of DDP mode by
itself. The hole in the receive sequence space corresponds to the
number of bytes placed directly up to that point.

Submittey by:


243605 27-Nov-2012 np

MFC r243110:

cxgbe/tom: Plug mbuf leak.


243098 15-Nov-2012 np

MFC r242666, r242671.

r242666:
Remove the tid from the software table (and bump down the in-use
counter) when the syncache doesn't want the driver to reply to an
incoming SYN. This fixes a harmless bug where tids_in_use would
go out of sync with the hardware counter.

r242671:
Make sure the inp hasn't been dropped before trying to access its socket
and tcpcb.


242015 24-Oct-2012 gavin

Merge r240680 from head:

Align the PCI Express #defines with the style used for the PCI-X
#defines. This has the advantage that it makes the names more
compact, and also allows us to correct the non-uniform naming of
the PCIM_LINK_* defines, making them all consistent amongst themselves.

This is a mostly mechanical rename:
s/PCIR_EXPRESS_/PCIER_/g
s/PCIM_EXP_/PCIEM_/g
s/PCIM_LINK_/PCIEM_LINK_/g

In this MFC, #defines have been added for the old names to assist
out-of-tree drivers.


241898 22-Oct-2012 np

MFC r241626, r241642.

r241626:
Whitespace cleanup.

r241642:
Always provide sndbuf and MSS values in a flowc command, even when the
driver is going to abort the connection right after the flowc.


241573 15-Oct-2012 np

MFC r241397-241399, r241409, r241493-24194.

r241397:
Remove unused item. cxgbe's rx queue's lock was removed a long time ago.

r241398:
There is no need to report the same error twice.

r241399:
Add a driver ioctl to read a byte from any device on a port's i2c bus.
This lets userspace read arbitrary information from the SFP+ modules
etc. on this bus.

Reading multiple bytes in the same transaction isn't possible right now.
I'll update the driver once the chip's firmware supports this.

r241409:
Add a driver ioctl to clear a port's MAC statistics.

r241493:
Use global knob in the TP_PARA_REG3 register to disable congestion
drops if the user has chosen this behaviour.

r241494:
Temporary fix for kern/172364.


241467 11-Oct-2012 np

MFC r240452-240453.

r240452:
Use native FreeBSD facilities everywhere except the shared code in common/

r240453:
Install interrupt handlers early, during attach, for the reason
explained in r239913 by jhb.


241465 11-Oct-2012 np

MFC r240443:
Update interface to firmware 1.6.2 and include the firmware in the driver.


240169 06-Sep-2012 np

MFC many cxgb and cxgbe features and fixes (r239258, r239259, r239264,
r239266, r239336, r239338, r239339, r239341, r239344, r239514, r239527,
r239528, r239544.

r239258:
Convert some fixed parameters to tunables (with reasonable default
values).

- cong_drop specifies what to do on congestion: nothing, backpressure,
or drop.
- fl_pktshift specifies the padding before Ethernet payload.
- fl_pad specifies the boundary upto which to pad Ethernet payload.
- spg_len controls the length of the status page.

r239259:
if_iqdrops should include frames truncated within the chip.

r239264:
Assume INET, INET6, and TCP_OFFLOAD when the driver is built out of tree and
KERNBUILDDIR is not set.

r239266:
The size of the buffers in an Ethernet freelist has to be higher than the
interface's MTU. Initialize such freelists with correct values.

This wasn't a problem for common MTUs (1500 and 9000) as the buffers (2048
and 9216 in size) happened to have enough spare room. I ran into it when
playing around with unusual MTUs.

r239336:
Allow for a different handler for each type of firmware message.

r239338:
Add a routine (t4_set_tcb_field) to update arbitrary parts of a hardware
TCB. Filters are programmed by modifying the TCB too (via a different
routine) and the reply to any TCB update is delivered via a
CPL_SET_TCB_RPL. Figure out whether the reply is for a filter-write or
something else and route it appropriately.

r239339:
Make room for DDP page pods in the default configuration profile. While
here, bump up the L2 table's size to 4K entries.

r239341:
Initialize various DDP parameters in the main cxgbe(4) driver:

- Setup multiple DDP page sizes. When the driver attempts DDP it will
try to combine physically contiguous pages into regions of these sizes.

- Set the indicate size such that the payload carried in the indicate can
be copied in the header mbuf (and the 16K rx buffer can be recycled).

- Set DDP threshold to the max payload that the chip will coalesce and
deliver to the driver (this is ~16K by default, which is also why the
offload rx queue is backed by 16K buffers). If the chip is able to
coalesce up to the max it's allowed to, it's a good sign that the peer
is transmitting in bulk without any TCP PSH.

r239344:
Support for TCP DDP (Direct Data Placement) in the T4 TOE module.

Basically, this is automatic rx zero copy when feasible. TCP payload is
DMA'd directly into the userspace buffer described by the uio submitted
in soreceive by an application.

- Works with sockets that are being handled by the TCP offload engine
of a T4 chip (you need t4_tom.ko module loaded after cxgbe, and an
"ifconfig +toe" on the cxgbe interface).
- Does not require any modification to the application.
- Not enabled by default. Use hw.t4nex.<X>.toe.ddp="1" to enable it.

r239514:
Minor cleanup: use bitwise ops instead of pointless wrappers around
setbit/clrbit.

r239527:
Cannot hold a mutex around vm_fault_quick_hold_pages, so don't. Tweak
some comments while here.

r239528:
Avoid a NULL pointer dereference.

r239544:
Deal with the case where a syncache entry added by the TOE driver is
evicted from the syncache but a later syncache_expand succeeds because
of syncookies. The TOE driver has to resort to more direct means to
install its hooks in the socket in this case.


239523 21-Aug-2012 dim

MFC r239102:

In sys/dev/cxgbe/firmware/t4fw_interface.h, change the enum
'fw_hdr_intfver' into an anonymous enum, which avoids a clang 3.2
warning about all the enum values being the same value.

Reviewed by: np


238462 15-Jul-2012 np

MFC r238313:

Fix a bug in code that calculates the number of the first interrupt
vector for a port. This affected the gigabit ports of T422 cards (the
ones with 2x10G ports and 2x1G ports).

Approved by: re (kib)


238302 09-Jul-2012 np

Re-enable IFCAP_TSO6 in cxgb(4) and cxgbe(4) in stable/9. The kernel
changes needed for all this to work have now been MFC'd to 9 by bz@.

This is a direct commit to stable/9 that removes earlier changes made to
drivers in this branch only.

Approved by: re (kib)


238230 08-Jul-2012 bz

MFC r235944:

Significantly update tcp_lro for mostly two things:
1) introduce basic support for IPv6 without extension headers.
2) try hard to also get the incremental checksum updates right,
especially also in the IPv4 case for the IP and TCP header.

Move variables around for better locality, factor things out into
functions, allow checksum updates to be compiled out, ...

Leave a few comments on further things to look at in the future,
though that is not the full list.

Update drivers with appropriate #includes as needed for IPv6 data
type in LRO.

Approved by: re


238088 03-Jul-2012 np

Do not enable IFCAP_TSO6 in cxgb(4) and cxgbe(4) in stable/9. The
kernel code in 9 isn't quite ready for TSO6 yet.

This is a direct commit to stable/9. IFCAP_TSO6 works properly in head
and there is no need to disable it over there.

Approved by: re (kib)


238057 03-Jul-2012 np

MFC r238054:
Fix inverted test that resulted in incorrect multicast hw programming.


238037 02-Jul-2012 np

MFC r238028:
Instruct the firmware not to provision resources for TCP offload if the
kernel is being built without TCP_OFFLOAD. But never override
toecaps_allowed if it has been set manually.


237925 01-Jul-2012 np

MFC r237832, r237436, r237439, r237463, r237512, r237587, r237799,
r237819, r237831.

r237832:
cxgb(4): IPv6 rx/tx hw checksum, IPv6 TSO and LRO too.

r237436:
cxgbe(4): update to firmware interface 1.5.2.0; updates to shared code.

r237439:
Do not read registers with read side effects while performing a register
dump for cxgbetool.

r237463:
Do not allocate extra vectors when adapter is not TOE
capable (or toecaps have been disallowed by the user).

r237512:
Better way to determine the status page length and rx pad boundary.

r237587:
Allow cxgbe(4) running within a VM to attach to its devices that have been
exported via PCI passthrough.

r237799:
cxgbe(4): support for IPv6 hardware checksumming (rx and tx).

r237819:
cxgbe(4): support for IPv6 TSO and LRO.

r237831:
- Assign (don't OR) the CSUM_XXX bits to csum_flags in the rx checksum code.
- Fix TSO/TSO4 mixup.
- Add IFCAP_LINKSTATE to the available/enabled capabilities.


237920 01-Jul-2012 np

Backport just the sys/{dev,modules}/cxgb{,e}/ parts of r237263, and then
disable the TOE and iWARP modules in the Makefiles (they won't compile
without the rest of r237263).

This reduces diffs between the cxgb/cxgbe drivers in head and 9 and
makes it easy to MFC other fixes to 9.


237916 01-Jul-2012 np

MFC r231317, r235963 (bz@), r234831, r234833.

r231317
Add IPv6 TSO (including TSO+VLAN) support to cxgb(4).

r235963 (bz@)
Allow LRO to work on IPv6 as well.
Fix the module Makefile to at least properly inlcude opt_inet6.h
and allow builds without INET or INET6.

r234831
Make sure that the firmware version is available in
dev.t4nex.X.firmware_version even if the driver fails to attach
properly. At least it'll be easy to tell what we're dealing with.

r234833:
Change the default to not use packet counters to generate rx interrupts.
Rely solely on the timer based mechanism.

Update man page to reflect this change.


235743 21-May-2012 jhb

Toss bogus mergeinfo.


235738 21-May-2012 sbruno

MFC r235634

Fix and update battery status bits according to linux driver


231607 13-Feb-2012 np

MFC r231592:
Use the non-sleeping variang of t4_wr_mbox in code that can be called
with locks held.


231601 13-Feb-2012 np

MFC r231172:
Program the MAC exact match table in batches of 7 addresses at
a time when possible. This is more efficient than one at a time.


231599 13-Feb-2012 np

MFC r231120:
Acquire the adapter lock before updating fields of the filter structure.


231597 13-Feb-2012 np

MFC r231116:
Remove if_start from cxgb and cxgbe.


231593 13-Feb-2012 np

MFC r231115:
cxgbe: reduce diffs with other branches.


231093 06-Feb-2012 np

MFC r228491, r228561, r228594.

r228491:
Do not clobber the ingress queue's congestion setting.

r228561:
Many updates to cxgbe(4)

- Device configuration via plain text config file. Also able to operate
when not attached to the chip as the master driver.

- Generic "work request" queue that serves as the base for both ctrl and
ofld tx queues.

- Generic interrupt handler routine that can process any event on any
kind of ingress queue (via a dispatch table).

- A couple of new driver ioctls. cxgbetool can now install a firmware
to the card ("loadfw" command) and can read the card's memory
("memdump" and "tcb" commands).

- Lots of assorted information within dev.t4nex.X.misc.* This is
primarily for debugging and won't show up in sysctl -a.

- Code to manage the L2 tables on the chip.

- Updates to cxgbe(4) man page to go with the tunables that have changed.

- Updates to the shared code in common/

- Updates to the driver-firmware interface (now at fw 1.4.16.0)

r228594:
Catch up with new driver ioctls in cxgbe.


229157 31-Dec-2011 mdf

MFC r228443:

Do not define bool/true/false if the symbols already exist.


229093 31-Dec-2011 hselasky

MFC r226173, r227843, r227848 and r227908:
Use DEVMETHOD_END to mark end of device methods.
Remove superfluous device methods.
Add some missing __FBSBID() macros.


225736 23-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


222973 11-Jun-2011 np

- driver ioctl to get SGE context for any given queue.
- sysctls to display the context id, cidx, and pidx of all kinds of queues.

MFC after: 3 days


222703 04-Jun-2011 np

Cause backpressure (instead of dropping frames) on congestion.

MFC after: 3 days


222701 04-Jun-2011 np

Allow lazy fill up of freelists.

MFC after: 3 days


222552 01-Jun-2011 np

Provide hit-count with rest of the information about a filter.

MFC after: 1 week


222551 31-May-2011 np

Firmware device log.

# sysctl dev.t4nex.0.devlog

MFC after: mdf's sysctl+sbuf changes are MFC'd


222513 30-May-2011 np

Update to firmware interface 1.3.10

MFC after: 1 week


222510 30-May-2011 np

- Specialized ingress queues that take interrupts for other ingress
queues. Try to have a set of these per port when possible, fall back
to sharing a common pool between all ports otherwise.

- One control queue per port (used to be one per hardware channel).

- t4_eth_rx now handles Ethernet rx only.

- sysctls to display pidx/cidx for some queues.

MFC after: 1 week


222509 30-May-2011 np

L2 table code. This is enough to get the T4's switch + L2 rewrite
filters working. (All other filters - switch without L2 info rewrite,
steer, and drop - were already fully-functional).

Some contrived examples of "switch" filters with L2 rewriting:

# cxgbetool t4nex0 iport 0 dport 80 action switch vlan +9 eport 3
Intercept all packets received on physical port 0 with TCP port 80 as
destination, insert a vlan tag with VID 9, and send them out of port 3.

# cxgbetool t4nex0 sip 192.168.1.1/32 ivlan 5 action switch \
vlan =9 smac aa:bb:cc:dd:ee:ff eport 0
Intercept all packets (received on any port) with source IP address
192.168.1.1 and VLAN id 5, rewrite the VLAN id to 9, rewrite source mac
to aa:bb:cc:dd:ee:ff, and send it out of port 0.

MFC after: 1 week


222102 19-May-2011 np

Simplify t4_os_find_pci_capability.

MFC after: 3 days


222085 18-May-2011 np

- Enable per-channel congestion notification.
- Enable PCIe relaxed ordering for all egress queues and rx data buffers.

MFC after: 3 days


222003 17-May-2011 np

Add missing header. The test for VLAN_CAPABILITIES later in the file
doesn't make sense without it.

MFC after: 3 days


221911 14-May-2011 np

sysctl that displays the absolute queue id of an rxq.


221516 05-May-2011 np

Bump up the number of egress queues that the driver is allowed to use.

MFC after: 3 days


221477 05-May-2011 np

T4 packet timestamps.

Reference code that shows how to get a packet's timestamp out of
cxgbe(4). Disabled by default because we don't have a standard way
today to pass this information up the stack.

The timestamp is 60 bits wide and each increment represents 1 tick of
the T4's core clock. As an example, the timestamp granularity is ~4.4ns
for this card:

# sysctl dev.t4nex.0.core_clock
dev.t4nex.0.core_clock: 228125

MFC after: 1 week


221474 05-May-2011 np

T4 packet filtering/steering.

- Enable 5-tuple and every-packet lookup.

- Setup the default filter mode to allow filtering/steering based on IP
protocol, ingress port, inner VLAN ID, IP frag, FCoE, and MPS match
type; all combined together. You can also filter based on MAC index,
Ethernet type, IP TOS/IPv6 Traffic Class, and outer VLAN ID but you'll
have to modify the default filter mode and exclude some of the
match-fields in it.

IPv4 and IPv6 SIP/DIP/SPORT/DPORT are always available in all filter
rules.

- Add driver ioctls to get/set the global filter mode.

- Add driver ioctls to program and delete hardware filters. A couple of
the "switch" actions that rewrite Ethernet and VLAN information and
switch the packet out of another port may not work as the L2 code is not
yet in place. Everything else, including all "drop" and "pass" rules
with RSS or absolute qid, should work.

Obtained from: Chelsio Communications


221464 04-May-2011 np

Always re-arm an iq's interrupt before leaving the handler.

MFC after: 1 week


220905 20-Apr-2011 np

Ring the freelist doorbell from within refill_fl. While here, fix a bug
that could have allowed the hardware pidx to reach the cidx even though
the freelist isn't empty. (Haven't actually seen this but it was there
waiting to happen..)

MFC after: 1 week


220897 20-Apr-2011 np

Use the correct free routine when destroying a control queue.

X-MFC after: r220873


220874 19-Apr-2011 np

Use Toeplitz hash for RSS.

MFC after: 3 days


220873 19-Apr-2011 np

- Move all Ethernet specific items from sge_eq to sge_txq. sge_eq is
now a suitable base for all kinds of egress queues.

- Add control queues (sge_ctrlq) and allocate one of these per hardware
channel. They can be used to program filters and steer traffic (and
more).

MFC after: 1 week


220649 15-Apr-2011 np

Fix a couple of bad races that can occur when a cxgbe interface is taken
down. The ingress queue lock was unused and has been removed as part of
these changes.

- An in-flight egress update from the SGE must be handled before the
queue that requested it is destroyed. Wait for the update to arrive.

- Interrupt handlers must stop processing rx events for a queue before
the queue is destroyed. Events that have not yet been processed
should be ignored once the queue disappears.

MFC after: 1 week


220643 14-Apr-2011 np

There is no need to request a tx credit flush if such a request is already
pending.

MFC after: 3 days


220410 07-Apr-2011 np

Modify read/write ioctls to work with 64 bit registers too.

MFC after: 3 days


220232 01-Apr-2011 np

Update header and related code for firmware 1.3.8

MFC after: 3 days


219944 24-Mar-2011 np

Do not over-allocate MSI interrupts for the case where each ingress
queue has its own interrupt. If the exact number that we need is not a
power of 2 and we're using MSI, then switch to interrupt multiplexing.

While here, replace the magic numbers with something more readable.

MFC after: 3 days


219883 22-Mar-2011 np

Fix an error while constructing the table that maps context id -> egress
queue.

MFC after: 1 day


219436 09-Mar-2011 np

Display holdoff timers and packet counts as a list of numbers.

MFC after: 1 week


219392 08-Mar-2011 np

cxgbe shouldn't directly know of the UMA zones where network buffers
come from.

MFC after: 1 week


219299 05-Mar-2011 np

Be sure to stay within the bounds of the mod_str array when displaying
the transceiver type.


219293 05-Mar-2011 np

There is no need to hold an ingress queue's lock while processing its
descriptors.

MFC after: 1 week


219292 05-Mar-2011 np

Calculate how many descriptors can be reclaimed before calling
reclaim_tx_descs


219290 05-Mar-2011 np

Tweaks for rx:

- everything related to LRO should be in #ifdef INET blocks
- reorder sge_iq's fields so that the most frequently used are all together
- pull all rx code into t4_intr_data directly
- let go of the ingress queue lock when passing up data
- refill the freelist only if it is short of at least 32 buffers


219289 05-Mar-2011 np

Store the ifnet rather than the port_info in each txq and rxq struct.

MFC after: 1 week


219288 05-Mar-2011 np

A txpkts work request should have a valid FID.

MFC after: 1 week


219287 05-Mar-2011 np

Upgrade the firmware on the card automatically if a better version is
available. Downgrade only for a major version mismatch.

MFC after: 1 week


219286 05-Mar-2011 np

Resume tx immediately in response to an SGE egress update from the hardware.

MFC after: 1 week


219285 05-Mar-2011 np

Fix incorrect assertion.

MFC after: 3 days


218792 18-Feb-2011 np

cxgbe(4) - NIC driver for Chelsio T4 (Terminator 4) based 10Gb/1Gb adapters.

MFC after: 3 weeks