Commit Graph

291 Commits

Author SHA1 Message Date
kmacy
9d3bb599b1 - 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
gnn
fb7f8e0e59 Several small additions to the Chelsio 10G driver.
1) Fix a bug in dealing with the Alerus 1006 PHY which prevented the
device from ever coming back up once it had been set to down.

2) Add a kernel tunable (hw.cxgb.snd_queue_len) which makes it possible
to give the device more than IFQ_MAXLEN entries in its send queue.  The
default remains 50.

3) Add code to place the card'd identification and serial number into
its description (%desc) so that users can tell which card they have
installed.
2008-11-21 19:22:25 +00:00
zec
815d52c5df Change the initialization methodology for global variables scheduled
for virtualization.

Instead of initializing the affected global variables at instatiation,
assign initial values to them in initializer functions.  As a rule,
initialization at instatiation for such variables should never be
introduced again from now on.  Furthermore, enclose all instantiations
of such global variables in #ifdef VIMAGE_GLOBALS blocks.

Essentialy, this change should have zero functional impact.  In the next
phase of merging network stack virtualization infrastructure from
p4/vimage branch, the new initialization methology will allow us to
switch between using global variables and their counterparts residing in
virtualization containers with minimum code churn, and in the long run
allow us to intialize multiple instances of such container structures.

Discussed at:	devsummit Strassburg
Reviewed by:	bz, julian
Approved by:	julian (mentor)
Obtained from:	//depot/projects/vimage-commit2/...
X-MFC after:	never
Sponsored by:	NLnet Foundation, The FreeBSD Foundation
2008-11-19 09:39:34 +00:00
kmacy
bae7e3ef64 Update firmware version check
make ddp a tunable

Obtained from:	Chelsio Inc.
MFC after:	3 days
2008-11-12 04:45:09 +00:00
bz
0ed604b580 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
bz
11a8a600e2 Hide AF_INET specific ioctl handling under #ifdef INET.
Reviewed by:	kmacy
MFC after:	2 months
2008-11-06 10:17:57 +00:00
kmacy
8ca0ed4e58 Track number of packets transmitted and number of packets received
PR:	125806
MFC after:	3 days
2008-10-17 07:04:29 +00:00
kmacy
5af9b4daf2 Fix bug in LRO on T304 whereby a packet could be sent to the wrong interface's ifp.
Submitted by:	Chelsio Inc.
MFC after:	1 day
2008-10-03 00:50:26 +00:00
zec
8797d4caec Step 1.5 of importing the network stack virtualization infrastructure
from the vimage project, as per plan established at devsummit 08/08:
http://wiki.freebsd.org/Image/Notes200808DevSummit

Introduce INIT_VNET_*() initializer macros, VNET_FOREACH() iterator
macros, and CURVNET_SET() context setting macros, all currently
resolving to NOPs.

Prepare for virtualization of selected SYSCTL objects by introducing a
family of SYSCTL_V_*() macros, currently resolving to their global
counterparts, i.e. SYSCTL_V_INT() == SYSCTL_INT().

Move selected #defines from sys/sys/vimage.h to newly introduced header
files specific to virtualized subsystems (sys/net/vnet.h,
sys/netinet/vinet.h etc.).

All the changes are verified to have zero functional impact at this
point in time by doing MD5 comparision between pre- and post-change
object files(*).

(*) netipsec/keysock.c did not validate depending on compile time options.

Implemented by:	julian, bz, brooks, zec
Reviewed by:	julian, bz, brooks, kris, rwatson, ...
Approved by:	julian (mentor)
Obtained from:	//depot/projects/vimage-commit2/...
X-MFC after:	never
Sponsored by:	NLnet Foundation, The FreeBSD Foundation
2008-10-02 15:37:58 +00:00
kmacy
0eeeb52dee update callers of vm_fault_hold_user_pages
MFC after:	1 week
2008-09-30 23:45:22 +00:00
kmacy
74c5b2b978 Refactor vm_fault_hold_user_pages:
- simplify page hold logic
- allow pages for processes other than that of curthread to
  have pages held
