Jakub Kicinski 6a35ddc544 nfp: tls: implement the stream sync RX resync
The simple RX resync strategy controlled by the kernel does not
guarantee as good results as if the device helps by detecting
the potential record boundaries and keeping track of them.

We've called this strategy stream scan in the tls-offload doc.

Implement this strategy for the NFP. The device sends a request
for record boundary confirmation, which is then recorded in
per-TLS socket state and responded to once record is reached.
Because the device keeps track of records passing after the
request was sent the response is not as latency sensitive as
when kernel just tries to tell the device the information
about the next record.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-12-19 17:46:51 -08:00

43 lines
886 B
C

/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
/* Copyright (C) 2019 Netronome Systems, Inc. */
#ifndef NFP_CRYPTO_H
#define NFP_CRYPTO_H 1
struct net_device;
struct nfp_net;
struct nfp_net_tls_resync_req;
struct nfp_net_tls_offload_ctx {
__be32 fw_handle[2];
u8 rx_end[0];
/* Tx only fields follow - Rx side does not have enough driver state
* to fit these
*/
u32 next_seq;
};
#ifdef CONFIG_TLS_DEVICE
int nfp_net_tls_init(struct nfp_net *nn);
int nfp_net_tls_rx_resync_req(struct net_device *netdev,
struct nfp_net_tls_resync_req *req,
void *pkt, unsigned int pkt_len);
#else
static inline int nfp_net_tls_init(struct nfp_net *nn)
{
return 0;
}
static inline int
nfp_net_tls_rx_resync_req(struct net_device *netdev,
struct nfp_net_tls_resync_req *req,
void *pkt, unsigned int pkt_len)
{
return -EOPNOTSUPP;
}
#endif
#endif