From owner-svn-src-head@freebsd.org Wed Mar 14 20:46:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3FF9F46409; Wed, 14 Mar 2018 20:46:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 761D275FED; Wed, 14 Mar 2018 20:46:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6CDA24D31; Wed, 14 Mar 2018 20:46:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2EKkQ98069660; Wed, 14 Mar 2018 20:46:26 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2EKkQZ0069657; Wed, 14 Mar 2018 20:46:26 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201803142046.w2EKkQZ0069657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 14 Mar 2018 20:46:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330946 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 330946 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 20:46:27 -0000 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);