net/ena: check memory BAR before initializing LLQ
[dpdk.git] / drivers / net / mlx4 / mlx4_mr.c
index 6b2f0cf..e95f45a 100644 (file)
@@ -471,8 +471,7 @@ mr_free(struct mlx4_mr *mr)
        DEBUG("freeing MR(%p):", (void *)mr);
        if (mr->ibv_mr != NULL)
                claim_zero(mlx4_glue->dereg_mr(mr->ibv_mr));
-       if (mr->ms_bmp != NULL)
-               rte_bitmap_free(mr->ms_bmp);
+       rte_bitmap_free(mr->ms_bmp);
        rte_free(mr);
 }
 
@@ -948,18 +947,13 @@ mlx4_mr_mem_event_free_cb(struct rte_eth_dev *dev, const void *addr, size_t len)
        if (rebuild) {
                mr_rebuild_dev_cache(dev);
                /*
-                * Flush local caches by propagating invalidation across cores.
-                * rte_smp_wmb() is enough to synchronize this event. If one of
-                * freed memsegs is seen by other core, that means the memseg
-                * has been allocated by allocator, which will come after this
-                * free call. Therefore, this store instruction (incrementing
-                * generation below) will be guaranteed to be seen by other core
-                * before the core sees the newly allocated memory.
+                * No explicit wmb is needed after updating dev_gen due to
+                * store-release ordering in unlock that provides the
+                * implicit barrier at the software visible level.
                 */
                ++priv->mr.dev_gen;
                DEBUG("broadcasting local cache flush, gen=%d",
                      priv->mr.dev_gen);
-               rte_smp_wmb();
        }
        rte_rwlock_write_unlock(&priv->mr.rwlock);
 #ifdef RTE_LIBRTE_MLX4_DEBUG