Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Nov 2018 23:31:04 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r340469 - head/sys/dev/cxgbe/tom
Message-ID:  <201811152331.wAFNV4pM073823@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Thu Nov 15 23:31:04 2018
New Revision: 340469
URL: https://svnweb.freebsd.org/changeset/base/340469

Log:
  Remove bogus roundup2() of the key programming work request header.
  
  The key context is always placed immediately after the work request
  header.  The total work request length has to be rounded up by 16
  however.
  
  MFC after:	1 month
  Sponsored by:	Chelsio Communications

Modified:
  head/sys/dev/cxgbe/tom/t4_tls.c

Modified: head/sys/dev/cxgbe/tom/t4_tls.c
==============================================================================
--- head/sys/dev/cxgbe/tom/t4_tls.c	Thu Nov 15 23:10:46 2018	(r340468)
+++ head/sys/dev/cxgbe/tom/t4_tls.c	Thu Nov 15 23:31:04 2018	(r340469)
@@ -492,9 +492,9 @@ tls_program_key_id(struct toepcb *toep, struct tls_key
 	struct tls_key_req *kwr;
 	struct tls_keyctx *kctx;
 
-	kwrlen = roundup2(sizeof(*kwr), 16);
+	kwrlen = sizeof(*kwr);
 	kctxlen = roundup2(sizeof(*kctx), 32);
-	len = kwrlen + kctxlen;
+	len = roundup2(kwrlen + kctxlen, 16);
 
 	if (toep->txsd_avail == 0)
 		return (EAGAIN);
@@ -536,7 +536,6 @@ tls_program_key_id(struct toepcb *toep, struct tls_key
 	kwr->sc_more = htobe32(V_ULPTX_CMD(ULP_TX_SC_IMM));
 	kwr->sc_len = htobe32(kctxlen);
 
-	/* XXX: This assumes that kwrlen == sizeof(*kwr). */
 	kctx = (struct tls_keyctx *)(kwr + 1);
 	memset(kctx, 0, kctxlen);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201811152331.wAFNV4pM073823>