- normalize the interface to more closely resemble the functions in
  sys/vm

MFC after:	1 week
2008-09-30 23:44:44 +00:00
kmacy
4bc788a340 Make sure that optical PHYs work ...
Submitted by:	Chelsio Inc.
MFC after:	1 day
2008-09-30 21:21:52 +00:00
kmacy
cc2238d333 vm_fault_hold_user_pages will not return if an address in the range passed in is mapped RO
but an RW mapping exists for the underlying page. This change fixes the bug by using the
page / NULL returned from pmap_extract_and_hold to determine whether or not vm_fault needs
to be called.

The bug was pointed out by alc.

MFC after:	3 days
2008-09-29 22:13:29 +00:00
kmacy
7ed2245e3e fix insta-panic:
- determine which ext_arg offsets to use based on the version number

Submitted by:	Chelsio Inc.
MFC after:	1 day
2008-09-25 06:46:28 +00:00
kmacy
c01b2f07c6 - Remove default NIC dependency on ulp headers
- make toe module build dependent on kernel support

Submitted by:	Chelsio Inc.
MFC after:	1 week
2008-09-24 01:19:08 +00:00
kmacy
d96b26db13 Update cxgb include paths to not require prefixing with dev/cxgb
Submitted by:	Chelsio Inc.
2008-09-23 03:16:54 +00:00
kmacy
ba7bc1f5ea 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
kmacy
3c671d9bb6 - Fix flag check
- Fix adaptive thread sleep
- set oactive when queue is full
2008-09-23 01:55:36 +00:00
kmacy
912c9cbc11 - Track number of times that the transmit queue overflowed
- Trivial whitespace cleanup

MFC after:	3 days
2008-09-23 01:27:19 +00:00
kmacy
df6baa426c 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
kmacy
23049c5e89 Fix two panics:
1. panic: rtalloc1_fib: bad fibnum

2. panic: Lock tcpinp not exclusively locked
@ /usr/src/sys/netinet/in_pcb.c:1284

Submitted by:	Chelsio Inc.
MFC after:	3 days
2008-09-18 23:56:42 +00:00
attilio
23ff3dbeb8 Remove the suser(9) interface from the kernel. It has been replaced from
years by the priv_check(9) interface and just very few places are left.
Note that compatibility stub with older FreeBSD version
(all above the 8 limit though) are left in order to reduce diffs against
old versions. It is responsibility of the maintainers for any module, if
they think it is the case, to axe out such cases.

This patch breaks KPI so __FreeBSD_version will be bumped into a later
commit.

This patch needs to be credited 50-50 with rwatson@ as he found time to
explain me how the priv_check() works in detail and to review patches.

Tested by:      Giovanni Trematerra <giovanni dot trematerra at gmail dot com>
Reviewed by:    rwatson
2008-09-17 15:49:44 +00:00
kmacy
957f0e4e3b Further whitespace and copyright cleanups to minimize the
delta with RELENG_7.
2008-09-16 02:28:08 +00:00
kmacy
00a3b87a5a White space cleanups to bring closer to RELENG_7 2008-09-16 02:03:28 +00:00
kmacy
5e985b386a Remove some dead code along with gratuitous differences between HEAD and 7 2008-09-16 01:02:17 +00:00
kmacy
1af31f868a Fix issue with recovering from transient jumbo mbuf shortage.
Submitted by:	Chelsio Inc.
MFC after:	3 days
2008-09-09 01:36:02 +00:00
julian
52d64a6780 New file missed vimagification. 2008-09-03 19:23:01 +00:00
kmacy
33d6b8cb7b Indicate at probe time if device can do offload and which revision it is
MFC after:	3 days
2008-09-02 22:38:49 +00:00
kmacy
5800272415 Import ioctl updates for latest rev of cxgbtool
Obtained from:	Chelsio Inc.
MFC after:	3 days
2008-09-02 07:47:14 +00:00
kmacy
4f7f14505a Don't check if an interface can do tcp offload if there are no offload devices registered on the system.
Suggested by: rwatson
MFC after:	3 days
2008-09-01 05:30:22 +00:00
bz
1021d43b56 Commit step 1 of the vimage project, (network stack)
virtualization work done by Marko Zec (zec@).

