event/dpaa2: replace static with dynamic logging
[dpdk.git] / drivers / net / enic / enic_main.c
index 7932605..9bbe054 100644 (file)
@@ -1,35 +1,6 @@
-/*
- * Copyright 2008-2014 Cisco Systems, Inc.  All rights reserved.
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright 2008-2017 Cisco Systems, Inc.  All rights reserved.
  * Copyright 2007 Nuova Systems, Inc.  All rights reserved.
- *
- * Copyright (c) 2014, Cisco Systems, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. 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.
- *
- * 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 HOLDER 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 <stdio.h>
@@ -40,6 +11,7 @@
 #include <libgen.h>
 
 #include <rte_pci.h>
+#include <rte_bus_pci.h>
 #include <rte_memzone.h>
 #include <rte_malloc.h>
 #include <rte_mbuf.h>
@@ -97,11 +69,6 @@ enic_rxmbuf_queue_release(__rte_unused struct enic *enic, struct vnic_rq *rq)
        }
 }
 
-void enic_set_hdr_split_size(struct enic *enic, u16 split_hdr_size)
-{
-       vnic_set_hdr_split_size(enic->vdev, split_hdr_size);
-}
-
 static void enic_free_wq_buf(struct vnic_wq_buf *buf)
 {
        struct rte_mbuf *mbuf = (struct rte_mbuf *)buf->mb;
@@ -282,7 +249,7 @@ void enic_init_vnic_resources(struct enic *enic)
                        0 /* cq_entry_enable */,
                        1 /* cq_message_enable */,
                        0 /* interrupt offset */,
-                       (u64)enic->wq[index].cqmsg_rz->phys_addr);
+                       (u64)enic->wq[index].cqmsg_rz->iova);
        }
 
        vnic_intr_init(&enic->intr,
@@ -315,7 +282,7 @@ enic_alloc_rx_queue_mbufs(struct enic *enic, struct vnic_rq *rq)
                }
 
                mb->data_off = RTE_PKTMBUF_HEADROOM;
-               dma_addr = (dma_addr_t)(mb->buf_physaddr
+               dma_addr = (dma_addr_t)(mb->buf_iova
                           + RTE_PKTMBUF_HEADROOM);
                rq_enet_desc_enc(rqd, dma_addr,
                                (rq->is_sop ? RQ_ENET_TYPE_ONLY_SOP
@@ -361,7 +328,7 @@ enic_alloc_consistent(void *priv, size_t size,
        }
 
        vaddr = rz->addr;
-       *dma_handle = (dma_addr_t)rz->phys_addr;
+       *dma_handle = (dma_addr_t)rz->iova;
 
        mze = rte_malloc("enic memzone entry",
                         sizeof(struct enic_memzone_entry), 0);
@@ -394,7 +361,7 @@ enic_free_consistent(void *priv,
        rte_spinlock_lock(&enic->memzone_list_lock);
        LIST_FOREACH(mze, &enic->memzone_list, entries) {
                if (mze->rz->addr == vaddr &&
-                   mze->rz->phys_addr == dma_handle)
+                   mze->rz->iova == dma_handle)
                        break;
        }
        if (mze == NULL) {
@@ -433,7 +400,7 @@ enic_intr_handler(void *arg)
        vnic_intr_return_all_credits(&enic->intr);
 
        enic_link_update(enic);
-       _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL, NULL);
+       _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
        enic_log_q_error(enic);
 }
 
@@ -633,7 +600,8 @@ int enic_alloc_rq(struct enic *enic, uint16_t queue_idx,
        mbuf_size = (uint16_t)(rte_pktmbuf_data_room_size(mp) -
                               RTE_PKTMBUF_HEADROOM);
 
-       if (enic->rte_dev->data->dev_conf.rxmode.enable_scatter) {
+       if (enic->rte_dev->data->dev_conf.rxmode.offloads &
+           DEV_RX_OFFLOAD_SCATTER) {
                dev_info(enic, "Rq %u Scatter rx mode enabled\n", queue_idx);
                /* ceil((mtu + ETHER_HDR_LEN + 4)/mbuf_size) */
                mbufs_per_pkt = ((mtu + ETHER_HDR_LEN + 4) +
@@ -1207,7 +1175,8 @@ int enic_set_mtu(struct enic *enic, uint16_t new_mtu)
        /* The easy case is when scatter is disabled. However if the MTU
         * becomes greater than the mbuf data size, packet drops will ensue.
         */
-       if (!enic->rte_dev->data->dev_conf.rxmode.enable_scatter) {
+       if (!(enic->rte_dev->data->dev_conf.rxmode.offloads &
+             DEV_RX_OFFLOAD_SCATTER)) {
                eth_dev->data->mtu = new_mtu;
                goto set_mtu_done;
        }