]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r317849 (partial), r332506, and r332787.
authornp <np@FreeBSD.org>
Sun, 28 Apr 2019 06:51:59 +0000 (06:51 +0000)
committernp <np@FreeBSD.org>
Sun, 28 Apr 2019 06:51:59 +0000 (06:51 +0000)
commitf7fea736816d445223980777e62b261681765fd5
tree4fedb0f569c13d156bcc7b42fe5a0e4c237723fa
parent699547e8bcca997d7238d523797e25854d6ee86a
MFC r317849 (partial), r332506, and r332787.

r317849 (partial, required by r332506):
cxgbe/t4_tom: Per-connection rate limiting for TCP sockets handled by
the TOE.

Sponsored by: Chelsio Communications

r332506:
cxgbe(4): Add support for Connection Offload Policy (aka COP).

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 => settings

Example.  See cxgbetool(8) for more information.
[L] ip && port http => offload
[L] port 443 => !offload
[L] port ssh => offload
[P] src net 192.168/16 && dst port ssh => offload !nagle !timestamp cong newreno
[P] dst port ssh => offload !nagle ecn cong tahoe
[P] dst port http => offload
[A] dst port 443 => offload tls
[A] dst net 192.168/16 => 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 => !offload

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

Sponsored by: Chelsio Communications

r332787:
cxgbe(4): Fix bugs in the handling of COP rules that match on VLAN tag.

Retrieve the tag from the correct ifnet and use the provided tag
(instead of hardcoded 0xffff, implying no tag) in the routines that
process offload policy.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Sponsored by: Chelsio Communications
13 files changed:
sys/dev/cxgbe/adapter.h
sys/dev/cxgbe/offload.h
sys/dev/cxgbe/t4_ioctl.h
sys/dev/cxgbe/t4_main.c
sys/dev/cxgbe/t4_sge.c
sys/dev/cxgbe/tom/t4_connect.c
sys/dev/cxgbe/tom/t4_cpl_io.c
sys/dev/cxgbe/tom/t4_listen.c
sys/dev/cxgbe/tom/t4_tom.c
sys/dev/cxgbe/tom/t4_tom.h
usr.sbin/cxgbetool/Makefile
usr.sbin/cxgbetool/cxgbetool.8
usr.sbin/cxgbetool/cxgbetool.c