This is the first in a series of commits over the course
of the next few weeks.

Mark all uses of global variables to be virtualized
with a V_ prefix.
Use macros to map them back to their global names for
now, so this is a NOP change only.

We hope to have caught at least 85-90% of what is needed
so we do not invalidate a lot of outstanding patches again.

Obtained from:	//depot/projects/vimage-commit2/...
Reviewed by:	brooks, des, ed, mav, julian,
		jamie, kris, rwatson, zec, ...
		(various people I forgot, different versions)
		md5 (with a bit of help)
Sponsored by:	NLnet Foundation, The FreeBSD Foundation
X-MFC after:	never
V_Commit_Message_Reviewed_By:	more people than the patch
2008-08-17 23:27:27 +00:00
kmacy
d2bb855ab7 Fix runt TSO packet issue.
Obtained from:	Chelsio Inc.
MFC after:	1 week
2008-08-13 01:32:32 +00:00
kmacy
6c8280f387 Add LRO and MAC statistics to exported sysctls.
Obtained from:	Chelsio Inc.
MFC after:	1 week
2008-08-13 01:30:41 +00:00
kmacy
174a107294 Remove cxgb private lro implementation and switch to using system implementation.
Obtained from:	Chelsio Inc.
MFC after:	1 week
2008-08-12 00:27:32 +00:00
kmacy
a130c67d80 Vendor fix for PHY problem.
Obtained from:	Chelsio Inc.
MFC after:	3 days
2008-08-11 23:01:34 +00:00
kmacy
cedc71acdf remove socketvar.h, add more selective includes 2008-07-31 20:28:58 +00:00
ps
626564d5a5 Unbreak the build by including sys/socketvar.h 2008-07-31 01:52:04 +00:00
kmacy
4ad195ad47 fix includes for post sockbuf re-factor 2008-07-30 20:08:34 +00:00
kmacy
52a393acad remove call to unsafe tcp_twstart function 2008-07-21 21:23:43 +00:00
kmacy
673bf0fe8a remove unneeded declarations 2008-07-21 02:34:52 +00:00
kmacy
cccf5dd0cc remove local version of tcp_offload_* functions 2008-07-21 02:29:40 +00:00
kmacy
b6ccefc36f update syncache function names 2008-07-21 02:26:49 +00:00
kmacy
7658528ea7 remove cxgb local definition of locked syncache_expand 2008-07-21 02:17:27 +00:00
kmacy
a6eb23b528 remove cxgb local definitions of socket accessor functions 2008-07-21 01:23:19 +00:00
kmacy
96f4c28cd5 new vendor PHY support 2008-07-18 07:01:51 +00:00
kmacy
c01ed5ad9b import vendor fixes to cxgb 2008-07-18 06:12:31 +00:00
kmacy
4f047a5220 conditionally define PANIC_IF, remove 'unlikely' 2008-05-05 22:37:21 +00:00
kmacy
a809f1f760 LINT fixes 2008-05-05 20:41:10 +00:00
kmacy
2ad219aa54 import support for iwarp on Chelsio T3 card
Supported by Chelsio Inc.
2008-05-05 18:46:18 +00:00
kmacy
49e613fa45 MFSVN:
- add / remove clients from cxgb_main.c now
 - change ifdef TOE_ENABLED to TCP_OFFLOAD_DISABLE
 - update copyrights
 - fix transmit data mismatch bug caused by not setting SB_NOCOALESCE
   on tx sockbuf on passive connections
 - fix receive sequence mismatch bug caused by not setting SB_NOCOALESCE
   on rx sockbuf on passive connections
 - don't sleep without checking SBS_CANTRCVMORE first
 - various ddp ordering fixes

