get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/61465/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 61465,
    "url": "https://patches.dpdk.org/api/patches/61465/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20191018082638.4463-2-amorenoz@redhat.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20191018082638.4463-2-amorenoz@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191018082638.4463-2-amorenoz@redhat.com",
    "date": "2019-10-18T08:26:39",
    "name": "[RFC,1/1] vhost: Add dynamic logging system",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "83934cd458e549e72dec1ef0b72775123a3eac29",
    "submitter": {
        "id": 1397,
        "url": "https://patches.dpdk.org/api/people/1397/?format=api",
        "name": "Adrian Moreno",
        "email": "amorenoz@redhat.com"
    },
    "delegate": {
        "id": 2642,
        "url": "https://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20191018082638.4463-2-amorenoz@redhat.com/mbox/",
    "series": [
        {
            "id": 6934,
            "url": "https://patches.dpdk.org/api/series/6934/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=6934",
            "date": "2019-10-18T08:26:37",
            "name": "vhost: Add dynamic log tracing",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/6934/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/61465/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/61465/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 2C9DF1C1B9;\n\tFri, 18 Oct 2019 10:27:14 +0200 (CEST)",
            "from mx1.redhat.com (mx1.redhat.com [209.132.183.28])\n\tby dpdk.org (Postfix) with ESMTP id D78AB1C1B9\n\tfor <dev@dpdk.org>; Fri, 18 Oct 2019 10:27:11 +0200 (CEST)",
            "from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 43DB78FAB2;\n\tFri, 18 Oct 2019 08:27:11 +0000 (UTC)",
            "from amorenoz.users.ipa.redhat.com (ovpn-117-5.ams2.redhat.com\n\t[10.36.117.5])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 8A2B45DA60;\n\tFri, 18 Oct 2019 08:27:08 +0000 (UTC)"
        ],
        "From": "Adrian Moreno <amorenoz@redhat.com>",
        "To": "dev@dpdk.org",
        "Cc": "tiwei.bie@intel.com, zhihong.wang@intel.com, maxime.coquelin@redhat.com, \n\tAdrian Moreno <amorenoz@redhat.com>, huawei.xie@intel.com",
        "Date": "Fri, 18 Oct 2019 10:26:39 +0200",
        "Message-Id": "<20191018082638.4463-2-amorenoz@redhat.com>",
        "In-Reply-To": "<20191018082638.4463-1-amorenoz@redhat.com>",
        "References": "<20191018082638.4463-1-amorenoz@redhat.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.14",
        "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.27]); Fri, 18 Oct 2019 08:27:11 +0000 (UTC)",
        "Subject": "[dpdk-dev] [RFC PATCH 1/1] vhost: Add dynamic logging system",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Currently there are a couple of limitations on the logging system: Most\nof the logs are compiled out and both datapath and controlpath logs\nshare the same loglevel.\n\nThis patch tries to help fix that situation by:\n- Splitting control plane and data plane logs\n- Making control plane logs dynamic while keeping data plane logs\ncompiled out by default for log levels lower than RTE_LOG_DP_LEVEL.\n\nSigned-off-by: Adrian Moreno <amorenoz@redhat.com>\nFixes: 1c01d52392d5 (\"vhost: add debug print\")\nCc: huawei.xie@intel.com\nCc: maxime.coquelin@redhat.com\n\n---\n lib/librte_vhost/iotlb.c      |  10 +--\n lib/librte_vhost/socket.c     |  76 ++++++++--------\n lib/librte_vhost/vhost.c      |  30 +++++--\n lib/librte_vhost/vhost.h      |  24 ++++--\n lib/librte_vhost/vhost_user.c | 158 +++++++++++++++++-----------------\n lib/librte_vhost/virtio_net.c |  40 ++++-----\n 6 files changed, 179 insertions(+), 159 deletions(-)",
    "diff": "diff --git a/lib/librte_vhost/iotlb.c b/lib/librte_vhost/iotlb.c\nindex 4a1d8c125..bc1758528 100644\n--- a/lib/librte_vhost/iotlb.c\n+++ b/lib/librte_vhost/iotlb.c\n@@ -70,14 +70,14 @@ vhost_user_iotlb_pending_insert(struct vhost_virtqueue *vq,\n \n \tret = rte_mempool_get(vq->iotlb_pool, (void **)&node);\n \tif (ret) {\n-\t\tRTE_LOG(DEBUG, VHOST_CONFIG, \"IOTLB pool empty, clear entries\\n\");\n+\t\tVHOST_LOG_CONFIG(DEBUG, \"IOTLB pool empty, clear entries\\n\");\n \t\tif (!TAILQ_EMPTY(&vq->iotlb_pending_list))\n \t\t\tvhost_user_iotlb_pending_remove_all(vq);\n \t\telse\n \t\t\tvhost_user_iotlb_cache_random_evict(vq);\n \t\tret = rte_mempool_get(vq->iotlb_pool, (void **)&node);\n \t\tif (ret) {\n-\t\t\tRTE_LOG(ERR, VHOST_CONFIG, \"IOTLB pool still empty, failure\\n\");\n+\t\t\tVHOST_LOG_CONFIG(ERR, \"IOTLB pool still empty, failure\\n\");\n \t\t\treturn;\n \t\t}\n \t}\n@@ -163,14 +163,14 @@ vhost_user_iotlb_cache_insert(struct vhost_virtqueue *vq, uint64_t iova,\n \n \tret = rte_mempool_get(vq->iotlb_pool, (void **)&new_node);\n \tif (ret) {\n-\t\tRTE_LOG(DEBUG, VHOST_CONFIG, \"IOTLB pool empty, clear entries\\n\");\n+\t\tVHOST_LOG_CONFIG(DEBUG, \"IOTLB pool empty, clear entries\\n\");\n \t\tif (!TAILQ_EMPTY(&vq->iotlb_list))\n \t\t\tvhost_user_iotlb_cache_random_evict(vq);\n \t\telse\n \t\t\tvhost_user_iotlb_pending_remove_all(vq);\n \t\tret = rte_mempool_get(vq->iotlb_pool, (void **)&new_node);\n \t\tif (ret) {\n-\t\t\tRTE_LOG(ERR, VHOST_CONFIG, \"IOTLB pool still empty, failure\\n\");\n+\t\t\tVHOST_LOG_CONFIG(ERR, \"IOTLB pool still empty, failure\\n\");\n \t\t\treturn;\n \t\t}\n \t}\n@@ -323,7 +323,7 @@ vhost_user_iotlb_init(struct virtio_net *dev, int vq_index)\n \t\t\tMEMPOOL_F_SP_PUT |\n \t\t\tMEMPOOL_F_SC_GET);\n \tif (!vq->iotlb_pool) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\"Failed to create IOTLB cache pool (%s)\\n\",\n \t\t\t\tpool_name);\n \t\treturn -1;\ndiff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c\nindex 274988c4d..e08d6924b 100644\n--- a/lib/librte_vhost/socket.c\n+++ b/lib/librte_vhost/socket.c\n@@ -125,12 +125,12 @@ read_fd_message(int sockfd, char *buf, int buflen, int *fds, int max_fds,\n \n \tret = recvmsg(sockfd, &msgh, 0);\n \tif (ret <= 0) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG, \"recvmsg failed\\n\");\n+\t\tVHOST_LOG_CONFIG(ERR, \"recvmsg failed\\n\");\n \t\treturn ret;\n \t}\n \n \tif (msgh.msg_flags & (MSG_TRUNC | MSG_CTRUNC)) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG, \"truncted msg\\n\");\n+\t\tVHOST_LOG_CONFIG(ERR, \"truncted msg\\n\");\n \t\treturn -1;\n \t}\n \n@@ -175,7 +175,7 @@ send_fd_message(int sockfd, char *buf, int buflen, int *fds, int fd_num)\n \t\tmsgh.msg_controllen = sizeof(control);\n \t\tcmsg = CMSG_FIRSTHDR(&msgh);\n \t\tif (cmsg == NULL) {\n-\t\t\tRTE_LOG(ERR, VHOST_CONFIG, \"cmsg == NULL\\n\");\n+\t\t\tVHOST_LOG_CONFIG(ERR, \"cmsg == NULL\\n\");\n \t\t\terrno = EINVAL;\n \t\t\treturn -1;\n \t\t}\n@@ -193,7 +193,7 @@ send_fd_message(int sockfd, char *buf, int buflen, int *fds, int fd_num)\n \t} while (ret < 0 && errno == EINTR);\n \n \tif (ret < 0) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,  \"sendmsg error\\n\");\n+\t\tVHOST_LOG_CONFIG(ERR,  \"sendmsg error\\n\");\n \t\treturn ret;\n \t}\n \n@@ -232,12 +232,12 @@ vhost_user_add_connection(int fd, struct vhost_user_socket *vsocket)\n \tif (vsocket->dequeue_zero_copy)\n \t\tvhost_enable_dequeue_zero_copy(vid);\n \n-\tRTE_LOG(INFO, VHOST_CONFIG, \"new device, handle is %d\\n\", vid);\n+\tVHOST_LOG_CONFIG(INFO, \"new device, handle is %d\\n\", vid);\n \n \tif (vsocket->notify_ops->new_connection) {\n \t\tret = vsocket->notify_ops->new_connection(vid);\n \t\tif (ret < 0) {\n-\t\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\"failed to add vhost user connection with fd %d\\n\",\n \t\t\t\tfd);\n \t\t\tgoto err_cleanup;\n@@ -250,7 +250,7 @@ vhost_user_add_connection(int fd, struct vhost_user_socket *vsocket)\n \tret = fdset_add(&vhost_user.fdset, fd, vhost_user_read_cb,\n \t\t\tNULL, conn);\n \tif (ret < 0) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"failed to add fd %d into vhost server fdset\\n\",\n \t\t\tfd);\n \n@@ -284,7 +284,7 @@ vhost_user_server_new_connection(int fd, void *dat, int *remove __rte_unused)\n \tif (fd < 0)\n \t\treturn;\n \n-\tRTE_LOG(INFO, VHOST_CONFIG, \"new vhost user connection is %d\\n\", fd);\n+\tVHOST_LOG_CONFIG(INFO, \"new vhost user connection is %d\\n\", fd);\n \tvhost_user_add_connection(fd, vsocket);\n }\n \n@@ -332,11 +332,11 @@ create_unix_socket(struct vhost_user_socket *vsocket)\n \tfd = socket(AF_UNIX, SOCK_STREAM, 0);\n \tif (fd < 0)\n \t\treturn -1;\n-\tRTE_LOG(INFO, VHOST_CONFIG, \"vhost-user %s: socket created, fd: %d\\n\",\n+\tVHOST_LOG_CONFIG(INFO, \"vhost-user %s: socket created, fd: %d\\n\",\n \t\tvsocket->is_server ? \"server\" : \"client\", fd);\n \n \tif (!vsocket->is_server && fcntl(fd, F_SETFL, O_NONBLOCK)) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"vhost-user: can't set nonblocking mode for socket, fd: \"\n \t\t\t\"%d (%s)\\n\", fd, strerror(errno));\n \t\tclose(fd);\n@@ -371,12 +371,12 @@ vhost_user_start_server(struct vhost_user_socket *vsocket)\n \t */\n \tret = bind(fd, (struct sockaddr *)&vsocket->un, sizeof(vsocket->un));\n \tif (ret < 0) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"failed to bind to %s: %s; remove it and try again\\n\",\n \t\t\tpath, strerror(errno));\n \t\tgoto err;\n \t}\n-\tRTE_LOG(INFO, VHOST_CONFIG, \"bind to %s\\n\", path);\n+\tVHOST_LOG_CONFIG(INFO, \"bind to %s\\n\", path);\n \n \tret = listen(fd, MAX_VIRTIO_BACKLOG);\n \tif (ret < 0)\n@@ -385,7 +385,7 @@ vhost_user_start_server(struct vhost_user_socket *vsocket)\n \tret = fdset_add(&vhost_user.fdset, fd, vhost_user_server_new_connection,\n \t\t  NULL, vsocket);\n \tif (ret < 0) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"failed to add listen fd %d to vhost server fdset\\n\",\n \t\t\tfd);\n \t\tgoto err;\n@@ -426,12 +426,12 @@ vhost_user_connect_nonblock(int fd, struct sockaddr *un, size_t sz)\n \n \tflags = fcntl(fd, F_GETFL, 0);\n \tif (flags < 0) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"can't get flags for connfd %d\\n\", fd);\n \t\treturn -2;\n \t}\n \tif ((flags & O_NONBLOCK) && fcntl(fd, F_SETFL, flags & ~O_NONBLOCK)) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\"can't disable nonblocking on fd %d\\n\", fd);\n \t\treturn -2;\n \t}\n@@ -460,7 +460,7 @@ vhost_user_client_reconnect(void *arg __rte_unused)\n \t\t\t\t\t\tsizeof(reconn->un));\n \t\t\tif (ret == -2) {\n \t\t\t\tclose(reconn->fd);\n-\t\t\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\t\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\t\"reconnection for fd %d failed\\n\",\n \t\t\t\t\treconn->fd);\n \t\t\t\tgoto remove_fd;\n@@ -468,7 +468,7 @@ vhost_user_client_reconnect(void *arg __rte_unused)\n \t\t\tif (ret == -1)\n \t\t\t\tcontinue;\n \n-\t\t\tRTE_LOG(INFO, VHOST_CONFIG,\n+\t\t\tVHOST_LOG_CONFIG(INFO,\n \t\t\t\t\"%s: connected\\n\", reconn->vsocket->path);\n \t\t\tvhost_user_add_connection(reconn->fd, reconn->vsocket);\n remove_fd:\n@@ -490,7 +490,7 @@ vhost_user_reconnect_init(void)\n \n \tret = pthread_mutex_init(&reconn_list.mutex, NULL);\n \tif (ret < 0) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG, \"failed to initialize mutex\");\n+\t\tVHOST_LOG_CONFIG(ERR, \"failed to initialize mutex\");\n \t\treturn ret;\n \t}\n \tTAILQ_INIT(&reconn_list.head);\n@@ -498,9 +498,9 @@ vhost_user_reconnect_init(void)\n \tret = rte_ctrl_thread_create(&reconn_tid, \"vhost_reconn\", NULL,\n \t\t\t     vhost_user_client_reconnect, NULL);\n \tif (ret != 0) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG, \"failed to create reconnect thread\");\n+\t\tVHOST_LOG_CONFIG(ERR, \"failed to create reconnect thread\");\n \t\tif (pthread_mutex_destroy(&reconn_list.mutex)) {\n-\t\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\"failed to destroy reconnect mutex\");\n \t\t}\n \t}\n@@ -523,7 +523,7 @@ vhost_user_start_client(struct vhost_user_socket *vsocket)\n \t\treturn 0;\n \t}\n \n-\tRTE_LOG(WARNING, VHOST_CONFIG,\n+\tVHOST_LOG_CONFIG(WARNING,\n \t\t\"failed to connect to %s: %s\\n\",\n \t\tpath, strerror(errno));\n \n@@ -532,10 +532,10 @@ vhost_user_start_client(struct vhost_user_socket *vsocket)\n \t\treturn -1;\n \t}\n \n-\tRTE_LOG(INFO, VHOST_CONFIG, \"%s: reconnecting...\\n\", path);\n+\tVHOST_LOG_CONFIG(INFO, \"%s: reconnecting...\\n\", path);\n \treconn = malloc(sizeof(*reconn));\n \tif (reconn == NULL) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"failed to allocate memory for reconnect\\n\");\n \t\tclose(fd);\n \t\treturn -1;\n@@ -690,7 +690,7 @@ rte_vhost_driver_get_features(const char *path, uint64_t *features)\n \tpthread_mutex_lock(&vhost_user.mutex);\n \tvsocket = find_vhost_user_socket(path);\n \tif (!vsocket) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"socket file %s is not registered yet.\\n\", path);\n \t\tret = -1;\n \t\tgoto unlock_exit;\n@@ -704,7 +704,7 @@ rte_vhost_driver_get_features(const char *path, uint64_t *features)\n \t}\n \n \tif (vdpa_dev->ops->get_features(did, &vdpa_features) < 0) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\"failed to get vdpa features \"\n \t\t\t\t\"for socket file %s.\\n\", path);\n \t\tret = -1;\n@@ -745,7 +745,7 @@ rte_vhost_driver_get_protocol_features(const char *path,\n \tpthread_mutex_lock(&vhost_user.mutex);\n \tvsocket = find_vhost_user_socket(path);\n \tif (!vsocket) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"socket file %s is not registered yet.\\n\", path);\n \t\tret = -1;\n \t\tgoto unlock_exit;\n@@ -760,7 +760,7 @@ rte_vhost_driver_get_protocol_features(const char *path,\n \n \tif (vdpa_dev->ops->get_protocol_features(did,\n \t\t\t\t&vdpa_protocol_features) < 0) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\"failed to get vdpa protocol features \"\n \t\t\t\t\"for socket file %s.\\n\", path);\n \t\tret = -1;\n@@ -787,7 +787,7 @@ rte_vhost_driver_get_queue_num(const char *path, uint32_t *queue_num)\n \tpthread_mutex_lock(&vhost_user.mutex);\n \tvsocket = find_vhost_user_socket(path);\n \tif (!vsocket) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"socket file %s is not registered yet.\\n\", path);\n \t\tret = -1;\n \t\tgoto unlock_exit;\n@@ -801,7 +801,7 @@ rte_vhost_driver_get_queue_num(const char *path, uint32_t *queue_num)\n \t}\n \n \tif (vdpa_dev->ops->get_queue_num(did, &vdpa_queue_num) < 0) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\"failed to get vdpa queue number \"\n \t\t\t\t\"for socket file %s.\\n\", path);\n \t\tret = -1;\n@@ -846,7 +846,7 @@ rte_vhost_driver_register(const char *path, uint64_t flags)\n \tpthread_mutex_lock(&vhost_user.mutex);\n \n \tif (vhost_user.vsocket_cnt == MAX_VHOST_SOCKET) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"error: the number of vhost sockets reaches maximum\\n\");\n \t\tgoto out;\n \t}\n@@ -857,7 +857,7 @@ rte_vhost_driver_register(const char *path, uint64_t flags)\n \tmemset(vsocket, 0, sizeof(struct vhost_user_socket));\n \tvsocket->path = strdup(path);\n \tif (vsocket->path == NULL) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"error: failed to copy socket path string\\n\");\n \t\tvhost_user_socket_mem_free(vsocket);\n \t\tgoto out;\n@@ -865,7 +865,7 @@ rte_vhost_driver_register(const char *path, uint64_t flags)\n \tTAILQ_INIT(&vsocket->conn_list);\n \tret = pthread_mutex_init(&vsocket->conn_mutex, NULL);\n \tif (ret) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"error: failed to init connection mutex\\n\");\n \t\tgoto out_free;\n \t}\n@@ -897,7 +897,7 @@ rte_vhost_driver_register(const char *path, uint64_t flags)\n \t\tvsocket->supported_features &= ~(1ULL << VIRTIO_F_IN_ORDER);\n \t\tvsocket->features &= ~(1ULL << VIRTIO_F_IN_ORDER);\n \n-\t\tRTE_LOG(INFO, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(INFO,\n \t\t\t\"Dequeue zero copy requested, disabling postcopy support\\n\");\n \t\tvsocket->protocol_features &=\n \t\t\t~(1ULL << VHOST_USER_PROTOCOL_F_PAGEFAULT);\n@@ -913,7 +913,7 @@ rte_vhost_driver_register(const char *path, uint64_t flags)\n \t\t\t~(1ULL << VHOST_USER_PROTOCOL_F_PAGEFAULT);\n \t} else {\n #ifndef RTE_LIBRTE_VHOST_POSTCOPY\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"Postcopy requested but not compiled\\n\");\n \t\tret = -1;\n \t\tgoto out_mutex;\n@@ -941,7 +941,7 @@ rte_vhost_driver_register(const char *path, uint64_t flags)\n \n out_mutex:\n \tif (pthread_mutex_destroy(&vsocket->conn_mutex)) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"error: failed to destroy connection mutex\\n\");\n \t}\n out_free:\n@@ -1015,7 +1015,7 @@ rte_vhost_driver_unregister(const char *path)\n \t\t\t\t\tgoto again;\n \t\t\t\t}\n \n-\t\t\t\tRTE_LOG(INFO, VHOST_CONFIG,\n+\t\t\t\tVHOST_LOG_CONFIG(INFO,\n \t\t\t\t\t\"free connfd = %d for device '%s'\\n\",\n \t\t\t\t\tconn->connfd, path);\n \t\t\t\tclose(conn->connfd);\n@@ -1099,7 +1099,7 @@ rte_vhost_driver_start(const char *path)\n \t\t * rebuild the wait list of poll.\n \t\t */\n \t\tif (fdset_pipe_init(&vhost_user.fdset) < 0) {\n-\t\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\"failed to create pipe for vhost fdset\\n\");\n \t\t\treturn -1;\n \t\t}\n@@ -1108,7 +1108,7 @@ rte_vhost_driver_start(const char *path)\n \t\t\t\"vhost-events\", NULL, fdset_event_dispatch,\n \t\t\t&vhost_user.fdset);\n \t\tif (ret != 0) {\n-\t\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\"failed to create fdset handling thread\");\n \n \t\t\tfdset_pipe_uninit(&vhost_user.fdset);\ndiff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c\nindex 981837b5d..0cc5edf0a 100644\n--- a/lib/librte_vhost/vhost.c\n+++ b/lib/librte_vhost/vhost.c\n@@ -27,6 +27,9 @@\n \n struct virtio_net *vhost_devices[MAX_VHOST_DEVICE];\n \n+int vhost_config_log_level;\n+int vhost_data_log_level;\n+\n /* Called with iotlb_lock read-locked */\n uint64_t\n __vhost_iova_to_vva(struct virtio_net *dev, struct vhost_virtqueue *vq,\n@@ -57,7 +60,7 @@ __vhost_iova_to_vva(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \n \t\tvhost_user_iotlb_pending_insert(vq, iova, perm);\n \t\tif (vhost_user_iotlb_miss(dev, iova, perm)) {\n-\t\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\"IOTLB miss req failed for IOVA 0x%\" PRIx64 \"\\n\",\n \t\t\t\tiova);\n \t\t\tvhost_user_iotlb_pending_remove(vq, iova, 1, perm);\n@@ -394,7 +397,7 @@ init_vring_queue(struct virtio_net *dev, uint32_t vring_idx)\n \tstruct vhost_virtqueue *vq;\n \n \tif (vring_idx >= VHOST_MAX_VRING) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\"Failed not init vring, out of bound (%d)\\n\",\n \t\t\t\tvring_idx);\n \t\treturn;\n@@ -421,7 +424,7 @@ reset_vring_queue(struct virtio_net *dev, uint32_t vring_idx)\n \tint callfd;\n \n \tif (vring_idx >= VHOST_MAX_VRING) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\"Failed not init vring, out of bound (%d)\\n\",\n \t\t\t\tvring_idx);\n \t\treturn;\n@@ -440,7 +443,7 @@ alloc_vring_queue(struct virtio_net *dev, uint32_t vring_idx)\n \n \tvq = rte_malloc(NULL, sizeof(struct vhost_virtqueue), 0);\n \tif (vq == NULL) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"Failed to allocate memory for vring:%u.\\n\", vring_idx);\n \t\treturn -1;\n \t}\n@@ -491,14 +494,14 @@ vhost_new_device(void)\n \t}\n \n \tif (i == MAX_VHOST_DEVICE) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"Failed to find a free slot for new device.\\n\");\n \t\treturn -1;\n \t}\n \n \tdev = rte_zmalloc(NULL, sizeof(struct virtio_net), 0);\n \tif (dev == NULL) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"Failed to allocate memory for new dev.\\n\");\n \t\treturn -1;\n \t}\n@@ -639,7 +642,7 @@ rte_vhost_get_numa_node(int vid)\n \tret = get_mempolicy(&numa_node, NULL, 0, dev,\n \t\t\t    MPOL_F_NODE | MPOL_F_ADDR);\n \tif (ret < 0) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"(%d) failed to query numa node: %s\\n\",\n \t\t\tvid, rte_strerror(errno));\n \t\treturn -1;\n@@ -897,7 +900,7 @@ rte_vhost_rx_queue_count(int vid, uint16_t qid)\n \t\treturn 0;\n \n \tif (unlikely(qid >= dev->nr_vring || (qid & 1) == 0)) {\n-\t\tRTE_LOG(ERR, VHOST_DATA, \"(%d) %s: invalid virtqueue idx %d.\\n\",\n+\t\tVHOST_LOG_DATA(ERR, \"(%d) %s: invalid virtqueue idx %d.\\n\",\n \t\t\tdev->vid, __func__, qid);\n \t\treturn 0;\n \t}\n@@ -976,3 +979,14 @@ int rte_vhost_extern_callback_register(int vid,\n \tdev->extern_data = ctx;\n \treturn 0;\n }\n+\n+RTE_INIT(vhost_log_init)\n+{\n+\tvhost_config_log_level = rte_log_register(\"lib.vhost.config\");\n+\tif (vhost_config_log_level >= 0)\n+\t\trte_log_set_level(vhost_config_log_level, RTE_LOG_INFO);\n+\n+\tvhost_data_log_level = rte_log_register(\"lib.vhost.data\");\n+\tif (vhost_data_log_level >= 0)\n+\t\trte_log_set_level(vhost_data_log_level, RTE_LOG_WARNING);\n+}\ndiff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h\nindex 884befa85..13449aafc 100644\n--- a/lib/librte_vhost/vhost.h\n+++ b/lib/librte_vhost/vhost.h\n@@ -393,14 +393,21 @@ vhost_log_used_vring(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \tvhost_log_write(dev, vq->log_guest_addr + offset, len);\n }\n \n-/* Macros for printing using RTE_LOG */\n-#define RTE_LOGTYPE_VHOST_CONFIG RTE_LOGTYPE_USER1\n-#define RTE_LOGTYPE_VHOST_DATA   RTE_LOGTYPE_USER1\n+extern int vhost_config_log_level;\n+extern int vhost_data_log_level;\n+\n+#define VHOST_LOG_CONFIG(level, fmt, args...)\t\t\t\\\n+\trte_log(RTE_LOG_ ## level, vhost_config_log_level,\t\\\n+\t\t\"VHOST_CONFIG: \" fmt, ##args)\n+\n+#define VHOST_LOG_DATA(level, fmt, args...) \\\n+\t(void)((RTE_LOG_ ## level <= RTE_LOG_DP_LEVEL) ?\t\\\n+\t rte_log(RTE_LOG_ ## level,  vhost_data_log_level,\t\\\n+\t\t\"VHOST_DATA : \" fmt, ##args) :\t\t\t\\\n+\t 0)\n \n #ifdef RTE_LIBRTE_VHOST_DEBUG\n #define VHOST_MAX_PRINT_BUFF 6072\n-#define VHOST_LOG_DEBUG(log_type, fmt, args...) \\\n-\tRTE_LOG(DEBUG, log_type, fmt, ##args)\n #define PRINT_PACKET(device, addr, size, header) do { \\\n \tchar *pkt_addr = (char *)(addr); \\\n \tunsigned int index; \\\n@@ -416,10 +423,9 @@ vhost_log_used_vring(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t} \\\n \tsnprintf(packet + strnlen(packet, VHOST_MAX_PRINT_BUFF), VHOST_MAX_PRINT_BUFF - strnlen(packet, VHOST_MAX_PRINT_BUFF), \"\\n\"); \\\n \t\\\n-\tVHOST_LOG_DEBUG(VHOST_DATA, \"%s\", packet); \\\n+\tVHOST_LOG_DATA(DEBUG, \"%s\", packet); \\\n } while (0)\n #else\n-#define VHOST_LOG_DEBUG(log_type, fmt, args...) do {} while (0)\n #define PRINT_PACKET(device, addr, size, header) do {} while (0)\n #endif\n \n@@ -453,7 +459,7 @@ get_device(int vid)\n \tstruct virtio_net *dev = vhost_devices[vid];\n \n \tif (unlikely(!dev)) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"(%d) device not found.\\n\", vid);\n \t}\n \n@@ -536,7 +542,7 @@ vhost_vring_call_split(struct virtio_net *dev, struct vhost_virtqueue *vq)\n \t\tvq->signalled_used = new;\n \t\tvq->signalled_used_valid = true;\n \n-\t\tVHOST_LOG_DEBUG(VHOST_DATA, \"%s: used_event_idx=%d, old=%d, new=%d\\n\",\n+\t\tVHOST_LOG_DATA(DEBUG, \"%s: used_event_idx=%d, old=%d, new=%d\\n\",\n \t\t\t__func__,\n \t\t\tvhost_used_event(vq),\n \t\t\told, new);\ndiff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c\nindex 0b72648a5..2dd79b46e 100644\n--- a/lib/librte_vhost/vhost_user.c\n+++ b/lib/librte_vhost/vhost_user.c\n@@ -251,7 +251,7 @@ vhost_user_set_features(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \n \trte_vhost_driver_get_features(dev->ifname, &vhost_features);\n \tif (features & ~vhost_features) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"(%d) received invalid negotiated features.\\n\",\n \t\t\tdev->vid);\n \t\treturn RTE_VHOST_MSG_RESULT_ERR;\n@@ -267,7 +267,7 @@ vhost_user_set_features(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \t\t * is enabled when the live-migration starts.\n \t\t */\n \t\tif ((dev->features ^ features) & ~(1ULL << VHOST_F_LOG_ALL)) {\n-\t\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\"(%d) features changed while device is running.\\n\",\n \t\t\t\tdev->vid);\n \t\t\treturn RTE_VHOST_MSG_RESULT_ERR;\n@@ -284,9 +284,9 @@ vhost_user_set_features(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \t} else {\n \t\tdev->vhost_hlen = sizeof(struct virtio_net_hdr);\n \t}\n-\tRTE_LOG(INFO, VHOST_CONFIG,\n+\tVHOST_LOG_CONFIG(INFO,\n \t\t\"negotiated Virtio features: 0x%\" PRIx64 \"\\n\", dev->features);\n-\tVHOST_LOG_DEBUG(VHOST_CONFIG,\n+\tVHOST_LOG_CONFIG(DEBUG,\n \t\t\"(%d) mergeable RX buffers %s, virtio 1 %s\\n\",\n \t\tdev->vid,\n \t\t(dev->features & (1 << VIRTIO_NET_F_MRG_RXBUF)) ? \"on\" : \"off\",\n@@ -339,7 +339,7 @@ vhost_user_set_vring_num(struct virtio_net **pdev,\n \t *   value is 32768.\n \t */\n \tif ((vq->size & (vq->size - 1)) || vq->size > 32768) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"invalid virtqueue size %u\\n\", vq->size);\n \t\treturn RTE_VHOST_MSG_RESULT_ERR;\n \t}\n@@ -351,7 +351,7 @@ vhost_user_set_vring_num(struct virtio_net **pdev,\n \t\tvq->zmbufs = rte_zmalloc(NULL, vq->zmbuf_size *\n \t\t\t\t\t sizeof(struct zcopy_mbuf), 0);\n \t\tif (vq->zmbufs == NULL) {\n-\t\t\tRTE_LOG(WARNING, VHOST_CONFIG,\n+\t\t\tVHOST_LOG_CONFIG(WARNING,\n \t\t\t\t\"failed to allocate mem for zero copy; \"\n \t\t\t\t\"zero copy is force disabled\\n\");\n \t\t\tdev->dequeue_zero_copy = 0;\n@@ -365,7 +365,7 @@ vhost_user_set_vring_num(struct virtio_net **pdev,\n \t\t\t\tsizeof(struct vring_used_elem_packed),\n \t\t\t\tRTE_CACHE_LINE_SIZE);\n \t\tif (!vq->shadow_used_packed) {\n-\t\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\t\"failed to allocate memory for shadow used ring.\\n\");\n \t\t\treturn RTE_VHOST_MSG_RESULT_ERR;\n \t\t}\n@@ -375,7 +375,7 @@ vhost_user_set_vring_num(struct virtio_net **pdev,\n \t\t\t\tvq->size * sizeof(struct vring_used_elem),\n \t\t\t\tRTE_CACHE_LINE_SIZE);\n \t\tif (!vq->shadow_used_split) {\n-\t\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\t\"failed to allocate memory for shadow used ring.\\n\");\n \t\t\treturn RTE_VHOST_MSG_RESULT_ERR;\n \t\t}\n@@ -385,7 +385,7 @@ vhost_user_set_vring_num(struct virtio_net **pdev,\n \t\t\t\tvq->size * sizeof(struct batch_copy_elem),\n \t\t\t\tRTE_CACHE_LINE_SIZE);\n \tif (!vq->batch_copy_elems) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"failed to allocate memory for batching copy.\\n\");\n \t\treturn RTE_VHOST_MSG_RESULT_ERR;\n \t}\n@@ -420,12 +420,12 @@ numa_realloc(struct virtio_net *dev, int index)\n \tret |= get_mempolicy(&oldnode, NULL, 0, old_vq,\n \t\t\t     MPOL_F_NODE | MPOL_F_ADDR);\n \tif (ret) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"Unable to get vq numa information.\\n\");\n \t\treturn dev;\n \t}\n \tif (oldnode != newnode) {\n-\t\tRTE_LOG(INFO, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(INFO,\n \t\t\t\"reallocate vq from %d to %d node\\n\", oldnode, newnode);\n \t\tvq = rte_malloc_socket(NULL, sizeof(*vq), 0, newnode);\n \t\tif (!vq)\n@@ -481,12 +481,12 @@ numa_realloc(struct virtio_net *dev, int index)\n \tret = get_mempolicy(&oldnode, NULL, 0, old_dev,\n \t\t\t    MPOL_F_NODE | MPOL_F_ADDR);\n \tif (ret) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"Unable to get dev numa information.\\n\");\n \t\tgoto out;\n \t}\n \tif (oldnode != newnode) {\n-\t\tRTE_LOG(INFO, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(INFO,\n \t\t\t\"reallocate dev from %d to %d node\\n\",\n \t\t\toldnode, newnode);\n \t\tdev = rte_malloc_socket(NULL, sizeof(*dev), 0, newnode);\n@@ -585,7 +585,7 @@ translate_ring_addresses(struct virtio_net *dev, int vq_index)\n \t\tif (vq->desc_packed == NULL ||\n \t\t\t\tlen != sizeof(struct vring_packed_desc) *\n \t\t\t\tvq->size) {\n-\t\t\tRTE_LOG(DEBUG, VHOST_CONFIG,\n+\t\t\tVHOST_LOG_CONFIG(DEBUG,\n \t\t\t\t\"(%d) failed to map desc_packed ring.\\n\",\n \t\t\t\tdev->vid);\n \t\t\treturn dev;\n@@ -601,7 +601,7 @@ translate_ring_addresses(struct virtio_net *dev, int vq_index)\n \t\t\t\t\tvq, addr->avail_user_addr, &len);\n \t\tif (vq->driver_event == NULL ||\n \t\t\t\tlen != sizeof(struct vring_packed_desc_event)) {\n-\t\t\tRTE_LOG(DEBUG, VHOST_CONFIG,\n+\t\t\tVHOST_LOG_CONFIG(DEBUG,\n \t\t\t\t\"(%d) failed to find driver area address.\\n\",\n \t\t\t\tdev->vid);\n \t\t\treturn dev;\n@@ -613,7 +613,7 @@ translate_ring_addresses(struct virtio_net *dev, int vq_index)\n \t\t\t\t\tvq, addr->used_user_addr, &len);\n \t\tif (vq->device_event == NULL ||\n \t\t\t\tlen != sizeof(struct vring_packed_desc_event)) {\n-\t\t\tRTE_LOG(DEBUG, VHOST_CONFIG,\n+\t\t\tVHOST_LOG_CONFIG(DEBUG,\n \t\t\t\t\"(%d) failed to find device area address.\\n\",\n \t\t\t\tdev->vid);\n \t\t\treturn dev;\n@@ -630,7 +630,7 @@ translate_ring_addresses(struct virtio_net *dev, int vq_index)\n \tvq->desc = (struct vring_desc *)(uintptr_t)ring_addr_to_vva(dev,\n \t\t\tvq, addr->desc_user_addr, &len);\n \tif (vq->desc == 0 || len != sizeof(struct vring_desc) * vq->size) {\n-\t\tRTE_LOG(DEBUG, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(DEBUG,\n \t\t\t\"(%d) failed to map desc ring.\\n\",\n \t\t\tdev->vid);\n \t\treturn dev;\n@@ -647,7 +647,7 @@ translate_ring_addresses(struct virtio_net *dev, int vq_index)\n \tvq->avail = (struct vring_avail *)(uintptr_t)ring_addr_to_vva(dev,\n \t\t\tvq, addr->avail_user_addr, &len);\n \tif (vq->avail == 0 || len != expected_len) {\n-\t\tRTE_LOG(DEBUG, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(DEBUG,\n \t\t\t\"(%d) failed to map avail ring.\\n\",\n \t\t\tdev->vid);\n \t\treturn dev;\n@@ -661,14 +661,14 @@ translate_ring_addresses(struct virtio_net *dev, int vq_index)\n \tvq->used = (struct vring_used *)(uintptr_t)ring_addr_to_vva(dev,\n \t\t\tvq, addr->used_user_addr, &len);\n \tif (vq->used == 0 || len != expected_len) {\n-\t\tRTE_LOG(DEBUG, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(DEBUG,\n \t\t\t\"(%d) failed to map used ring.\\n\",\n \t\t\tdev->vid);\n \t\treturn dev;\n \t}\n \n \tif (vq->last_used_idx != vq->used->idx) {\n-\t\tRTE_LOG(WARNING, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(WARNING,\n \t\t\t\"last_used_idx (%u) and vq->used->idx (%u) mismatches; \"\n \t\t\t\"some packets maybe resent for Tx and dropped for Rx\\n\",\n \t\t\tvq->last_used_idx, vq->used->idx);\n@@ -678,13 +678,13 @@ translate_ring_addresses(struct virtio_net *dev, int vq_index)\n \n \tvq->log_guest_addr = addr->log_guest_addr;\n \n-\tVHOST_LOG_DEBUG(VHOST_CONFIG, \"(%d) mapped address desc: %p\\n\",\n+\tVHOST_LOG_CONFIG(DEBUG, \"(%d) mapped address desc: %p\\n\",\n \t\t\tdev->vid, vq->desc);\n-\tVHOST_LOG_DEBUG(VHOST_CONFIG, \"(%d) mapped address avail: %p\\n\",\n+\tVHOST_LOG_CONFIG(DEBUG, \"(%d) mapped address avail: %p\\n\",\n \t\t\tdev->vid, vq->avail);\n-\tVHOST_LOG_DEBUG(VHOST_CONFIG, \"(%d) mapped address used: %p\\n\",\n+\tVHOST_LOG_CONFIG(DEBUG, \"(%d) mapped address used: %p\\n\",\n \t\t\tdev->vid, vq->used);\n-\tVHOST_LOG_DEBUG(VHOST_CONFIG, \"(%d) log_guest_addr: %\" PRIx64 \"\\n\",\n+\tVHOST_LOG_CONFIG(DEBUG, \"(%d) log_guest_addr: %\" PRIx64 \"\\n\",\n \t\t\tdev->vid, vq->log_guest_addr);\n \n \treturn dev;\n@@ -775,7 +775,7 @@ add_one_guest_page(struct virtio_net *dev, uint64_t guest_phys_addr,\n \t\tdev->guest_pages = realloc(dev->guest_pages,\n \t\t\t\t\tdev->max_guest_pages * sizeof(*page));\n \t\tif (!dev->guest_pages) {\n-\t\t\tRTE_LOG(ERR, VHOST_CONFIG, \"cannot realloc guest_pages\\n\");\n+\t\t\tVHOST_LOG_CONFIG(ERR, \"cannot realloc guest_pages\\n\");\n \t\t\tfree(old_pages);\n \t\t\treturn -1;\n \t\t}\n@@ -847,7 +847,7 @@ dump_guest_pages(struct virtio_net *dev)\n \tfor (i = 0; i < dev->nr_guest_pages; i++) {\n \t\tpage = &dev->guest_pages[i];\n \n-\t\tRTE_LOG(INFO, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(INFO,\n \t\t\t\"guest physical page region %u\\n\"\n \t\t\t\"\\t guest_phys_addr: %\" PRIx64 \"\\n\"\n \t\t\t\"\\t host_phys_addr : %\" PRIx64 \"\\n\"\n@@ -902,13 +902,13 @@ vhost_user_set_mem_table(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \tint fd;\n \n \tif (memory->nregions > VHOST_MEMORY_MAX_NREGIONS) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"too many memory regions (%u)\\n\", memory->nregions);\n \t\treturn RTE_VHOST_MSG_RESULT_ERR;\n \t}\n \n \tif (dev->mem && !vhost_memory_changed(memory, dev->mem)) {\n-\t\tRTE_LOG(INFO, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(INFO,\n \t\t\t\"(%d) memory regions not changed\\n\", dev->vid);\n \n \t\tfor (i = 0; i < memory->nregions; i++)\n@@ -934,7 +934,7 @@ vhost_user_set_mem_table(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \t\tdev->guest_pages = malloc(dev->max_guest_pages *\n \t\t\t\t\t\tsizeof(struct guest_page));\n \t\tif (dev->guest_pages == NULL) {\n-\t\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\"(%d) failed to allocate memory \"\n \t\t\t\t\"for dev->guest_pages\\n\",\n \t\t\t\tdev->vid);\n@@ -945,7 +945,7 @@ vhost_user_set_mem_table(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \tdev->mem = rte_zmalloc(\"vhost-mem-table\", sizeof(struct rte_vhost_memory) +\n \t\tsizeof(struct rte_vhost_mem_region) * memory->nregions, 0);\n \tif (dev->mem == NULL) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"(%d) failed to allocate memory for dev->mem\\n\",\n \t\t\tdev->vid);\n \t\treturn RTE_VHOST_MSG_RESULT_ERR;\n@@ -965,7 +965,7 @@ vhost_user_set_mem_table(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \n \t\t/* Check for memory_size + mmap_offset overflow */\n \t\tif (mmap_offset >= -reg->size) {\n-\t\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\"mmap_offset (%#\"PRIx64\") and memory_size \"\n \t\t\t\t\"(%#\"PRIx64\") overflow\\n\",\n \t\t\t\tmmap_offset, reg->size);\n@@ -984,7 +984,7 @@ vhost_user_set_mem_table(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \t\t */\n \t\talignment = get_blk_size(fd);\n \t\tif (alignment == (uint64_t)-1) {\n-\t\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\"couldn't get hugepage size through fstat\\n\");\n \t\t\tgoto err_mmap;\n \t\t}\n@@ -995,7 +995,7 @@ vhost_user_set_mem_table(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \t\t\t\t MAP_SHARED | populate, fd, 0);\n \n \t\tif (mmap_addr == MAP_FAILED) {\n-\t\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\"mmap region %u failed.\\n\", i);\n \t\t\tgoto err_mmap;\n \t\t}\n@@ -1007,13 +1007,13 @@ vhost_user_set_mem_table(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \n \t\tif (dev->dequeue_zero_copy)\n \t\t\tif (add_guest_pages(dev, reg, alignment) < 0) {\n-\t\t\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\t\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\t\"adding guest pages to region %u failed.\\n\",\n \t\t\t\t\ti);\n \t\t\t\tgoto err_mmap;\n \t\t\t}\n \n-\t\tRTE_LOG(INFO, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(INFO,\n \t\t\t\"guest memory region %u, size: 0x%\" PRIx64 \"\\n\"\n \t\t\t\"\\t guest physical addr: 0x%\" PRIx64 \"\\n\"\n \t\t\t\"\\t guest virtual  addr: 0x%\" PRIx64 \"\\n\"\n@@ -1051,12 +1051,12 @@ vhost_user_set_mem_table(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \t\t */\n \t\tVhostUserMsg ack_msg;\n \t\tif (read_vhost_message(main_fd, &ack_msg) <= 0) {\n-\t\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\"Failed to read qemu ack on postcopy set-mem-table\\n\");\n \t\t\tgoto err_mmap;\n \t\t}\n \t\tif (ack_msg.request.master != VHOST_USER_SET_MEM_TABLE) {\n-\t\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\"Bad qemu ack on postcopy set-mem-table (%d)\\n\",\n \t\t\t\tack_msg.request.master);\n \t\t\tgoto err_mmap;\n@@ -1079,13 +1079,13 @@ vhost_user_set_mem_table(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \n \t\t\tif (ioctl(dev->postcopy_ufd, UFFDIO_REGISTER,\n \t\t\t\t\t\t&reg_struct)) {\n-\t\t\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\t\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\t\"Failed to register ufd for region %d: (ufd = %d) %s\\n\",\n \t\t\t\t\ti, dev->postcopy_ufd,\n \t\t\t\t\tstrerror(errno));\n \t\t\t\tgoto err_mmap;\n \t\t\t}\n-\t\t\tRTE_LOG(INFO, VHOST_CONFIG,\n+\t\t\tVHOST_LOG_CONFIG(INFO,\n \t\t\t\t\"\\t userfaultfd registered for range : %llx - %llx\\n\",\n \t\t\t\treg_struct.range.start,\n \t\t\t\treg_struct.range.start +\n@@ -1162,7 +1162,7 @@ virtio_is_ready(struct virtio_net *dev)\n \t\t\treturn 0;\n \t}\n \n-\tRTE_LOG(INFO, VHOST_CONFIG,\n+\tVHOST_LOG_CONFIG(INFO,\n \t\t\"virtio is now ready for processing.\\n\");\n \treturn 1;\n }\n@@ -1180,7 +1180,7 @@ vhost_user_set_vring_call(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \t\tfile.fd = VIRTIO_INVALID_EVENTFD;\n \telse\n \t\tfile.fd = msg->fds[0];\n-\tRTE_LOG(INFO, VHOST_CONFIG,\n+\tVHOST_LOG_CONFIG(INFO,\n \t\t\"vring call idx:%d file:%d\\n\", file.index, file.fd);\n \n \tvq = dev->virtqueue[file.index];\n@@ -1198,7 +1198,7 @@ static int vhost_user_set_vring_err(struct virtio_net **pdev __rte_unused,\n {\n \tif (!(msg->payload.u64 & VHOST_USER_VRING_NOFD_MASK))\n \t\tclose(msg->fds[0]);\n-\tRTE_LOG(INFO, VHOST_CONFIG, \"not implemented\\n\");\n+\tVHOST_LOG_CONFIG(INFO, \"not implemented\\n\");\n \n \treturn RTE_VHOST_MSG_RESULT_OK;\n }\n@@ -1216,7 +1216,7 @@ vhost_user_set_vring_kick(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \t\tfile.fd = VIRTIO_INVALID_EVENTFD;\n \telse\n \t\tfile.fd = msg->fds[0];\n-\tRTE_LOG(INFO, VHOST_CONFIG,\n+\tVHOST_LOG_CONFIG(INFO,\n \t\t\"vring kick idx:%d file:%d\\n\", file.index, file.fd);\n \n \t/* Interpret ring addresses only when ring is started. */\n@@ -1286,7 +1286,7 @@ vhost_user_get_vring_base(struct virtio_net **pdev,\n \t\tmsg->payload.state.num = vq->last_avail_idx;\n \t}\n \n-\tRTE_LOG(INFO, VHOST_CONFIG,\n+\tVHOST_LOG_CONFIG(INFO,\n \t\t\"vring base idx:%d file:%d\\n\", msg->payload.state.index,\n \t\tmsg->payload.state.num);\n \t/*\n@@ -1340,7 +1340,7 @@ vhost_user_set_vring_enable(struct virtio_net **pdev,\n \tstruct rte_vdpa_device *vdpa_dev;\n \tint did = -1;\n \n-\tRTE_LOG(INFO, VHOST_CONFIG,\n+\tVHOST_LOG_CONFIG(INFO,\n \t\t\"set queue enable: %d to qp idx: %d\\n\",\n \t\tenable, index);\n \n@@ -1401,14 +1401,14 @@ vhost_user_set_protocol_features(struct virtio_net **pdev,\n \trte_vhost_driver_get_protocol_features(dev->ifname,\n \t\t\t&slave_protocol_features);\n \tif (protocol_features & ~slave_protocol_features) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"(%d) received invalid protocol features.\\n\",\n \t\t\tdev->vid);\n \t\treturn RTE_VHOST_MSG_RESULT_ERR;\n \t}\n \n \tdev->protocol_features = protocol_features;\n-\tRTE_LOG(INFO, VHOST_CONFIG,\n+\tVHOST_LOG_CONFIG(INFO,\n \t\t\"negotiated Vhost-user protocol features: 0x%\" PRIx64 \"\\n\",\n \t\tdev->protocol_features);\n \n@@ -1425,12 +1425,12 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \tvoid *addr;\n \n \tif (fd < 0) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG, \"invalid log fd: %d\\n\", fd);\n+\t\tVHOST_LOG_CONFIG(ERR, \"invalid log fd: %d\\n\", fd);\n \t\treturn RTE_VHOST_MSG_RESULT_ERR;\n \t}\n \n \tif (msg->size != sizeof(VhostUserLog)) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"invalid log base msg size: %\"PRId32\" != %d\\n\",\n \t\t\tmsg->size, (int)sizeof(VhostUserLog));\n \t\treturn RTE_VHOST_MSG_RESULT_ERR;\n@@ -1441,13 +1441,13 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \n \t/* Don't allow mmap_offset to point outside the mmap region */\n \tif (off > size) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"log offset %#\"PRIx64\" exceeds log size %#\"PRIx64\"\\n\",\n \t\t\toff, size);\n \t\treturn RTE_VHOST_MSG_RESULT_ERR;\n \t}\n \n-\tRTE_LOG(INFO, VHOST_CONFIG,\n+\tVHOST_LOG_CONFIG(INFO,\n \t\t\"log mmap size: %\"PRId64\", offset: %\"PRId64\"\\n\",\n \t\tsize, off);\n \n@@ -1458,7 +1458,7 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \taddr = mmap(0, size + off, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);\n \tclose(fd);\n \tif (addr == MAP_FAILED) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG, \"mmap log base failed!\\n\");\n+\t\tVHOST_LOG_CONFIG(ERR, \"mmap log base failed!\\n\");\n \t\treturn RTE_VHOST_MSG_RESULT_ERR;\n \t}\n \n@@ -1488,7 +1488,7 @@ static int vhost_user_set_log_fd(struct virtio_net **pdev __rte_unused,\n \t\t\tint main_fd __rte_unused)\n {\n \tclose(msg->fds[0]);\n-\tRTE_LOG(INFO, VHOST_CONFIG, \"not implemented.\\n\");\n+\tVHOST_LOG_CONFIG(INFO, \"not implemented.\\n\");\n \n \treturn RTE_VHOST_MSG_RESULT_OK;\n }\n@@ -1510,7 +1510,7 @@ vhost_user_send_rarp(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \tstruct rte_vdpa_device *vdpa_dev;\n \tint did = -1;\n \n-\tRTE_LOG(DEBUG, VHOST_CONFIG,\n+\tVHOST_LOG_CONFIG(DEBUG,\n \t\t\":: mac: %02x:%02x:%02x:%02x:%02x:%02x\\n\",\n \t\tmac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);\n \tmemcpy(dev->mac.addr_bytes, mac, 6);\n@@ -1539,7 +1539,7 @@ vhost_user_net_set_mtu(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \tstruct virtio_net *dev = *pdev;\n \tif (msg->payload.u64 < VIRTIO_MIN_MTU ||\n \t\t\tmsg->payload.u64 > VIRTIO_MAX_MTU) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG, \"Invalid MTU size (%\"PRIu64\")\\n\",\n+\t\tVHOST_LOG_CONFIG(ERR, \"Invalid MTU size (%\"PRIu64\")\\n\",\n \t\t\t\tmsg->payload.u64);\n \n \t\treturn RTE_VHOST_MSG_RESULT_ERR;\n@@ -1558,7 +1558,7 @@ vhost_user_set_req_fd(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \tint fd = msg->fds[0];\n \n \tif (fd < 0) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\"Invalid file descriptor for slave channel (%d)\\n\",\n \t\t\t\tfd);\n \t\treturn RTE_VHOST_MSG_RESULT_ERR;\n@@ -1656,7 +1656,7 @@ vhost_user_iotlb_msg(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \t\t}\n \t\tbreak;\n \tdefault:\n-\t\tRTE_LOG(ERR, VHOST_CONFIG, \"Invalid IOTLB message type (%d)\\n\",\n+\t\tVHOST_LOG_CONFIG(ERR, \"Invalid IOTLB message type (%d)\\n\",\n \t\t\t\timsg->type);\n \t\treturn RTE_VHOST_MSG_RESULT_ERR;\n \t}\n@@ -1676,14 +1676,14 @@ vhost_user_set_postcopy_advise(struct virtio_net **pdev,\n \tdev->postcopy_ufd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);\n \n \tif (dev->postcopy_ufd == -1) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG, \"Userfaultfd not available: %s\\n\",\n+\t\tVHOST_LOG_CONFIG(ERR, \"Userfaultfd not available: %s\\n\",\n \t\t\tstrerror(errno));\n \t\treturn RTE_VHOST_MSG_RESULT_ERR;\n \t}\n \tapi_struct.api = UFFD_API;\n \tapi_struct.features = 0;\n \tif (ioctl(dev->postcopy_ufd, UFFDIO_API, &api_struct)) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG, \"UFFDIO_API ioctl failure: %s\\n\",\n+\t\tVHOST_LOG_CONFIG(ERR, \"UFFDIO_API ioctl failure: %s\\n\",\n \t\t\tstrerror(errno));\n \t\tclose(dev->postcopy_ufd);\n \t\tdev->postcopy_ufd = -1;\n@@ -1709,7 +1709,7 @@ vhost_user_set_postcopy_listen(struct virtio_net **pdev,\n \tstruct virtio_net *dev = *pdev;\n \n \tif (dev->mem && dev->mem->nregions) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"Regions already registered at postcopy-listen\\n\");\n \t\treturn RTE_VHOST_MSG_RESULT_ERR;\n \t}\n@@ -1783,7 +1783,7 @@ read_vhost_message(int sockfd, struct VhostUserMsg *msg)\n \n \tif (msg->size) {\n \t\tif (msg->size > sizeof(msg->payload)) {\n-\t\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\"invalid msg size: %d\\n\", msg->size);\n \t\t\treturn -1;\n \t\t}\n@@ -1791,7 +1791,7 @@ read_vhost_message(int sockfd, struct VhostUserMsg *msg)\n \t\tif (ret <= 0)\n \t\t\treturn ret;\n \t\tif (ret != (int)msg->size) {\n-\t\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\"read control message failed\\n\");\n \t\t\treturn -1;\n \t\t}\n@@ -1867,7 +1867,7 @@ vhost_user_check_and_alloc_queue_pair(struct virtio_net *dev,\n \t}\n \n \tif (vring_idx >= VHOST_MAX_VRING) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"invalid vring index: %u\\n\", vring_idx);\n \t\treturn -1;\n \t}\n@@ -1931,7 +1931,7 @@ vhost_user_msg_handler(int vid, int fd)\n \tif (!dev->notify_ops) {\n \t\tdev->notify_ops = vhost_driver_callback_get(dev->ifname);\n \t\tif (!dev->notify_ops) {\n-\t\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\"failed to get callback ops for driver %s\\n\",\n \t\t\t\tdev->ifname);\n \t\t\treturn -1;\n@@ -1941,10 +1941,10 @@ vhost_user_msg_handler(int vid, int fd)\n \tret = read_vhost_message(fd, &msg);\n \tif (ret <= 0) {\n \t\tif (ret < 0)\n-\t\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\"vhost read message failed\\n\");\n \t\telse\n-\t\t\tRTE_LOG(INFO, VHOST_CONFIG,\n+\t\t\tVHOST_LOG_CONFIG(INFO,\n \t\t\t\t\"vhost peer closed\\n\");\n \n \t\treturn -1;\n@@ -1955,18 +1955,18 @@ vhost_user_msg_handler(int vid, int fd)\n \tif (request > VHOST_USER_NONE && request < VHOST_USER_MAX &&\n \t\t\tvhost_message_str[request]) {\n \t\tif (request != VHOST_USER_IOTLB_MSG)\n-\t\t\tRTE_LOG(INFO, VHOST_CONFIG, \"read message %s\\n\",\n+\t\t\tVHOST_LOG_CONFIG(INFO, \"read message %s\\n\",\n \t\t\t\tvhost_message_str[request]);\n \t\telse\n-\t\t\tRTE_LOG(DEBUG, VHOST_CONFIG, \"read message %s\\n\",\n+\t\t\tVHOST_LOG_CONFIG(DEBUG, \"read message %s\\n\",\n \t\t\t\tvhost_message_str[request]);\n \t} else {\n-\t\tRTE_LOG(DEBUG, VHOST_CONFIG, \"External request %d\\n\", request);\n+\t\tVHOST_LOG_CONFIG(DEBUG, \"External request %d\\n\", request);\n \t}\n \n \tret = vhost_user_check_and_alloc_queue_pair(dev, &msg);\n \tif (ret < 0) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"failed to alloc queue\\n\");\n \t\treturn -1;\n \t}\n@@ -2028,19 +2028,19 @@ vhost_user_msg_handler(int vid, int fd)\n \n \t\tswitch (ret) {\n \t\tcase RTE_VHOST_MSG_RESULT_ERR:\n-\t\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\"Processing %s failed.\\n\",\n \t\t\t\tvhost_message_str[request]);\n \t\t\thandled = true;\n \t\t\tbreak;\n \t\tcase RTE_VHOST_MSG_RESULT_OK:\n-\t\t\tRTE_LOG(DEBUG, VHOST_CONFIG,\n+\t\t\tVHOST_LOG_CONFIG(DEBUG,\n \t\t\t\t\"Processing %s succeeded.\\n\",\n \t\t\t\tvhost_message_str[request]);\n \t\t\thandled = true;\n \t\t\tbreak;\n \t\tcase RTE_VHOST_MSG_RESULT_REPLY:\n-\t\t\tRTE_LOG(DEBUG, VHOST_CONFIG,\n+\t\t\tVHOST_LOG_CONFIG(DEBUG,\n \t\t\t\t\"Processing %s succeeded and needs reply.\\n\",\n \t\t\t\tvhost_message_str[request]);\n \t\t\tsend_vhost_reply(fd, &msg);\n@@ -2074,7 +2074,7 @@ vhost_user_msg_handler(int vid, int fd)\n \n \t/* If message was not handled at this stage, treat it as an error */\n \tif (!handled) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"vhost message (req: %d) was not handled.\\n\", request);\n \t\tret = RTE_VHOST_MSG_RESULT_ERR;\n \t}\n@@ -2090,7 +2090,7 @@ vhost_user_msg_handler(int vid, int fd)\n \t\tmsg.fd_num = 0;\n \t\tsend_vhost_reply(fd, &msg);\n \t} else if (ret == RTE_VHOST_MSG_RESULT_ERR) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"vhost message handling failed.\\n\");\n \t\treturn -1;\n \t}\n@@ -2100,7 +2100,7 @@ vhost_user_msg_handler(int vid, int fd)\n \n \t\tif (!(dev->flags & VIRTIO_DEV_RUNNING)) {\n \t\t\tif (dev->dequeue_zero_copy) {\n-\t\t\t\tRTE_LOG(INFO, VHOST_CONFIG,\n+\t\t\t\tVHOST_LOG_CONFIG(INFO,\n \t\t\t\t\t\t\"dequeue zero copy is enabled\\n\");\n \t\t\t}\n \n@@ -2137,7 +2137,7 @@ static int process_slave_message_reply(struct virtio_net *dev,\n \t}\n \n \tif (msg_reply.request.slave != msg->request.slave) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"Received unexpected msg type (%u), expected %u\\n\",\n \t\t\tmsg_reply.request.slave, msg->request.slave);\n \t\tret = -1;\n@@ -2168,7 +2168,7 @@ vhost_user_iotlb_miss(struct virtio_net *dev, uint64_t iova, uint8_t perm)\n \n \tret = send_vhost_message(dev->slave_req_fd, &msg);\n \tif (ret < 0) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\t\"Failed to send IOTLB miss message (%d)\\n\",\n \t\t\t\tret);\n \t\treturn ret;\n@@ -2203,7 +2203,7 @@ static int vhost_user_slave_set_vring_host_notifier(struct virtio_net *dev,\n \n \tret = send_vhost_slave_message(dev, &msg);\n \tif (ret < 0) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\tVHOST_LOG_CONFIG(ERR,\n \t\t\t\"Failed to set host notifier (%d)\\n\", ret);\n \t\treturn ret;\n \t}\ndiff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c\nindex 5b85b832d..756ee9aa8 100644\n--- a/lib/librte_vhost/virtio_net.c\n+++ b/lib/librte_vhost/virtio_net.c\n@@ -680,7 +680,7 @@ copy_mbuf_to_desc(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \telse\n \t\thdr = (struct virtio_net_hdr_mrg_rxbuf *)(uintptr_t)hdr_addr;\n \n-\tVHOST_LOG_DEBUG(VHOST_DATA, \"(%d) RX: num merge buffers %d\\n\",\n+\tVHOST_LOG_DATA(DEBUG, \"(%d) RX: num merge buffers %d\\n\",\n \t\tdev->vid, num_buffers);\n \n \tif (unlikely(buf_len < dev->vhost_hlen)) {\n@@ -800,14 +800,14 @@ virtio_dev_rx_split(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\tif (unlikely(reserve_avail_buf_split(dev, vq,\n \t\t\t\t\t\tpkt_len, buf_vec, &num_buffers,\n \t\t\t\t\t\tavail_head, &nr_vec) < 0)) {\n-\t\t\tVHOST_LOG_DEBUG(VHOST_DATA,\n+\t\t\tVHOST_LOG_DATA(DEBUG,\n \t\t\t\t\"(%d) failed to get enough desc from vring\\n\",\n \t\t\t\tdev->vid);\n \t\t\tvq->shadow_used_idx -= num_buffers;\n \t\t\tbreak;\n \t\t}\n \n-\t\tVHOST_LOG_DEBUG(VHOST_DATA, \"(%d) current index %d | end index %d\\n\",\n+\t\tVHOST_LOG_DATA(DEBUG, \"(%d) current index %d | end index %d\\n\",\n \t\t\tdev->vid, vq->last_avail_idx,\n \t\t\tvq->last_avail_idx + num_buffers);\n \n@@ -847,14 +847,14 @@ virtio_dev_rx_packed(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\tif (unlikely(reserve_avail_buf_packed(dev, vq,\n \t\t\t\t\t\tpkt_len, buf_vec, &nr_vec,\n \t\t\t\t\t\t&num_buffers, &nr_descs) < 0)) {\n-\t\t\tVHOST_LOG_DEBUG(VHOST_DATA,\n+\t\t\tVHOST_LOG_DATA(DEBUG,\n \t\t\t\t\"(%d) failed to get enough desc from vring\\n\",\n \t\t\t\tdev->vid);\n \t\t\tvq->shadow_used_idx -= num_buffers;\n \t\t\tbreak;\n \t\t}\n \n-\t\tVHOST_LOG_DEBUG(VHOST_DATA, \"(%d) current index %d | end index %d\\n\",\n+\t\tVHOST_LOG_DATA(DEBUG, \"(%d) current index %d | end index %d\\n\",\n \t\t\tdev->vid, vq->last_avail_idx,\n \t\t\tvq->last_avail_idx + num_buffers);\n \n@@ -889,9 +889,9 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id,\n \tstruct vhost_virtqueue *vq;\n \tuint32_t nb_tx = 0;\n \n-\tVHOST_LOG_DEBUG(VHOST_DATA, \"(%d) %s\\n\", dev->vid, __func__);\n+\tVHOST_LOG_DATA(DEBUG, \"(%d) %s\\n\", dev->vid, __func__);\n \tif (unlikely(!is_valid_virt_queue_idx(queue_id, 0, dev->nr_vring))) {\n-\t\tRTE_LOG(ERR, VHOST_DATA, \"(%d) %s: invalid virtqueue idx %d.\\n\",\n+\t\tVHOST_LOG_DATA(ERR, \"(%d) %s: invalid virtqueue idx %d.\\n\",\n \t\t\tdev->vid, __func__, queue_id);\n \t\treturn 0;\n \t}\n@@ -939,7 +939,7 @@ rte_vhost_enqueue_burst(int vid, uint16_t queue_id,\n \t\treturn 0;\n \n \tif (unlikely(!(dev->flags & VIRTIO_DEV_BUILTIN_VIRTIO_NET))) {\n-\t\tRTE_LOG(ERR, VHOST_DATA,\n+\t\tVHOST_LOG_DATA(ERR,\n \t\t\t\"(%d) %s: built-in vhost net backend is disabled.\\n\",\n \t\t\tdev->vid, __func__);\n \t\treturn 0;\n@@ -1056,7 +1056,7 @@ vhost_dequeue_offload(struct virtio_net_hdr *hdr, struct rte_mbuf *m)\n \t\t\tm->l4_len = sizeof(struct rte_udp_hdr);\n \t\t\tbreak;\n \t\tdefault:\n-\t\t\tRTE_LOG(WARNING, VHOST_DATA,\n+\t\t\tVHOST_LOG_DATA(WARNING,\n \t\t\t\t\"unsupported gso type %u.\\n\", hdr->gso_type);\n \t\t\tbreak;\n \t\t}\n@@ -1228,7 +1228,7 @@ copy_desc_to_mbuf(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\tif (mbuf_avail == 0) {\n \t\t\tcur = rte_pktmbuf_alloc(mbuf_pool);\n \t\t\tif (unlikely(cur == NULL)) {\n-\t\t\t\tRTE_LOG(ERR, VHOST_DATA, \"Failed to \"\n+\t\t\t\tVHOST_LOG_DATA(ERR, \"Failed to \"\n \t\t\t\t\t\"allocate memory for mbuf.\\n\");\n \t\t\t\terror = -1;\n \t\t\t\tgoto out;\n@@ -1333,11 +1333,11 @@ virtio_dev_tx_split(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \n \trte_prefetch0(&vq->avail->ring[vq->last_avail_idx & (vq->size - 1)]);\n \n-\tVHOST_LOG_DEBUG(VHOST_DATA, \"(%d) %s\\n\", dev->vid, __func__);\n+\tVHOST_LOG_DATA(DEBUG, \"(%d) %s\\n\", dev->vid, __func__);\n \n \tcount = RTE_MIN(count, MAX_PKT_BURST);\n \tcount = RTE_MIN(count, free_entries);\n-\tVHOST_LOG_DEBUG(VHOST_DATA, \"(%d) about to dequeue %u buffers\\n\",\n+\tVHOST_LOG_DATA(DEBUG, \"(%d) about to dequeue %u buffers\\n\",\n \t\t\tdev->vid, count);\n \n \tfor (i = 0; i < count; i++) {\n@@ -1359,7 +1359,7 @@ virtio_dev_tx_split(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \n \t\tpkts[i] = rte_pktmbuf_alloc(mbuf_pool);\n \t\tif (unlikely(pkts[i] == NULL)) {\n-\t\t\tRTE_LOG(ERR, VHOST_DATA,\n+\t\t\tVHOST_LOG_DATA(ERR,\n \t\t\t\t\"Failed to allocate memory for mbuf.\\n\");\n \t\t\tbreak;\n \t\t}\n@@ -1442,10 +1442,10 @@ virtio_dev_tx_packed(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\t}\n \t}\n \n-\tVHOST_LOG_DEBUG(VHOST_DATA, \"(%d) %s\\n\", dev->vid, __func__);\n+\tVHOST_LOG_DATA(DEBUG, \"(%d) %s\\n\", dev->vid, __func__);\n \n \tcount = RTE_MIN(count, MAX_PKT_BURST);\n-\tVHOST_LOG_DEBUG(VHOST_DATA, \"(%d) about to dequeue %u buffers\\n\",\n+\tVHOST_LOG_DATA(DEBUG, \"(%d) about to dequeue %u buffers\\n\",\n \t\t\tdev->vid, count);\n \n \tfor (i = 0; i < count; i++) {\n@@ -1468,7 +1468,7 @@ virtio_dev_tx_packed(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \n \t\tpkts[i] = rte_pktmbuf_alloc(mbuf_pool);\n \t\tif (unlikely(pkts[i] == NULL)) {\n-\t\t\tRTE_LOG(ERR, VHOST_DATA,\n+\t\t\tVHOST_LOG_DATA(ERR,\n \t\t\t\t\"Failed to allocate memory for mbuf.\\n\");\n \t\t\tbreak;\n \t\t}\n@@ -1537,14 +1537,15 @@ rte_vhost_dequeue_burst(int vid, uint16_t queue_id,\n \t\treturn 0;\n \n \tif (unlikely(!(dev->flags & VIRTIO_DEV_BUILTIN_VIRTIO_NET))) {\n-\t\tRTE_LOG(ERR, VHOST_DATA,\n+\t\tVHOST_LOG_DATA(ERR,\n \t\t\t\"(%d) %s: built-in vhost net backend is disabled.\\n\",\n \t\t\tdev->vid, __func__);\n \t\treturn 0;\n \t}\n \n \tif (unlikely(!is_valid_virt_queue_idx(queue_id, 1, dev->nr_vring))) {\n-\t\tRTE_LOG(ERR, VHOST_DATA, \"(%d) %s: invalid virtqueue idx %d.\\n\",\n+\t\tVHOST_LOG_DATA(ERR,\n+\t\t\t\"(%d) %s: invalid virtqueue idx %d.\\n\",\n \t\t\tdev->vid, __func__, queue_id);\n \t\treturn 0;\n \t}\n@@ -1589,8 +1590,7 @@ rte_vhost_dequeue_burst(int vid, uint16_t queue_id,\n \n \t\trarp_mbuf = rte_net_make_rarp_packet(mbuf_pool, &dev->mac);\n \t\tif (rarp_mbuf == NULL) {\n-\t\t\tRTE_LOG(ERR, VHOST_DATA,\n-\t\t\t\t\"Failed to make RARP packet.\\n\");\n+\t\t\tVHOST_LOG_DATA(ERR, \"Failed to make RARP packet.\\n\");\n \t\t\tcount = 0;\n \t\t\tgoto out;\n \t\t}\n",
    "prefixes": [
        "RFC",
        "1/1"
    ]
}