Print this page
5253 kmem_alloc/kmem_zalloc won't fail with KM_SLEEP
5254 getrbuf won't fail with KM_SLEEP

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/crypto/io/dca.c
          +++ new/usr/src/uts/common/crypto/io/dca.c
↓ open down ↓ 1671 lines elided ↑ open up ↑
1672 1672           * for driver hardening, allocate in whole pages.
1673 1673           */
1674 1674          size = ROUNDUP(MAXPACKET, dca->dca_pagesize);
1675 1675  #if defined(i386) || defined(__i386)
1676 1676          /*
1677 1677           * Use kmem_alloc instead of ddi_dma_mem_alloc here since the latter
1678 1678           * may fail on x86 platform if a physically contiguous memory chunk
1679 1679           * cannot be found. From initial testing, we did not see performance
1680 1680           * degradation as seen on Sparc.
1681 1681           */
1682      -        if ((reqp->dr_ibuf_kaddr = kmem_alloc(size, KM_SLEEP)) == NULL) {
1683      -                dca_error(dca, "unable to alloc request ibuf memory");
1684      -                dca_destroyreq(reqp);
1685      -                return (NULL);
1686      -        }
1687      -        if ((reqp->dr_obuf_kaddr = kmem_alloc(size, KM_SLEEP)) == NULL) {
1688      -                dca_error(dca, "unable to alloc request obuf memory");
1689      -                dca_destroyreq(reqp);
1690      -                return (NULL);
1691      -        }
     1682 +        reqp->dr_ibuf_kaddr = kmem_alloc(size, KM_SLEEP);
     1683 +        reqp->dr_obuf_kaddr = kmem_alloc(size, KM_SLEEP);
1692 1684  #else
1693 1685          /*
1694 1686           * We could kmem_alloc for Sparc too. However, it gives worse
1695 1687           * performance when transferring more than one page data. For example,
1696 1688           * using 4 threads and 12032 byte data and 3DES on 900MHZ Sparc system,
1697 1689           * kmem_alloc uses 80% CPU and ddi_dma_mem_alloc uses 50% CPU for
1698 1690           * the same throughput.
1699 1691           */
1700 1692          rv = ddi_dma_mem_alloc(reqp->dr_ibuf_dmah,
1701 1693              size, &dca_bufattr,
↓ open down ↓ 3330 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX