Commit Graph

42 Commits

Author SHA1 Message Date
Navdeep Parhar
6792568fe2 cxgb(4): Fix "set but not used [-Wunused-but-set-variable]" warnings.
MFC after:	1 week
Sponsored by:	Chelsio Communications
2022-01-10 12:15:12 -08:00
Warner Losh
1a1b54589b Remove conditional code for FreeBSD 8 and earlier frmo cxgb. 2020-03-01 18:17:56 +00:00
Pedro F. Giffuni
718cf2ccb9 sys/dev: further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
2017-11-27 14:52:40 +00:00
Hans Petter Selasky
ae14b49908 Fix kernel LINT build after r299363.
Define shadowing macros the same way to avoid macro redefinition
compile error(s) for now.

Approved by:	np @
2016-05-10 16:31:18 +00:00
Hans Petter Selasky
fe68f570d4 Update and add various macros to the LinuxKPI and resolve a macro
redefinition issue in the cxgb driver.

MFC after:	1 week
Sponsored by:	Mellanox Technologies
Reviewed by:	np @
2016-01-26 15:26:35 +00:00
Enji Cooper
ee3a7d2fb7 Remove kdb_backtrace extern; get the definition for kdb_backtrace from
<sys/kdb.h> instead

Fix whitespace in WARN_ON macro definition

MFC after: 1 week
Reviewed by: np
Differential Revision: https://reviews.freebsd.org/D1799
Sponsored by: EMC / Isilon Storage Division
2015-02-07 21:29:17 +00:00
Hans Petter Selasky
c7818b48b6 - Update the OFED Linux Emulation layer as a preparation for a
hardware driver update from Mellanox Technologies.
- Remove empty files from the OFED Linux Emulation layer.
- Fix compile warnings related to printf() and the "%lld" and "%llx"
format specifiers.
- Add some missing 2-clause BSD copyrights.
- Add "Mellanox Technologies, Ltd." to list of copyright holders.
- Add some new compatibility files.
- Fix order of uninit in the mlx4ib module to avoid crash at unload
using the new module_exit_order() function.

MFC after:	1 week
Sponsored by:	Mellanox Technologies
2014-08-27 13:21:53 +00:00
Gavin Atkinson
389c8bd51e Align the PCI Express #defines with the style used for the PCI-X
#defines.  This also has the advantage that it makes the names more
compact, iand 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

When this is MFC'd, #defines will be added for the old names to assist
out-of-tree drivers.

Discussed with:	jhb
MFC after:	1 week
2012-09-18 22:04:59 +00:00
Navdeep Parhar
09fe63205c - Updated TOE support in the kernel.
- Stateful TCP offload drivers for Terminator 3 and 4 (T3 and T4) ASICs.
  These are available as t3_tom and t4_tom modules that augment cxgb(4)
  and cxgbe(4) respectively.  The cxgb/cxgbe drivers continue to work as
  usual with or without these extra features.

- iWARP driver for Terminator 3 ASIC (kernel verbs).  T4 iWARP in the
  works and will follow soon.

Build-tested with make universe.

30s overview
============
What interfaces support TCP offload?  Look for TOE4 and/or TOE6 in the
capabilities of an interface:
# ifconfig -m | grep TOE

Enable/disable TCP offload on an interface (just like any other ifnet
capability):
# ifconfig cxgbe0 toe
# ifconfig cxgbe0 -toe

Which connections are offloaded?  Look for toe4 and/or toe6 in the
output of netstat and sockstat:
# netstat -np tcp | grep toe
# sockstat -46c | grep toe

Reviewed by:	bz, gnn
Sponsored by:	Chelsio communications.
MFC after:	~3 months (after 9.1, and after ensuring MFC is feasible)
2012-06-19 07:34:13 +00:00
Navdeep Parhar
e83ec3e5c3 There is no need to test __FreeBSD_version for features that have
been around for a long time now (7.1-ish or even earlier); assume
they are present.  These includes MSI, TSO, LRO, VLAN, INTR_FILTERS,
FIRMWARE, etc.

Also, eliminate some dead code and clean up in other places as part
of this quick once-over.

MFC after:	1 week
2010-02-24 10:16:18 +00:00
Navdeep Parhar
c01f2b8301 cxgb(4) updates, including:
- support for the new Gen-2, BT, and LP-CR cards.
- T3 firmware 7.7.0
- shared "common code" updates.

