net/hns3: fix flow director rule residue on malloc failure
[dpdk.git] / lib / librte_vhost / iotlb.c
index 4a1d8c1..e0b6772 100644 (file)
@@ -70,14 +70,14 @@ vhost_user_iotlb_pending_insert(struct vhost_virtqueue *vq,
 
        ret = rte_mempool_get(vq->iotlb_pool, (void **)&node);
        if (ret) {
-               RTE_LOG(DEBUG, VHOST_CONFIG, "IOTLB pool empty, clear entries\n");
+               VHOST_LOG_CONFIG(DEBUG, "IOTLB pool empty, clear entries\n");
                if (!TAILQ_EMPTY(&vq->iotlb_pending_list))
                        vhost_user_iotlb_pending_remove_all(vq);
                else
                        vhost_user_iotlb_cache_random_evict(vq);
                ret = rte_mempool_get(vq->iotlb_pool, (void **)&node);
                if (ret) {
-                       RTE_LOG(ERR, VHOST_CONFIG, "IOTLB pool still empty, failure\n");
+                       VHOST_LOG_CONFIG(ERR, "IOTLB pool still empty, failure\n");
                        return;
                }
        }
@@ -163,14 +163,14 @@ vhost_user_iotlb_cache_insert(struct vhost_virtqueue *vq, uint64_t iova,
 
        ret = rte_mempool_get(vq->iotlb_pool, (void **)&new_node);
        if (ret) {
-               RTE_LOG(DEBUG, VHOST_CONFIG, "IOTLB pool empty, clear entries\n");
+               VHOST_LOG_CONFIG(DEBUG, "IOTLB pool empty, clear entries\n");
                if (!TAILQ_EMPTY(&vq->iotlb_list))
                        vhost_user_iotlb_cache_random_evict(vq);
                else
                        vhost_user_iotlb_pending_remove_all(vq);
                ret = rte_mempool_get(vq->iotlb_pool, (void **)&new_node);
                if (ret) {
-                       RTE_LOG(ERR, VHOST_CONFIG, "IOTLB pool still empty, failure\n");
+                       VHOST_LOG_CONFIG(ERR, "IOTLB pool still empty, failure\n");
                        return;
                }
        }
@@ -308,8 +308,9 @@ vhost_user_iotlb_init(struct virtio_net *dev, int vq_index)
        TAILQ_INIT(&vq->iotlb_list);
        TAILQ_INIT(&vq->iotlb_pending_list);
 
-       snprintf(pool_name, sizeof(pool_name), "iotlb_cache_%d_%d",
-                       dev->vid, vq_index);
+       snprintf(pool_name, sizeof(pool_name), "iotlb_%u_%d_%d",
+                       getpid(), dev->vid, vq_index);
+       VHOST_LOG_CONFIG(DEBUG, "IOTLB cache name: %s\n", pool_name);
 
        /* If already created, free it and recreate */
        vq->iotlb_pool = rte_mempool_lookup(pool_name);
@@ -320,10 +321,9 @@ vhost_user_iotlb_init(struct virtio_net *dev, int vq_index)
                        IOTLB_CACHE_SIZE, sizeof(struct vhost_iotlb_entry), 0,
                        0, 0, NULL, NULL, NULL, socket,
                        MEMPOOL_F_NO_CACHE_ALIGN |
-                       MEMPOOL_F_SP_PUT |
-                       MEMPOOL_F_SC_GET);
+                       MEMPOOL_F_SP_PUT);
        if (!vq->iotlb_pool) {
-               RTE_LOG(ERR, VHOST_CONFIG,
+               VHOST_LOG_CONFIG(ERR,
                                "Failed to create IOTLB cache pool (%s)\n",
                                pool_name);
                return -1;