Supported by: Chelsio Inc.
2008-05-05 01:41:53 +00:00
kmacy
caad0d585a remove kdb_backtrace() call 2008-04-19 03:43:06 +00:00
kmacy
4eae976a6a move cxgb_lt2.[ch] from NIC to TOE
move most offload functionality from NIC to TOE
factor out all socket and inpcb direct access
factor out access to locking in incpb, pcbinfo, and sockbuf
2008-04-19 03:22:43 +00:00
rwatson
ca47fccd6b Convert pcbinfo and inpcb mutexes to rwlocks, and modify macros to
explicitly select write locking for all use of the inpcb mutex.
Update some pcbinfo lock assertions to assert locked rather than
write-locked, although in practice almost all uses of the pcbinfo
rwlock main exclusive, and all instances of inpcb lock acquisition
are exclusive.

This change should introduce (ideally) little functional change.
However, it lays the groundwork for significantly increased
parallelism in the TCP/IP code.

MFC after:	3 months
Tested by:	kris (superset of committered patch)
2008-04-17 21:38:18 +00:00
kmacy
15067326c7 reduce the size of the jumbo ring on i386 and disable pcpu cluster caching 2008-03-31 21:02:27 +00:00
kmacy
59f40fe008 change inp_wlock_assert to inp_lock_assert 2008-03-24 20:24:04 +00:00
kmacy
9fbcabc6c7 remove unneccessary tcbinfo lock acquisitions - set tp to null affter calling enter_timewait as we no longer own the inpcb 2008-03-24 05:21:10 +00:00
kmacy
fb74f62b24 Insulate inpcb consumers outside the stack from the lock type and offset within the pcb by adding accessor functions.
Reviewed by: rwatson
MFC after: 3 weeks
2008-03-23 22:34:16 +00:00
kmacy
db590514fa pay attention to default cluster limits when sizing receive queues 2008-03-20 20:52:37 +00:00
kmacy
2deefa8109 fix link management bug and conditionally allow the PHY to be kept on at all times for allowing non-conformant link state checks 2008-03-19 20:56:51 +00:00
kmacy
8070f0fd71 - Integrate 1.133 vendor driver changes
- update some copyrights
- add improved support for delayed ack
- fix issue with fec
2008-03-18 03:55:12 +00:00
kmacy
3ec0d10a53 Parameterize for module name 2008-02-26 23:12:55 +00:00
kmacy
a7429d92be Remove unused files 2008-02-26 23:06:22 +00:00
kmacy
a8940df33d move remaining binaries in to blob headers 2008-02-26 23:05:05 +00:00
kmacy
3c2b753612 Move firmware in to separate module that can be compiled statically in to the kernel
Add utility for converting future firmware revs to a C header file
2008-02-26 03:02:20 +00:00
keramida
e113f77e8a Spell 'overwriting' correctly in a KASSERT() message. 2008-02-25 19:28:27 +00:00
kmacy
936fc7a506 Fix namespace collision with sparc macro 2008-02-24 07:19:31 +00:00
kmacy
b1eb788c2b remove call to kdb_backtrace() 2008-02-23 21:18:13 +00:00
kmacy
ba175a7cae Fix tinderbox by removing call to kdb_backtrace
MFC after: 3 days
2008-02-23 06:19:16 +00:00
kmacy
48fe676ff5 - 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
phk
df9c99b9c2 Give MEXTADD() another argument to make both void pointers to the
free function controlable, instead of passing the KVA of the buffer
storage as the first argument.

Fix all conventional users of the API to pass the KVA of the buffer
as the first argument, to make this a no-op commit.

Likely break the only non-convetional user of the API, after informing
the relevant committer.

Update the mbuf(9) manual page, which was already out of sync on
this point.

