Author: jhb
Date: Tue Jan 15 21:43:18 2019
New Revision: 343064
URL: https://svnweb.freebsd.org/changeset/base/343064

Log:
  MFC 340469: 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.

Modified:
  stable/12/sys/dev/cxgbe/tom/t4_tls.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/cxgbe/tom/t4_tls.c
==============================================================================
--- stable/12/sys/dev/cxgbe/tom/t4_tls.c        Tue Jan 15 21:40:51 2019        
(r343063)
+++ stable/12/sys/dev/cxgbe/tom/t4_tls.c        Tue Jan 15 21:43:18 2019        
(r343064)
@@ -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-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to