head	1.7;
access;
symbols
	RELENG_8_4:1.7.0.2
	RELENG_9_1_0_RELEASE:1.4.2.2.2.2
	RELENG_9_1:1.4.2.2.0.2
	RELENG_9_1_BP:1.4.2.2
	RELENG_8_3_0_RELEASE:1.1.2.4.2.1
	RELENG_8_3:1.1.2.4.0.2
	RELENG_8_3_BP:1.1.2.4
	RELENG_9_0_0_RELEASE:1.4.2.1.2.1
	RELENG_9_0:1.4.2.1.0.2
	RELENG_9_0_BP:1.4.2.1
	RELENG_9:1.4.0.2
	RELENG_9_BP:1.4
	RELENG_8:1.1.0.2;
locks; strict;
comment	@# @;


1.7
date	2012.11.17.01.52.54;	author svnexp;	state Exp;
branches
	1.7.2.1;
next	1.6;

1.6
date	2012.08.14.23.08.49;	author np;	state Exp;
branches;
next	1.5;

1.5
date	2012.06.29.19.51.06;	author np;	state Exp;
branches;
next	1.4;

1.4
date	2011.06.23.20.31.52;	author uqs;	state Exp;
branches
	1.4.2.1;
next	1.3;

1.3
date	2011.05.30.21.07.26;	author np;	state Exp;
branches;
next	1.2;

1.2
date	2011.05.05.02.38.08;	author np;	state Exp;
branches;
next	1.1;

1.1
date	2011.04.01.00.25.32;	author np;	state Exp;
branches
	1.1.2.1;
next	;

1.7.2.1
date	2012.11.17.01.52.54;	author svnexp;	state dead;
branches;
next	1.7.2.2;

1.7.2.2
date	2013.03.28.13.05.19;	author svnexp;	state Exp;
branches;
next	;

1.4.2.1
date	2011.09.23.00.51.37;	author kensmith;	state Exp;
branches
	1.4.2.1.2.1;
next	1.4.2.2;

1.4.2.2
date	2012.07.01.13.43.30;	author np;	state Exp;
branches
	1.4.2.2.2.1;
next	1.4.2.3;

1.4.2.3
date	2012.09.06.17.28.47;	author np;	state Exp;
branches;
next	1.4.2.4;

1.4.2.4
date	2012.11.17.11.37.16;	author svnexp;	state Exp;
branches;
next	;

1.4.2.1.2.1
date	2011.11.11.04.20.22;	author kensmith;	state Exp;
branches;
next	1.4.2.1.2.2;

1.4.2.1.2.2
date	2012.11.17.08.37.13;	author svnexp;	state Exp;
branches;
next	;

1.4.2.2.2.1
date	2012.08.05.23.54.33;	author kensmith;	state Exp;
branches;
next	1.4.2.2.2.2;

1.4.2.2.2.2
date	2012.11.17.08.48.04;	author svnexp;	state Exp;
branches;
next	;

1.1.2.1
date	2011.04.04.18.47.17;	author np;	state dead;
branches;
next	1.1.2.2;

1.1.2.2
date	2011.04.04.18.47.17;	author np;	state Exp;
branches;
next	1.1.2.3;

1.1.2.3
date	2011.05.13.22.48.44;	author np;	state Exp;
branches;
next	1.1.2.4;

1.1.2.4
date	2011.06.06.22.26.02;	author np;	state Exp;
branches
	1.1.2.4.2.1;
next	1.1.2.5;

1.1.2.5
date	2012.11.17.10.36.56;	author svnexp;	state Exp;
branches;
next	1.1.2.6;

1.1.2.6
date	2013.03.02.22.52.51;	author svnexp;	state Exp;
branches;
next	;

1.1.2.4.2.1
date	2012.03.03.06.15.13;	author kensmith;	state Exp;
branches;
next	1.1.2.4.2.2;

1.1.2.4.2.2
date	2012.11.17.08.25.32;	author svnexp;	state Exp;
branches;
next	;


desc
@@


1.7
log
@Switching exporter and resync
@
text
@#
# $FreeBSD: head/sys/modules/cxgbe/if_cxgbe/Makefile 239264 2012-08-14 23:08:49Z np $
#

.include <bsd.own.mk>

CXGBE = ${.CURDIR}/../../../dev/cxgbe
.PATH: ${CXGBE} ${CXGBE}/common

KMOD = if_cxgbe
SRCS = t4_main.c t4_sge.c t4_l2t.c
SRCS+= t4_hw.c
SRCS+= device_if.h bus_if.h pci_if.h
SRCS+= opt_inet.h opt_inet6.h
SRCS+= opt_ofed.h

CFLAGS+= -I${CXGBE}

# Provide the timestamp of a packet in its header mbuf.
#CFLAGS+= -DT4_PKT_TIMESTAMP

