<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/cxgbe/offload.h, branch releng/12.2</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=releng%2F12.2</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=releng%2F12.2'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2018-08-15T03:03:01Z</updated>
<entry>
<title>cxgbe(4): Use two hashes instead of a table to keep track of</title>
<updated>2018-08-15T03:03:01Z</updated>
<author>
<name>Navdeep Parhar</name>
<email>np@FreeBSD.org</email>
</author>
<published>2018-08-15T03:03:01Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=51347c3ff1e796e7b57e98c547b516ac497c8369'/>
<id>urn:sha1:51347c3ff1e796e7b57e98c547b516ac497c8369</id>
<content type='text'>
hashfilters.  Two because the driver needs to look up a hashfilter by
its 4-tuple or tid.

A couple of fixes while here:
- Reject attempts to add duplicate hashfilters.
- Do not assume that any part of the 4-tuple that isn't specified is 0.
  This makes it consistent with all other mandatory parameters that
  already require explicit user input.

MFC after:	2 weeks
Sponsored by:	Chelsio Communications
</content>
</entry>
<entry>
<title>cxgbe(4): Add support for high priority filters on T6+.  They have their</title>
<updated>2018-08-09T14:19:47Z</updated>
<author>
<name>Navdeep Parhar</name>
<email>np@FreeBSD.org</email>
</author>
<published>2018-08-09T14:19:47Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=5fc0f72f3b75dbb515ad8eb63e7c60d78762007d'/>
<id>urn:sha1:5fc0f72f3b75dbb515ad8eb63e7c60d78762007d</id>
<content type='text'>
own region in the TCAM starting with T6, unlike previous chips where
they were in the same region as normal filters.

These filters "hit" before anything else in the LE's lookup.  The exact
order is:
a) High priority filters
b) TOE's active region (TCAM and/or hash)
c) Servers (TOE hw listeners)
d) Normal filters

MFC after:	1 week
Sponsored by:	Chelsio Communications
</content>
</entry>
<entry>
<title>cxgbe(4): Improvements in TID management.</title>
<updated>2018-08-02T22:52:05Z</updated>
<author>
<name>Navdeep Parhar</name>
<email>np@FreeBSD.org</email>
</author>
<published>2018-08-02T22:52:05Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=0c71c9ccb2199f2cee334cf8f4468bc0b71db433'/>
<id>urn:sha1:0c71c9ccb2199f2cee334cf8f4468bc0b71db433</id>
<content type='text'>
- Ignore any type of TID where the start/end values are not in the
  correct order.  There are situations where the firmware isn't able to
  reserve room for the number requested in the config file but doesn't
  report a failure during configuration and instead sets end &lt;= start.

- Track start/end in tid_tab and remove some redundant copies from
  adapter-&gt;params.

- Move all the start/end and other read-only parameters to a quiet part
  of tid_tab, away from the tid locks.

MFC after:	1 week
Sponsored by:	Chelsio Communications
</content>
</entry>
<entry>
<title>cxgbe(4): Data path for rate-limited tx.</title>
<updated>2018-05-24T10:18:14Z</updated>
<author>
<name>Navdeep Parhar</name>
<email>np@FreeBSD.org</email>
</author>
<published>2018-05-24T10:18:14Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=786099de5e3984cec4b54c677c74f3c639bfcf83'/>
<id>urn:sha1:786099de5e3984cec4b54c677c74f3c639bfcf83</id>
<content type='text'>
This is hardware support for the SO_MAX_PACING_RATE sockopt (see
setsockopt(2)), which is available in kernels built with "options
RATELIMIT".

Relnotes:	Yes
Sponsored by:	Chelsio Communications
</content>
</entry>
<entry>
<title>cxgbe(4): Implement ifnet callbacks that deal with send tags.</title>
<updated>2018-05-18T06:09:15Z</updated>
<author>
<name>Navdeep Parhar</name>
<email>np@FreeBSD.org</email>
</author>
<published>2018-05-18T06:09:15Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=67e071128d63c3bb0b103e155b65342d4418ecb5'/>
<id>urn:sha1:67e071128d63c3bb0b103e155b65342d4418ecb5</id>
<content type='text'>
An etid (ethoffload tid) is allocated for a send tag and it acquires a
reference on the traffic class that matches the send parameters
associated with the tag.

Sponsored by:	Chelsio Communications
</content>
</entry>
<entry>
<title>cxgbe(4): Add support for hash filters.</title>
<updated>2018-05-09T04:09:49Z</updated>
<author>
<name>Navdeep Parhar</name>
<email>np@FreeBSD.org</email>
</author>
<published>2018-05-09T04:09:49Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=89f651e7049249ee3d41f5b3df8c4a10942c6896'/>
<id>urn:sha1:89f651e7049249ee3d41f5b3df8c4a10942c6896</id>
<content type='text'>
These filters reside in the card's memory instead of its TCAM and can be
configured via a new "hashfilter" subcommand in cxgbetool.  Hash and
normal TCAM filters can be used together.  The hardware does an
exact-match of packet fields for hash filters, unlike the masked match
performed for TCAM filters.  Any T5/T6 card with memory can support at
least half a million hash filters.  The sample config file with the
driver configures 512K of these, it is possible to double this to 1
million+ in some cases.

