net/bnxt: restore MAC filters during reset recovery
[dpdk.git] / drivers / net / mlx4 / mlx4_mr.c
index 48d458a..470cee0 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <rte_branch_prediction.h>
 #include <rte_common.h>
+#include <rte_eal_memconfig.h>
 #include <rte_errno.h>
 #include <rte_malloc.h>
 #include <rte_memory.h>
@@ -593,7 +594,6 @@ mlx4_mr_create_primary(struct rte_eth_dev *dev, struct mlx4_mr_cache *entry,
                       uintptr_t addr)
 {
        struct mlx4_priv *priv = dev->data->dev_private;
-       struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
        const struct rte_memseg_list *msl;
        const struct rte_memseg *ms;
        struct mlx4_mr *mr = NULL;
@@ -696,7 +696,7 @@ alloc_resources:
         * just single page. If not, go on with the big chunk atomically from
         * here.
         */
-       rte_rwlock_read_lock(&mcfg->memory_hotplug_lock);
+       rte_mcfg_mem_read_lock();
        data_re = data;
        if (len > msl->page_sz &&
            !rte_memseg_contig_walk(mr_find_contig_memsegs_cb, &data_re)) {
@@ -714,7 +714,7 @@ alloc_resources:
                 */
                data.start = RTE_ALIGN_FLOOR(addr, msl->page_sz);
                data.end = data.start + msl->page_sz;
-               rte_rwlock_read_unlock(&mcfg->memory_hotplug_lock);
+               rte_mcfg_mem_read_unlock();
                mr_free(mr);
                goto alloc_resources;
        }
@@ -734,7 +734,7 @@ alloc_resources:
                DEBUG("port %u found MR for %p on final lookup, abort",
                      dev->data->port_id, (void *)addr);
                rte_rwlock_write_unlock(&priv->mr.rwlock);
-               rte_rwlock_read_unlock(&mcfg->memory_hotplug_lock);
+               rte_mcfg_mem_read_unlock();
                /*
                 * Must be unlocked before calling rte_free() because
                 * mlx4_mr_mem_event_free_cb() can be called inside.
@@ -802,12 +802,12 @@ alloc_resources:
        /* Lookup can't fail. */
        assert(entry->lkey != UINT32_MAX);
        rte_rwlock_write_unlock(&priv->mr.rwlock);
-       rte_rwlock_read_unlock(&mcfg->memory_hotplug_lock);
+       rte_mcfg_mem_read_unlock();
        return entry->lkey;
 err_mrlock:
        rte_rwlock_write_unlock(&priv->mr.rwlock);
 err_memlock:
-       rte_rwlock_read_unlock(&mcfg->memory_hotplug_lock);
+       rte_mcfg_mem_read_unlock();
 err_nolock:
        /*
         * In case of error, as this can be called in a datapath, a warning