app/eventdev: add ethernet device setup helpers
[dpdk.git] / drivers / crypto / dpaa_sec / dpaa_sec.c
index d1ef241..61dc39b 100644 (file)
@@ -1,34 +1,8 @@
-/*-
- *   BSD LICENSE
+/* SPDX-License-Identifier: BSD-3-Clause
  *
  *   Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved.
- *   Copyright 2017 NXP.
+ *   Copyright 2017 NXP
  *
- *   Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions
- *   are met:
- *
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in
- *       the documentation and/or other materials provided with the
- *       distribution.
- *     * Neither the name of NXP nor the names of its
- *       contributors may be used to endorse or promote products derived
- *       from this software without specific prior written permission.
- *
- *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #include <fcntl.h>
@@ -121,7 +95,7 @@ dpaa_mem_vtop(void *vaddr)
        for (i = 0; i < RTE_MAX_MEMSEG && memseg[i].addr_64 != 0; i++) {
                if (vaddr_64 >= memseg[i].addr_64 &&
                    vaddr_64 < memseg[i].addr_64 + memseg[i].len) {
-                       paddr = memseg[i].phys_addr +
+                       paddr = memseg[i].iova +
                                (vaddr_64 - memseg[i].addr_64);
 
                        return (rte_iova_t)paddr;
@@ -137,10 +111,10 @@ dpaa_mem_ptov(rte_iova_t paddr)
        int i;
 
        for (i = 0; i < RTE_MAX_MEMSEG && memseg[i].addr_64 != 0; i++) {
-               if (paddr >= memseg[i].phys_addr &&
-                   (char *)paddr < (char *)memseg[i].phys_addr + memseg[i].len)
+               if (paddr >= memseg[i].iova &&
+                   (char *)paddr < (char *)memseg[i].iova + memseg[i].len)
                        return (void *)(memseg[i].addr_64 +
-                                       (paddr - memseg[i].phys_addr));
+                                       (paddr - memseg[i].iova));
        }
        return NULL;
 }
@@ -686,10 +660,10 @@ build_cipher_auth_gcm(struct rte_crypto_op *op, dpaa_sec_session *ses)
        uint8_t *IV_ptr = rte_crypto_op_ctod_offset(op, uint8_t *,
                        ses->iv.offset);
 
-       src_start_addr = sym->m_src->buf_physaddr + sym->m_src->data_off;
+       src_start_addr = sym->m_src->buf_iova + sym->m_src->data_off;
 
        if (sym->m_dst)
-               dst_start_addr = sym->m_dst->buf_physaddr + sym->m_dst->data_off;
+               dst_start_addr = sym->m_dst->buf_iova + sym->m_dst->data_off;
        else
                dst_start_addr = src_start_addr;