The chip does an exact-match of fields of incoming datagrams with hash
filters and performs the action configured for the filter if it matches.
The fields to match are specified in a "filter mask" in the firmware
config file.  The filter mask always includes the 5-tuple (sip, dip,
sport, dport, ipproto).  It can, optionally, also include any subset of
the filter mode (see filterMode and filterMask in the firmware config
file).

For example:
filterMode = fragmentation, mpshittype, protocol, vlan, port, fcoe
filterMask = protocol, port, vlan

Exact values of the 5-tuple, the physical port, and VLAN tag would have
to be provided while setting up a hash filter with the chip
configuration above.

Hash filters support all actions supported by TCAM filters.  A packet
that hits a hash filter can be dropped, let through (with optional
steering to a specific queue or RSS region), switched out of another
port (with optional L2 rewrite of DMAC, SMAC, VLAN tag), or get NAT'ed.
(Support for some of these will show up in the driver in a follow-up
commit very shortly).

Sponsored by:	Chelsio Communications
</content>
</entry>
<entry>
<title>cxgbe(4): Convert ACT_OPEN_RPL to a shared CPL.</title>
<updated>2018-04-30T21:47:30Z</updated>
<author>
<name>Navdeep Parhar</name>
<email>np@FreeBSD.org</email>
</author>
<published>2018-04-30T21:47:30Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=111638bf6896d5100ace4d14c1ff45eaaec164d0'/>
<id>urn:sha1:111638bf6896d5100ace4d14c1ff45eaaec164d0</id>
<content type='text'>
Reserve 3b in the 14b atid to identify the owner and use it to dispatch
the CPL.  This allows all CPLs that use an atid to be used as shared
CPLs, although ACT_OPEN_RPL is the only one being converted in this
revision.

Sponsored by:	Chelsio Communications
</content>
</entry>
<entry>
<title>cxgbe(4): Add support for Connection Offload Policy (aka COP).</title>
<updated>2018-04-14T19:07:56Z</updated>
<author>
<name>Navdeep Parhar</name>
<email>np@FreeBSD.org</email>
</author>
<published>2018-04-14T19:07:56Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=1131c927c4c388c75c728d443cab7ff0482a1c50'/>
<id>urn:sha1:1131c927c4c388c75c728d443cab7ff0482a1c50</id>
<content type='text'>
COP allows fine-grained control on whether to offload a TCP connection
using t4_tom, and what settings to apply to a connection selected for
offload.  t4_tom must still be loaded and IFCAP_TOE must still be
enabled for full TCP offload to take place on an interface.  The
difference is that IFCAP_TOE used to be the only knob and would enable
TOE for all new connections on the inteface, but now the driver will
also consult the COP, if any, before offloading to the hardware TOE.