Bump __FreeBSD_version to 800016 as there is no way to tell how
many arguments a CPP macro needs any other way.

This paves the way for giving sendfile(9) a way to wait for the
passed storage to have been accessed before returning.

This does not affect the memory layout or size of mbufs.

Parental oversight by:	sam and rwatson.

No MFC is anticipated.
2008-02-01 19:36:27 +00:00
kmacy
4b5f86e85f Fix loading for case where we don't overload tcp_usrreqs by calling tcp_drop directly 2008-01-27 04:39:38 +00:00
kmacy
f999d9af27 fix DISABLE_MBUF_IOVEC case by initializing mbuf header completely 2008-01-27 04:37:02 +00:00
kmacy
ac46645d70 Re-enable pcpu caching by default make sysctl R/W 2008-01-19 22:47:43 +00:00
kmacy
53e7eb64df - remove bogus_imm counter
- disable pcpu cluster cache by default until reference counting is handled
  correctly for held clusters - can be re-enable by sysctl
2008-01-17 21:25:58 +00:00
sam
e443f3b38c promote ath_defrag to m_collapse (and retire private+unused
m_collapse from cxgb)

Reviewed by:	pyun, jhb, kmacy
MFC after:	2 weeks
2008-01-17 21:25:09 +00:00
kmacy
6dfbebef02 Fix lock ordering panic by not calling ether_ioctl with port lock held
Reported by: rrs
2008-01-16 21:33:34 +00:00
kmacy
1e0f928b96 remove superfluous debug printfs 2008-01-16 02:39:33 +00:00
kmacy
c2f095f565 Fix mbuf leak caused by freeing packet zone clusters but not their associated mbufs
- Track packet zone mbufs separately from other mbufs
- free packet zone buffers via m_free rather than trying to manage the refcount
  as with clusters - its refcount and management seems to be "special"
2008-01-16 00:28:30 +00:00
kmacy
df0456225c put tx queue size back to 1024 2008-01-16 00:26:04 +00:00
jhb
e5e6d6bdf6 Use '%zd' to print PIO_LEN since it involves a size_t (via sizeof()) to
appease the tinderbox on 32-bit platforms.

Tested on:	amd64, i386
2008-01-15 22:01:26 +00:00
kmacy
90f3f8edb2 - Simplify mb_free_ext_fast
- increase asserts for mbuf accounting
- track outstanding mbufs (maps very closely to leaked)
- actually only create one thread per port if !multiq
    Oddly enough this fixes the use after free

- move txq_segs to stack in t3_encap
- add checks that pidx doesn't move pass cidx
- simplify mbuf free logic in collapse mbufs routine
2008-01-15 08:08:09 +00:00
kmacy
1287cf02b7 - move WR_LEN in to cxgb_adapter.h add PIO_LEN to make intent clearer
- move cxgb_tx_common in to cxgb_multiq.c and rename to cxgb_tx
- move cxgb_tx_common dependencies
- further simplify cxgb_dequeue_packet for the non-multiqueue case
- only launch one service thread per port in the non-multiq case
- remove dead cleaning code from cxgb_sge.c
- simplify PIO case substantially in by returning directly from mbuf collapse
  and just using m_copydata
