Remove TLS-related inlines from t4_tom.h to fix iw_cxgbe(4) build.

- Remove the one use of is_tls_offload() and the function.  AIO special
  handling only needs to be disabled when a TOE socket is actively doing
  TLS offload on transmit.  The TOE socket's mode (which affects receive
  operation) doesn't matter, so remove the check for the socket's mode and
  only check if a TOE socket has TLS transmit keys configured to determine
  if an AIO write request should fall back to the normal socket handling
  instead of the TOE fast path.
- Move can_tls_offload() into t4_tls.c.  It is not used in critical paths,
  so inlining isn't that important.  Change return type to bool while here.

Sponsored by:	Chelsio Communications
This commit is contained in:
John Baldwin 2018-03-14 20:46:25 +00:00
parent 2026d70da4
commit 02d2bcfaba
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=330946
3 changed files with 9 additions and 13 deletions

View File

@ -2357,7 +2357,7 @@ t4_aio_queue_aiotx(struct socket *so, struct kaiocb *job)
if (!sc->tt.tx_zcopy)
return (EOPNOTSUPP);
if (is_tls_offload(toep) || tls_tx_key(toep))
if (tls_tx_key(toep))
return (EOPNOTSUPP);
SOCKBUF_LOCK(&so->so_snd);

View File

@ -73,6 +73,13 @@ t4_set_tls_tcb_field(struct toepcb *toep, uint16_t word, uint64_t mask,
}
/* TLS and DTLS common routines */
bool
can_tls_offload(struct adapter *sc)
{
return (sc->tt.tls && sc->cryptocaps & FW_CAPS_CONFIG_TLSKEYS);
}
int
tls_tx_key(struct toepcb *toep)
{

View File

@ -321,18 +321,6 @@ mbuf_ulp_submode(struct mbuf *m)
return (m->m_pkthdr.PH_per.eight[0]);
}
static inline int
is_tls_offload(struct toepcb *toep)
{
return (toep->ulp_mode == ULP_MODE_TLS);
}
static inline int
can_tls_offload(struct adapter *sc)
{
return (sc->tt.tls && sc->cryptocaps & FW_CAPS_CONFIG_TLSKEYS);
}
/* t4_tom.c */
struct toepcb *alloc_toepcb(struct vi_info *, int, int, int);
struct toepcb *hold_toepcb(struct toepcb *);
@ -430,6 +418,7 @@ void handle_ddp_tcb_rpl(struct toepcb *, const struct cpl_set_tcb_rpl *);
void insert_ddp_data(struct toepcb *, uint32_t);
/* t4_tls.c */
bool can_tls_offload(struct adapter *);
int t4_ctloutput_tls(struct socket *, struct sockopt *);
void t4_push_tls_records(struct adapter *, struct toepcb *, int);
void t4_tls_mod_load(void);