A policy is a plain text file with any number of rules, one per line.
Each rule has a "match" part consisting of a socket-type (L = listen,
A = active open, P = passive open, D = don't care) and a pcap-filter(7)
expression, and a "settings" part that specifies whether to offload the
connection or not and the parameters to use if so.  The general format
of a rule is: [socket-type] expr =&gt; settings

Example.  See cxgbetool(8) for more information.
[L] ip &amp;&amp; port http =&gt; offload
[L] port 443 =&gt; !offload
[L] port ssh =&gt; offload
[P] src net 192.168/16 &amp;&amp; dst port ssh =&gt; offload !nagle !timestamp cong newreno
[P] dst port ssh =&gt; offload !nagle ecn cong tahoe
[P] dst port http =&gt; offload
[A] dst port 443 =&gt; offload tls
[A] dst net 192.168/16 =&gt; offload !timestamp cong highspeed

The driver processes the rules for each new listen, active open, or
passive open and stops at the first match.  There is an implicit rule at
the end of every policy that prohibits offload when no rule in the
policy matches:
[D] all =&gt; !offload

This is a reworked and expanded version of a patch submitted by
Krishnamraju Eraparaju @ Chelsio.

Sponsored by:	Chelsio Communications
</content>
</entry>
<entry>
<title>Support for TLS offload of TOE connections on T6 adapters.</title>
<updated>2018-03-13T23:05:51Z</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2018-03-13T23:05:51Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=1e9538d253d62ee18f9f9337047d8e8045e5ec1b'/>
<id>urn:sha1:1e9538d253d62ee18f9f9337047d8e8045e5ec1b</id>
<content type='text'>
The TOE engine in Chelsio T6 adapters supports offloading of TLS
encryption and TCP segmentation for offloaded connections.  Sockets
using TLS are required to use a set of custom socket options to upload
RX and TX keys to the NIC and to enable RX processing.  Currently
these socket options are implemented as TCP options in the vendor
specific range.  A patched OpenSSL library will be made available in a
port / package for use with the TLS TOE support.

TOE sockets can either offload both transmit and reception of TLS
records or just transmit.  TLS offload (both RX and TX) is enabled by
setting the dev.t6nex.&lt;x&gt;.tls sysctl to 1 and requires TOE to be
enabled on the relevant interface.  Transmit offload can be used on
any "normal" or TLS TOE socket by using the custom socket option to
program a transmit key.  This permits most TOE sockets to
transparently offload TLS when applications use a patched SSL library
(e.g. using LD_LIBRARY_PATH to request use of a patched OpenSSL
library).  Receive offload can only be used with TOE sockets using the
TLS mode.  The dev.t6nex.0.toe.tls_rx_ports sysctl can be set to a
list of TCP port numbers.  Any connection with either a local or
remote port number in that list will be created as a TLS socket rather
than a plain TOE socket.  Note that although this sysctl accepts an
arbitrary list of port numbers, the sysctl(8) tool is only able to set
sysctl nodes to a single value.  A TLS socket will hang without
receiving data if used by an application that is not using a patched
SSL library.  Thus, the tls_rx_ports node should be used with care.
For a server mostly concerned with offloading TLS transmit, this node
is not needed as plain TOE sockets will fall back to software crypto
when using an unpatched SSL library.

New per-interface statistics nodes are added giving counts of TLS
packets and payload bytes (payload bytes do not include TLS headers or
authentication tags/MACs) offloaded via the TOE engine, e.g.:

dev.cc.0.stats.rx_tls_octets: 149
dev.cc.0.stats.rx_tls_records: 13
dev.cc.0.stats.tx_tls_octets: 26501823
dev.cc.0.stats.tx_tls_records: 1620

TLS transmit work requests are constructed by a new variant of
t4_push_frames() called t4_push_tls_records() in tom/t4_tls.c.

TLS transmit work requests require a buffer containing IVs.  If the
IVs are too large to fit into the work request, a separate buffer is
allocated when constructing a work request.  This buffer is associated
with the transmit descriptor and freed when the descriptor is ACKed by
the adapter.

Received TLS frames use two new CPL messages.  The first message is a
CPL_TLS_DATA containing the decryped payload of a single TLS record.
The handler places the mbuf containing the received payload on an
mbufq in the TOE pcb.  The second message is a CPL_RX_TLS_CMP message
which includes a copy of the TLS header and indicates if there were
any errors.  The handler for this message places the TLS header into
the socket buffer followed by the saved mbuf with the payload data.
Both of these handlers are contained in tom/t4_tls.c.

A few routines were exposed from t4_cpl_io.c for use by t4_tls.c
including send_rx_credits(), a new send_rx_modulate(), and
t4_close_conn().

TLS keys for both transmit and receive are stored in onboard memory
in the NIC in the "TLS keys" memory region.

In some cases a TLS socket can hang with pending data available in the
NIC that is not delivered to the host.  As a workaround, TLS sockets
are more aggressive about sending CPL_RX_DATA_ACK messages anytime that
any data is read from a TLS socket.  In addition, a fallback timer will
periodically send CPL_RX_DATA_ACK messages to the NIC for connections
that are still in the handshake phase.  Once the connection has
finished the handshake and programmed RX keys via the socket option,
the timer is stopped.

A new function select_ulp_mode() is used to determine what sub-mode a
given TOE socket should use (plain TOE, DDP, or TLS).  The existing
set_tcpddp_ulp_mode() function has been renamed to set_ulp_mode() and
handles initialization of TLS-specific state when necessary in
addition to DDP-specific state.

Since TLS sockets do not receive individual TCP segments but always
receive full TLS records, they can receive more data than is available
in the current window (e.g. if a 16k TLS record is received but the
socket buffer is itself 16k).  To cope with this, just drop the window
to 0 when this happens, but track the overage and "eat" the overage as
it is read from the socket buffer not opening the window (or adding
rx_credits) for the overage bytes.

Reviewed by:	np (earlier version)
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D14529
</content>
</entry>
<entry>
<title>Fetch TLS key parameters from the firmware.</title>
<updated>2018-02-26T21:56:06Z</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2018-02-26T21:56:06Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=198729ea7df0ededb29f6419e26a2e628897815b'/>
<id>urn:sha1:198729ea7df0ededb29f6419e26a2e628897815b</id>
<content type='text'>
The parameters describe how much of the adapter's memory is reserved for
storing TLS keys.  The 'meminfo' sysctl now lists this region of adapter
memory as 'TLS keys' if present.

Sponsored by:	Chelsio Communications
</content>
</entry>
</feed>