.if !defined(KERNBUILDDIR)
.if ${MK_INET_SUPPORT} != "no"
opt_inet.h:
	@@echo "#define INET 1" > ${.TARGET}
	@@echo "#define TCP_OFFLOAD 1" >> ${.TARGET}
.endif

.if ${MK_INET6_SUPPORT} != "no"
opt_inet6.h:
	@@echo "#define INET6 1" > ${.TARGET}
.endif
.endif

.include <bsd.kmod.mk>
@


1.7.2.1
log
@file Makefile was added on branch RELENG_8_4 on 2013-03-28 13:05:19 +0000
@
text
@d1 35
@


1.7.2.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/248810
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a0 34
#
# $FreeBSD: releng/8.4/sys/modules/cxgbe/if_cxgbe/Makefile 247670 2013-03-02 21:59:07Z np $
#

.include <bsd.own.mk>

CXGBE = ${.CURDIR}/../../../dev/cxgbe
.PATH: ${CXGBE} ${CXGBE}/common

KMOD = if_cxgbe
SRCS = t4_main.c t4_sge.c t4_l2t.c
SRCS+= t4_hw.c
SRCS+= device_if.h bus_if.h pci_if.h
SRCS+= opt_inet.h opt_inet6.h

CFLAGS+= -I${CXGBE}

# Provide the timestamp of a packet in its header mbuf.
#CFLAGS+= -DT4_PKT_TIMESTAMP

.if !defined(KERNBUILDDIR)
.if ${MK_INET_SUPPORT} != "no"
opt_inet.h:
	@@echo "#define INET 1" > ${.TARGET}
	@@echo "#define TCP_OFFLOAD 1" >> ${.TARGET}
.endif

.if ${MK_INET6_SUPPORT} != "no"
opt_inet6.h:
	@@echo "#define INET6 1" > ${.TARGET}
.endif
.endif

.include <bsd.kmod.mk>
@


1.6
log
@SVN rev 239264 on 2012-08-14 23:08:49Z by np

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

MFC after:	2 weeks
@
text
@d2 1
a2 1
# $FreeBSD$
@


1.5
log
@SVN rev 237819 on 2012-06-29 19:51:06Z by np

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

Submitted by:	bz (this is a modified version of that patch)
@
text
@d5 2
d22 13
@


1.4
log
@SVN rev 223483 on 2011-06-23 20:31:52Z by uqs

Fix make buildworld -DMODULES_WITH_WORLD
Sort opt_ srcs
@
text
@d12 1
a12 1
SRCS+= opt_inet.h
@


1.4.2.1
log
@SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

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

Approved by:	re (implicit)
@
text
@@


1.4.2.2
log
@SVN rev 237925 on 2012-07-01 13:43:30Z by 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.
@
text
@d12 1
a12 1
SRCS+= opt_inet.h opt_inet6.h
@


1.4.2.2.2.1
log
@SVN rev 239080 on 2012-08-05 23:54:33Z by kensmith

Copy stable/9 to releng/9.1 as part of the 9.1-RELEASE release process.

Approved by:	re (implicit)
@
text
@@


1.4.2.2.2.2
log
@Switch importer
@
text
@d2 1
a2 1
# $FreeBSD: releng/9.1/sys/modules/cxgbe/if_cxgbe/Makefile 237925 2012-07-01 13:43:30Z np $
@


1.4.2.3
log
@SVN rev 240169 on 2012-09-06 17:28:47Z by 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.
@
text
@a4 2
.include <bsd.own.mk>

a19 13
.if !defined(KERNBUILDDIR)
.if ${MK_INET_SUPPORT} != "no"
opt_inet.h:
	@@echo "#define INET 1" > ${.TARGET}
	@@echo "#define TCP_OFFLOAD 1" >> ${.TARGET}
.endif

.if ${MK_INET6_SUPPORT} != "no"
opt_inet6.h:
	@@echo "#define INET6 1" > ${.TARGET}
.endif
.endif

@


1.4.2.4
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242902
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242902 | dteske | 2012-11-11 23:29:45 +0000 (Sun, 11 Nov 2012) | 10 lines
## SVN ##
## SVN ## Fix a regression introduced by SVN r211417 that saw the breakage of a feature
## SVN ## documented in usr.sbin/sysinstall/help/shortcuts.hlp (reproduced below):
## SVN ##
## SVN ## If /usr/sbin/sysinstall is linked to another filename, say
## SVN ## `/usr/local/bin/configPackages', then the basename will be used
## SVN ## as an implicit command name.
## SVN ##
## SVN ## Reviewed by:	adrian (co-mentor)
## SVN ## Approved by:	adrian (co-mentor)
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d2 1
a2 1
# $FreeBSD: stable/9/sys/modules/cxgbe/if_cxgbe/Makefile 240169 2012-09-06 17:28:47Z np $
@


1.4.2.1.2.1
log
@SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)
@
text
@@


1.4.2.1.2.2
log
@Switch importer
@
text
@d2 1
a2 1
# $FreeBSD: releng/9.0/sys/modules/cxgbe/if_cxgbe/Makefile 223483 2011-06-23 20:31:52Z uqs $
@


