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);
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to