svn commit: r330946 - head/sys/dev/cxgbe/tom

John Baldwin jhb at FreeBSD.org
Wed Mar 14 20:46:27 UTC 2018


Author: jhb
Date: Wed Mar 14 20:46:25 2018
New Revision: 330946
URL: https://svnweb.freebsd.org/changeset/base/330946

Log:
  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

Modified:
  head/sys/dev/cxgbe/tom/t4_cpl_io.c
  head/sys/dev/cxgbe/tom/t4_tls.c
  head/sys/dev/cxgbe/tom/t4_tom.h

Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c
==============================================================================
--- head/sys/dev/cxgbe/tom/t4_cpl_io.c	Wed Mar 14 20:07:52 2018	(r330945)
+++ head/sys/dev/cxgbe/tom/t4_cpl_io.c	Wed Mar 14 20:46:25 2018	(r330946)
@@ -2357,7 +2357,7 @@ t4_aio_queue_aiotx(struct socket *so, struct kaiocb *j
 	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);

Modified: head/sys/dev/cxgbe/tom/t4_tls.c
==============================================================================
--- head/sys/dev/cxgbe/tom/t4_tls.c	Wed Mar 14 20:07:52 2018	(r330945)
+++ head/sys/dev/cxgbe/tom/t4_tls.c	Wed Mar 14 20:46:25 2018	(r330946)
@@ -73,6 +73,13 @@ t4_set_tls_tcb_field(struct toepcb *toep, uint16_t wor
 }
 
 /* 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)
 {

Modified: head/sys/dev/cxgbe/tom/t4_tom.h
==============================================================================
--- head/sys/dev/cxgbe/tom/t4_tom.h	Wed Mar 14 20:07:52 2018	(r330945)
+++ head/sys/dev/cxgbe/tom/t4_tom.h	Wed Mar 14 20:46:25 2018	(r330946)
@@ -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 
 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);


More information about the svn-src-all mailing list