1.3
log
@SVN rev 222509 on 2011-05-30 21:07:26Z by 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
@
text
@d13 1
@


1.2
log
@SVN rev 221477 on 2011-05-05 02:38:08Z by 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
@
text
@d9 1
a9 1
SRCS = t4_main.c t4_sge.c
@


1.1
log
@SVN rev 220231 on 2011-04-01 00:25:32Z by np

Allow multiple modules within sys/modules/cxgbe.  The first one is if_cxgbe.

MFC after:	3 days
@
text
@d16 3
@


1.1.2.1
log
@file Makefile was added on branch RELENG_8 on 2011-04-06 21:16:20 +0000
@
text
@d1 16
@


1.1.2.2
log
@SVN rev 220339 on 2011-04-04 18:47:17Z by np

MFC r220231, r220232

r220231:
Allow multiple modules within sys/modules/cxgbe.  The first one is if_cxgbe.

r220232:
Update header and related code for firmware 1.3.8
@
text
@a0 16
#
# $FreeBSD$
#

CXGBE = ${.CURDIR}/../../../dev/cxgbe
.PATH: ${CXGBE} ${CXGBE}/common

KMOD = if_cxgbe
SRCS = t4_main.c t4_sge.c
SRCS+= t4_hw.c
SRCS+= device_if.h bus_if.h pci_if.h
SRCS+= opt_inet.h

CFLAGS+= -I${CXGBE}

.include <bsd.kmod.mk>
@


1.1.2.3
log
@SVN rev 221861 on 2011-05-13 22:48:44Z by np

MFC r221474, r221477 (packet filter/steer/switch, timestamps)

r221474:
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.

r221477:
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
@
text
@a15 3
# Provide the timestamp of a packet in its header mbuf.
#CFLAGS+= -DT4_PKT_TIMESTAMP

@


1.1.2.4
log
@SVN rev 222794 on 2011-06-06 22:26:02Z by np

MFC r222509, r222510, r222513, r222551, r222552, r222701, r222703,
and some direct modifications to minimize diffs with head.

r222509:
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).

r222510:
- 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.

r222513:
Update to firmware interface 1.3.10

r222551:
Firmware device log.

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

r222701:
Allow lazy fill up of freelists.

r222703:
Cause backpressure (instead of dropping frames) on congestion.
@
text
@d9 1
a9 1
SRCS = t4_main.c t4_sge.c t4_l2t.c
@


1.1.2.5
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242909
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242909 | dim | 2012-11-12 07:47:19 +0000 (Mon, 12 Nov 2012) | 20 lines
## SVN ##
## SVN ## MFC r242625:
## SVN ##
## SVN ## Remove duplicate const specifiers in many drivers (I hope I got all of
## SVN ## them, please let me know if not).  Most of these are of the form:
## SVN ##
## SVN ## static const struct bzzt_type {
## SVN ##       [...list of members...]
## SVN ## } const bzzt_devs[] = {
## SVN ##       [...list of initializers...]
## SVN ## };
## SVN ##
## SVN ## The second const is unnecessary, as arrays cannot be modified anyway,
## SVN ## and if the elements are const, the whole thing is const automatically
## SVN ## (e.g. it is placed in .rodata).
## SVN ##
## SVN ## I have verified this does not change the binary output of a full kernel
## SVN ## build (except for build timestamps embedded in the object files).
## SVN ##
## SVN ## Reviewed by:	yongari, marius
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d2 1
a2 1
# $FreeBSD: stable/8/sys/modules/cxgbe/if_cxgbe/Makefile 222794 2011-06-06 22:26:02Z np $
@


1.1.2.6
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/247670
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d2 1
a2 1
# $FreeBSD: stable/8/sys/modules/cxgbe/if_cxgbe/Makefile 247670 2013-03-02 21:59:07Z np $
a4 2
.include <bsd.own.mk>

d12 1
a12 1
SRCS+= opt_inet.h opt_inet6.h
a18 13
.if !defined(KERNBUILDDIR)
.if ${MK_INET_SUPPORT} != "no"
opt_inet.h:
	@@echo "#define INET 1" > ${.TARGET}
	@@echo "#define TCP_OFFLOAD 1" >> ${.TARGET}
.endif

.if ${MK_INET6_SUPPORT} != "no"
opt_inet6.h:
	@@echo "#define INET6 1" > ${.TARGET}
.endif
.endif

@


1.1.2.4.2.1
log
@SVN rev 232438 on 2012-03-03 06:15:13Z by kensmith

Copy stable/8 to releng/8.3 as part of 8.3-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.1.2.4.2.2
log
@Switch importer
@
text
@d2 1
a2 1
# $FreeBSD: releng/8.3/sys/modules/cxgbe/if_cxgbe/Makefile 222794 2011-06-06 22:26:02Z np $
@