- remove gratuitous m_gethdr in the rx path
- clarify freeing of mbufs in collapse
2008-01-15 03:27:42 +00:00
kmacy
9696aa5a5b remove superfluous locking from dequeue 2008-01-15 03:21:02 +00:00
kmacy
bd332c3c41 - Assert that immpkt is not set
- convert %lx to 32-bit safe %jx
2008-01-14 07:55:56 +00:00
kmacy
e43c4da280 - Add more extensive sanity checks
- remove initial dequeue from cxgb_start as it was causing an mbuf to be referenced twice
2008-01-14 06:00:41 +00:00
kmacy
fdd517afe7 Make back pressure visible more quickly, particularly now that we maintain a queue internally 2008-01-14 05:59:06 +00:00
kmacy
950fa004e7 Add extensive sanity checking to buf_ring 2008-01-14 05:56:03 +00:00
kmacy
fa806e1d17 Convert over to using the multiqueue infrastructure although all calls going
through cxgb_start still end up using queue 0
2008-01-13 22:38:17 +00:00
kmacy
09452a19b0 Add buf_ring_full utility function, make sure dequeue/enqueue see the latest
indexes
2008-01-13 22:37:09 +00:00
kmacy
1c6521cfbb remove unused code 2008-01-13 22:35:12 +00:00
kmacy
13976d6da2 style nit 2008-01-13 22:33:49 +00:00
kmacy
dce4b2b9ef MFp4 multiple queue support 2008-01-12 20:34:56 +00:00
kmacy
bc3858933d Be more aggressive about tx cleaning - when multiples streams were running the tx
queue could fill up and stop getting cleaned.
2008-01-11 02:26:54 +00:00
kmacy
c2d2e21050 If we're not running with multiqueue enabled we need to wait to acquire the
rspq lock. Not doing so was causing us to skip re-enabling the interrupt.

- remove duplicate credits sysctl
- add support for dumping hardware context of the txq
- decrement budget_left when we break out of the process_responses loop
2008-01-10 23:51:34 +00:00
kmacy
257b751f99 Add support for selectively dumping the state of the hardware response queue.
Change ordering of a couple of types.
2008-01-10 06:54:20 +00:00
kmacy
7f86780195 should always free when refcount is 1 2008-01-10 06:52:48 +00:00
kmacy
7e708f7f6f - make 9k clusters the default unless a tunable is set
- return the error from cxgb_tx_common so that when an error is hit we dont
  spin forever in the taskq thread
- remove unused rxsd_ref
- simplify header_offset calculation for embedded mbuf headers
- fix memory leak by making sure that mbuf header initialization took place
- disable printf's for stalled queue, don't do offload/ctrl queue restart
  when tunnel queue is restarted
- add more diagnostic information about the txq state
- add facility to dump the actual contents of the hardware queue using sysctl
2008-01-10 00:55:42 +00:00
kmacy
090825944b make nqsets a uint32_t so that sysctl will work
add 2 fields for allowing queue dumping
2008-01-09 08:12:24 +00:00
kmacy
a0152fef95 don't decrement ref count below 1 for EXT_PACKET 2008-01-09 08:01:42 +00:00
kmacy
513b32a117 EXT_PACKET is one of the valid mbuf types 2008-01-09 08:01:08 +00:00
kmacy
6b59f75020 Fix mvec code to handle the case of the packet zone
this was missed in the initial import
2008-01-07 01:18:16 +00:00
julian
3032c5c971 Don't duplicate the whole of arpresolve to arpresolve 2 for the sake
of two compares against 0. The negative effect of cache flushing
is probably more than the gain by not doing the two compares (the
value is almost certainly in register or at worst, cache).
Note that the uses of m_freem() are in error cases and m_freem()
handles NULL anyhow. So fast-path really isn't changed much at all.
2007-12-31 23:48:06 +00:00
kmacy
17d5d1f3fc Don't overload tcp_usrreqs unless the kernel doesn't provide offload support. 2007-12-18 23:00:25 +00:00
kmacy
9fc024313f only include intr_machdep.h when it is needed for intr_bind
ia64 doesn't have an intr_machdep.h
2007-12-17 23:39:28 +00:00
kmacy
f0dbf05ef2 disable update in place on transmit 2007-12-17 10:02:29 +00:00
kmacy
a541ef6e7d 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
kmacy
ab4dffd44a Include cdefs.h and param.h for architectures with less header pollution 2007-12-16 21:22:24 +00:00
kmacy
9bec876a09 Use the vm include convention of busdma 2007-12-16 18:43:57 +00:00
kmacy
74fb05ec40 need M_IOVEC define 2007-12-16 18:36:57 +00:00
kmacy
da6c45e051 Don't globally include mvec.h its only needed by cxgb_sge.c 2007-12-16 18:26:04 +00:00
kmacy
e4b7a1f0cc Don't use old-style mbuf iovecs 2007-12-16 07:41:57 +00:00
kmacy
f96fe5e169 Add driver for TCP offload
Sponsored by: Chelsio Inc.
2007-12-16 05:27:26 +00:00
kmacy
f04336e4cb Update the buffer management support code needed by the tcp offload module 2007-12-16 05:19:48 +00:00
kmacy
8befa00c4d Sanitize of a routine that is going away 2007-12-16 05:14:25 +00:00
kmacy
ad0e83b9a6 overlead mbuf fields for use by toe 2007-12-16 05:11:42 +00:00
kmacy
020b8241bb Add system includes for mvec.h 2007-12-16 05:11:10 +00:00
kmacy
62acf9d037 Import updated support code for the TOM (tcp offload module). 2007-12-15 21:54:59 +00:00
kmacy
552004c58f Evidently setup_rss needs to happen whenever bind_qsets is done. This fixes
a problem with jumbo frames when not using msi-x interrupts.