Approved by:	gnn (mentor)
Obtained from:	Chelsio
MFC after:	1 month
2009-10-05 20:21:41 +00:00
Kip Macy
3f345a5d09 Greatly simplify cxgb by removing almost all of the custom mbuf management logic
- remove mbuf iovec - useful, but adds too much complexity when isolated to
   the driver

- remove driver private caching - insufficient benefit over UMA to justify
  the added complexity and maintenance overhead

- remove separate logic for managing multiple transmit queues, with the
  new drbr routines the control flow can be made to much more closely resemble
  legacy drivers

- remove dedicated service threads, with per-cpu callouts one can get the same
  benefit much more simply by registering a callout 1 tick in the future if there
  are still buffered packets

- remove embedded mbuf usage - Jeffr's changes will (I hope) soon be integrated
  greatly reducing the overhead of using kernel APIs for reference counting
  clusters

- add hysteresis to descriptor coalescing logic

- add coalesce threshold sysctls to allow users to decide at run-time
  between optimizing for forwarding / UDP or optimizing for TCP

- add once per second watchdog to effectively close the very rare races
  occurring from coalescing

- incorporate Navdeep's changes to the initialization path required to
  convert port and adapter locks back to ordinary mutexes (silencing BPF
  LOR complaints)

- enable prefetches in get_packet and tx cleaning

Reviewed by:	navdeep@
MFC after:	2 weeks
2009-06-19 23:34:32 +00:00
Kip Macy
5eba27fe0c Add backward compatibility ifdefs for non-multiq kernels 2008-11-23 07:30:07 +00:00
Kip Macy
db7f0b974f - bump __FreeBSD version to reflect added buf_ring, memory barriers,
and ifnet functions

- add memory barriers to <machine/atomic.h>
- update drivers to only conditionally define their own

- add lockless producer / consumer ring buffer
- remove ring buffer implementation from cxgb and update its callers

- add if_transmit(struct ifnet *ifp, struct mbuf *m) to ifnet to
  allow drivers to efficiently manage multiple hardware queues
  (i.e. not serialize all packets through one ifq)
- expose if_qflush to allow drivers to flush any driver managed queues

This work was supported by Bitgravity Inc. and Chelsio Inc.
2008-11-22 05:55:56 +00:00
Bjoern A. Zeeb
ca6bc428e7 For now our LRO code (tcp_lro.c) only supports IPv4 properly thus
only enable if INET is on.

Reviewed by:	kmacy
MFC after:	2 months
2008-11-06 10:35:46 +00:00
Kip Macy
79775f8f1b Update cxgb include paths to not require prefixing with dev/cxgb
Submitted by:	Chelsio Inc.
2008-09-23 03:16:54 +00:00
Kip Macy
e97121da99 Allow cxgb to be unified across versions by making newer features conditional
Submitted by:	Chelsio Inc
MFC after:	3 days
2008-09-23 02:22:24 +00:00
Kip Macy
023d231918 Fix issue with tom loading by moving cxgb_log_tcb in to tom
MFC after:	3 days
2008-09-19 21:12:19 +00:00
Kip Macy
c5f0f48581 Further whitespace and copyright cleanups to minimize the
delta with RELENG_7.
2008-09-16 02:28:08 +00:00
Kip Macy
4af83c8cff import vendor fixes to cxgb 2008-07-18 06:12:31 +00:00
Kip Macy
71dba7f30c conditionally define PANIC_IF, remove 'unlikely' 2008-05-05 22:37:21 +00:00
Kip Macy
8e10660f12 - update firmware to 5.0
- add support for T3C
- add DDP support (zero-copy receive)
- fix TOE transmit of large requests
- fix shutdown so that sockets don't remain in CLOSING state indefinitely
- register listeners when an interface is brought up after tom is loaded
- fix setting of multicast filter
- enable link at device attach
- exit tick handler if shutdown is in progress
- add helper for logging TCB
- add sysctls for dumping transmit queues

- note that TOE wxill not be MFC'd until after 7.0 has been finalized

MFC after: 3 days
2008-02-23 01:06:17 +00:00
Kip Macy
74aba11713 remove superfluous locking from dequeue 2008-01-15 03:21:02 +00:00
Kip Macy
6481d641b5 Add extensive sanity checking to buf_ring 2008-01-14 05:56:03 +00:00
Kip Macy
0d57d78ca0 Add buf_ring_full utility function, make sure dequeue/enqueue see the latest
indexes
2008-01-13 22:37:09 +00:00
Kip Macy
8090c9f504 Make TCP offload work on HEAD (modulo negative interaction between sbcompress
and t3_push_frames).
 - Import latest changes to cxgb_main.c and cxgb_sge.c from toestack p4 branch
 - make driver local copy of tcp_subr.c and tcp_usrreq.c and override tcp_usrreqs so
   TOE can also functions on versions with unmodified TCP

