freebsd-dev/sys/dev/cxgbe
John Baldwin 9c0e3d3a53 Add support for optional separate output buffers to in-kernel crypto.
Some crypto consumers such as GELI and KTLS for file-backed sendfile
need to store their output in a separate buffer from the input.
Currently these consumers copy the contents of the input buffer into
the output buffer and queue an in-place crypto operation on the output
buffer.  Using a separate output buffer avoids this copy.

- Create a new 'struct crypto_buffer' describing a crypto buffer
  containing a type and type-specific fields.  crp_ilen is gone,
  instead buffers that use a flat kernel buffer have a cb_buf_len
  field for their length.  The length of other buffer types is
  inferred from the backing store (e.g. uio_resid for a uio).
  Requests now have two such structures: crp_buf for the input buffer,
  and crp_obuf for the output buffer.

- Consumers now use helper functions (crypto_use_*,
  e.g. crypto_use_mbuf()) to configure the input buffer.  If an output
  buffer is not configured, the request still modifies the input
  buffer in-place.  A consumer uses a second set of helper functions
  (crypto_use_output_*) to configure an output buffer.

- Consumers must request support for separate output buffers when
  creating a crypto session via the CSP_F_SEPARATE_OUTPUT flag and are
  only permitted to queue a request with a separate output buffer on
  sessions with this flag set.  Existing drivers already reject
  sessions with unknown flags, so this permits drivers to be modified
  to support this extension without requiring all drivers to change.

- Several data-related functions now have matching versions that
  operate on an explicit buffer (e.g. crypto_apply_buf,
  crypto_contiguous_subsegment_buf, bus_dma_load_crp_buf).

- Most of the existing data-related functions operate on the input
  buffer.  However crypto_copyback always writes to the output buffer
  if a request uses a separate output buffer.

- For the regions in input/output buffers, the following conventions
  are followed:
  - AAD and IV are always present in input only and their
    fields are offsets into the input buffer.
  - payload is always present in both buffers.  If a request uses a
    separate output buffer, it must set a new crp_payload_start_output
    field to the offset of the payload in the output buffer.
  - digest is in the input buffer for verify operations, and in the
    output buffer for compute operations.  crp_digest_start is relative
    to the appropriate buffer.

- Add a crypto buffer cursor abstraction.  This is a more general form
  of some bits in the cryptosoft driver that tried to always use uio's.
  However, compared to the original code, this avoids rewalking the uio
  iovec array for requests with multiple vectors.  It also avoids
  allocate an iovec array for mbufs and populating it by instead walking
  the mbuf chain directly.

- Update the cryptosoft(4) driver to support separate output buffers
  making use of the cursor abstraction.

Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D24545
2020-05-25 22:12:04 +00:00
..
common cxgbe(4): Congestion drops are maintained per E-channel and not per 2020-02-19 00:48:58 +00:00
crypto Add support for optional separate output buffers to in-kernel crypto. 2020-05-25 22:12:04 +00:00
cudbg
cxgbei Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
firmware cxgbe(4): Update T4/5/6 firmwares to 1.24.12.0. 2020-02-12 02:55:06 +00:00
iw_cxgbe cxgbe/iw_cxgbe: Add an async callback to notify iw_cxgbe in case of a 2020-05-19 16:28:20 +00:00
tom Mechanically rename MBUF_EXT_PGS_ASSERT() to M_ASSERTEXTPG() to match 2020-05-03 00:27:41 +00:00
adapter.h cxgbe/iw_cxgbe: Add an async callback to notify iw_cxgbe in case of a 2020-05-19 16:28:20 +00:00
if_cc.c
if_ccv.c
if_cxl.c
if_cxlv.c
offload.h cxgbe/iw_cxgbe: Add an async callback to notify iw_cxgbe in case of a 2020-05-19 16:28:20 +00:00
osdep.h cxgbe(4): Add adapter information to messages logged by the OS-agnostic 2019-01-29 00:49:12 +00:00
t4_clip.c cxgbe(4): Do not display error messages related to the CLIP table if 2020-03-13 00:12:15 +00:00
t4_clip.h Move CLIP table handling out of TOM and into the base driver. 2018-11-29 01:15:53 +00:00
t4_filter.c Always allocate the atid table during attach. 2019-10-22 20:01:47 +00:00
t4_if.m
t4_ioctl.h
t4_iov.c cxgbev(4): Catch up with the pciids in the PF driver. 2019-11-15 18:48:14 +00:00
t4_l2t.c NIC KTLS for Chelsio T6 adapters. 2019-11-21 19:30:31 +00:00
t4_l2t.h NIC KTLS for Chelsio T6 adapters. 2019-11-21 19:30:31 +00:00
t4_main.c cxgbe/iw_cxgbe: Add an async callback to notify iw_cxgbe in case of a 2020-05-19 16:28:20 +00:00
t4_mp_ring.c
t4_mp_ring.h
t4_netmap.c cxgbe(4): Split sge_nm_rxq into three cachelines. 2020-03-20 05:12:16 +00:00
t4_sched.c cxgbe(4): Use the _XT variant of the CPL used to transmit NIC traffic. 2019-12-13 20:38:58 +00:00
t4_sge.c Mechanically rename MBUF_EXT_PGS_ASSERT() to M_ASSERTEXTPG() to match 2020-05-03 00:27:41 +00:00
t4_smt.c
t4_smt.h
t4_tracer.c
t4_vf.c cxgbev(4): Catch up with the pciids in the PF driver. 2019-11-15 18:48:14 +00:00