Supported by: Chelsio
Approved by: re (blanket)
2007-09-11 23:49:27 +00:00
kmacy
495285abf0 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
kmacy
5e60afe4dd - Remove filter support
Supported by: Chelsio
Approved by: re(blanket)
2007-09-09 20:26:02 +00:00
kmacy
63ceb80675 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
kmacy
74b013d0d6 Fix last-minute typo in last commit caused by pre-commit scripts
Approved by: re(blanket)
2007-09-09 03:51:25 +00:00
kmacy
36e50690be - fix qset to port binding as a proper fix for the problems encountered on the 4-port
- fix the use after free seen when sending packets small enough to fit as an immediate
   and bpf peers are present
 - update to firmware rev 4.7 along with various small vendor fixes

Supported by: Chelsio
Approved by: re (blanket)
MFC after: 3 days
2007-09-09 01:28:03 +00:00
kmacy
2e3a8d8016 Fixes for 4 port and small packet optimization
- remove cpl->iff panic - we can't know the port number from the rspq on the 4-port
- pick the ifnet based on the interface in the CPL header
- switch to using qset 0 for egress on the 4-port for now - may change
  when we start using RSS
- move ether_ifdetach to before the port lock gets deinitialized to avoid
  hang in the case where there are BPF peers (cxgb_ioctl is called indirectly
  when BPF peers are present)
- don't call t3_mac_reset if multiport is set, this was causing tx errors
  by misconfiguring the MAC on the 4-port
- change V_TXPKT_INTF to use txpkt_intf as the interfaces are not contiguous
- free the mbuf immediately in the case where the payload is small enough to be copied
  into the rspq
- only update the coalesce timer if for a queue if packets were taken off of it
- add in missed 20ms DELAY in initializaton vsc8211

- prompt MFC as this only applies to the 4-port which is currently completely
  broken - OK'd by kensmith

Supported by: Chelsio
Approved by: re (blanket)
MFC after: 0 days
2007-08-25 21:07:37 +00:00
kmacy
c09acdcd00 forward port signedness fixes from RELENG_6
fix compile error for case where MSI_SUPPORTED not defined

Approved by: re (blanket)
2007-08-17 05:57:04 +00:00
kmacy
3a4b5d55d8 White space cleanups
Approved by: re (blanket)
2007-08-10 23:47:39 +00:00
kmacy
083e8c5c0f - In all structures other than port info port is a pointer to a port info,
make the code less confusing by renaming the port number to port_id

Approved by: re (blanket)
2007-08-10 23:33:34 +00:00
kmacy
184f644f1c - 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
kmacy
2d80191535 - 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
kmacy
73c1163dd5 MFp4 122896
- reduce cpu usage by as much as 25% (40% -> 30) by doing txq reclaim more efficiently
   - use mtx_trylock when trying to grab the lock to avoid spinning during long encap loop
   - add per-txq reclaim task
   - if mbufs were successfully re-claimed try another pass