- add cxgb back to the build
2007-12-17 08:17:51 +00:00
Kip Macy
35f70ae1d3 overlead mbuf fields for use by toe 2007-12-16 05:11:42 +00:00
Kip Macy
3e96c7e790 Import updated support code for the TOM (tcp offload module). 2007-12-15 21:54:59 +00:00
Kip Macy
2de1fa86d7 pull in changes made to RELENG_6 version in the process of doing the MFC
Supported by: Chelsio
Approved by: re (blanket)
2007-09-10 00:59:51 +00:00
Kip Macy
8adc65adda Add back in support for normal mbuf chaining on RX under DISABLE_MBUF_IOVEC
Approved by: re(blanket)
Supported by: Chelsio
2007-09-09 04:34:03 +00:00
Kip Macy
ac3a6d9cef - integrate most recent changes from vendor branch and upgrade to firmware revision 4.5.5
- add filter support
	- further improvements for T304
- recover gracefully from spurious immediate packets

Approved by: re(blanket)
Supported by: Chelsio
MFC after: 3 days
2007-07-17 06:50:35 +00:00
Kip Macy
8870f0e16b - Increase descriptors per call to start
- enqueue per-txq task
- fix per-txq task initialization

Approved by: re (blanket)
2007-07-17 06:12:22 +00:00
Kip Macy
04ad339002 Tuning for small packet handling
- Double the number of descriptors that a single call to send can use
- Quadruple the number of descriptors that can be reclaimed per pass
- only run reclaim twice per second
- increase coalesce timer from 3.5us to 5us

fix printf warning on 64-bit platforms
2007-05-27 22:07:47 +00:00
Kip Macy
d722cab49a (MFp4)
- upgrade to reflect state of 1.0.0.86
        - move from firmware rev 3.2 to 4.0.0
        - import driver bits for offload functionality
	- remove binary distribution clause from top level files as it
	  runs counter to the intent of purely supporting the hardware

MFC after: 3 days
2007-05-25 09:48:20 +00:00
Kip Macy
c0a24dd4aa Convert driver RX path over to using mbuf iovec 2007-04-08 15:04:19 +00:00
Kip Macy
693d746cc1 make MSI-X the default and allocate up to mp_ncpus queues per port
MFC after: 3 days
2007-03-21 07:25:40 +00:00
Kip Macy
577e9bbe3e Synchronize with version 1.0.071 of Chelsio's common code
(with the notable exception of improvements for using multiple TX queues)

This adds support for the T3B2 ASIC rev

Obtained from: Chelsio
MFC after: 3 days
2007-03-20 21:43:32 +00:00
Kip Macy
c8411d871a #define L1_CACHE_BYTES for non-x86 2007-03-14 16:18:51 +00:00
Kip Macy
58bcd3238c define prefetch as a no-op macro for non-x86 arches 2007-03-14 16:05:39 +00:00
Kip Macy
bede276b07 #define memory barrier macros for the non-i386 && non-amd64 case 2007-03-14 06:40:46 +00:00
Kip Macy
7d9ca96411 add cxgb_config.h to define values that are defined in the Makefile when compiled as a
module

move prefetch out of cxgb_sge.c into header under arch conditional compilation
2007-03-14 06:35:38 +00:00
Kip Macy
b6d90eb779 First of several commits for driver support for the Chelsio T3B 10 Gigabit
Ethernet adapter.

Reviewed by: scottl, sam

For those interested in the preliminary performance work see below.

Plots of mxge vs. cxgb running netpipe:

blocksize vs. bandwidth:
http://www.fsmware.com/chelsio.random/bsvsbw.gif

blocksize vs. RTT:
First of several commits for driver support for the Chelsio T3B 10 Gigabit
Ethernet adapter.

Reviewed by: scottl, sam

For those interested in the preliminary performance work see below.

Plots of mxge vs. cxgb running netpipe:

blocksize vs. bandwidth:
http://www.fsmware.com/chelsio.random/bsvsbw.gif

blocksize vs. RTT:
http://www.fsmware.com/chelsio.random/bsvstime.gif

blocksize vs. RTT for block sizes <= 10kb:
http://www.fsmware.com/chelsio.random/bsvstime_10kb.gif
http://www.fsmware.com/chelsio.random/bsvstime_10kb3.gif
2007-03-14 02:37:44 +00:00