- track txq overruns with sysctl

Approved by: re (blanket)
2007-07-10 06:01:45 +00:00
kmacy
ee0c9012ea - switch adapter and port lock over to using sx so that resources
can be allocated atomically
- add debug macros for printing lock initialization / teardown
- add buffers to port_info and adapter to allow each lock to have a
  unique name
- destroy mutexes initialized by cxgb_offload_init
- remove recursive calls to ADAPTER_LOCK
- move callout_drain calls so that they don't occur with the lock held
- ensure that only as many qsets as are needed are initialized and
  destroyed

MFC after: 3 days
Sponsored by: Chelsio Inc.
2007-06-17 04:33:38 +00:00
kmacy
86403b20df Fix build warnings
Submitted by: mjacob@
2007-06-15 20:02:02 +00:00
kmacy
ca1df96c1a - import new common code for the T304
- update to firmware version 4.1.0

- switch over to standard method for initializing cdevs (contributed by scottl@)
- break out timer_reclaim_task to be per-port
- move msix teardown into separate function
- fix bus_setup_intr for msi-x for the multi-port case so that msi-x resources
  are not corrupted on unload
- handle 10/100/1000 base-T media and auto negotiation
- bind qset to cpu even for singleq case
- white space cleanups
- remove recursive PORT_LOCK
- move mtu setting to separate function
- stop and re-init port when changing mtu
- replace all direct references to m_data with calls to mtod
- handle attach failure better by not trying to de-initialize
  taskqueues when they have not been allocated
- no longer default to jumbo frames

Sponsored by: Chelsio
MFC after: 3 days
2007-06-13 05:36:00 +00:00
kmacy
206255ce0b remove pointless recursive acquisition of port lock in cxgb_init_locked 2007-06-02 03:02:36 +00:00
kmacy
052215bb59 Fix case of setting OACTIVE erroneously 2007-05-29 04:18:21 +00:00
kmacy
9cb5d0f6ce Fix interrupt setup for the non-MSI-X case 2007-05-29 03:13:53 +00:00
kmacy
679d42f237 When building cxgb as a module make include paths relative to the driver's root.
This will make it possible to build the module out of tree against an older src tree.

MFC after: 3 days
2007-05-28 22:57:27 +00:00
kmacy
4fa4b7f8c6 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
kmacy
3446e0aa75 Don't bind queue to cpus if only one queue is in use 2007-05-27 22:04:30 +00:00
kmacy
f48bd675d8 fix compile warning by removing redundant LOG_ERR define 2007-05-27 04:39:29 +00:00
kmacy
a25cd5af4b set IFF_OACTIVE to avoid hangs when the tx ring fills up 2007-05-27 04:39:07 +00:00
kmacy
bf51ee7f9c add missed header 2007-05-25 18:29:17 +00:00
kmacy
fc73d99652 update license headers 2007-05-25 16:42:25 +00:00
kmacy
e122b73bf6 add toe device header missed by previous commit 2007-05-25 16:17:59 +00:00
kmacy
ddbd7cde72 (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
kmacy
2f0b14e001 Default to using a single queue as this is currently the only way to achieve
line rate
2007-04-26 08:38:00 +00:00
kmacy
15aa4e7aa9 Disable mbuf chain collapsing - it is currently causing an mbuf leak 2007-04-26 08:36:59 +00:00
kmacy
60e4196f37 Free cluster if we fail to create the dmamap.
Fixes CID 1829
Found by: Coverity
2007-04-20 05:16:42 +00:00
kmacy
17fde132b6 Eliminate CID 1842 by comparing against (type != EXT_MBUF) => refcnt != NULL 2007-04-20 05:12:54 +00:00
kmacy
f49e46301b Fix memory leak in m_collapse (CID 1843)
Found by: Coverity
Submitted by: jhb
2007-04-20 05:06:02 +00:00