get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 87322,
    "url": "https://patches.dpdk.org/api/patches/87322/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210126101639.250481-36-maxime.coquelin@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": "<20210126101639.250481-36-maxime.coquelin@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210126101639.250481-36-maxime.coquelin@redhat.com",
    "date": "2021-01-26T10:16:30",
    "name": "[v4,35/44] net/virtio: improve Virtio-user errors handling",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "68b3762879f363421508c85be10e991128a06118",
    "submitter": {
        "id": 512,
        "url": "https://patches.dpdk.org/api/people/512/?format=api",
        "name": "Maxime Coquelin",
        "email": "maxime.coquelin@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/20210126101639.250481-36-maxime.coquelin@redhat.com/mbox/",
    "series": [
        {
            "id": 14950,
            "url": "https://patches.dpdk.org/api/series/14950/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=14950",
            "date": "2021-01-26T10:15:55",
            "name": "net/virtio: Virtio PMD rework",
            "version": 4,
            "mbox": "https://patches.dpdk.org/series/14950/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/87322/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/87322/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id ADCB6A052A;\n\tTue, 26 Jan 2021 11:22:33 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 14AD0141406;\n\tTue, 26 Jan 2021 11:18:30 +0100 (CET)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [216.205.24.124])\n by mails.dpdk.org (Postfix) with ESMTP id 52FBF1413FD\n for <dev@dpdk.org>; Tue, 26 Jan 2021 11:18:26 +0100 (CET)",
            "from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com\n [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id\n us-mta-243-f7xxVjgEM2StAH2BlEtYNQ-1; Tue, 26 Jan 2021 05:18:21 -0500",
            "from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com\n [10.5.11.11])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A7B0BB8101;\n Tue, 26 Jan 2021 10:18:20 +0000 (UTC)",
            "from max-t490s.redhat.com (unknown [10.36.110.31])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 2228972163;\n Tue, 26 Jan 2021 10:18:18 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1611656305;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=Q6nQeaAQA6qHJaNHku9QRM4MLJqidXi9/m4h3BGWJoQ=;\n b=R28FVkfRE02ySazmkc6J5Tx4/tFxJVuykSg7VwNS06Gr+9w6gXL3n0pwGkXTdsfxZfGc1X\n PZjXwejP54MgNkVkdqusLPHX3L4x4+7oST1eOK0x8zE1G7nzAZMszy29b6KsmROVLAO9s5\n Gl7I+slS29XL11K5aD1mHdbalgZ9b8U=",
        "X-MC-Unique": "f7xxVjgEM2StAH2BlEtYNQ-1",
        "From": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "To": "dev@dpdk.org, chenbo.xia@intel.com, olivier.matz@6wind.com,\n amorenoz@redhat.com, david.marchand@redhat.com",
        "Cc": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "Date": "Tue, 26 Jan 2021 11:16:30 +0100",
        "Message-Id": "<20210126101639.250481-36-maxime.coquelin@redhat.com>",
        "In-Reply-To": "<20210126101639.250481-1-maxime.coquelin@redhat.com>",
        "References": "<20210126101639.250481-1-maxime.coquelin@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.11",
        "Authentication-Results": "relay.mimecast.com;\n auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain; charset=\"US-ASCII\"",
        "Subject": "[dpdk-dev] [PATCH v4 35/44] net/virtio: improve Virtio-user errors\n handling",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <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 <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This patch adds error logs and propagates errors reported\nby the backend. It also adds the device path in error logs\nto make it easier to distinguish which device is facing the\nissue.\n\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\nReviewed-by: Chenbo Xia <chenbo.xia@intel.com>\n---\n .../net/virtio/virtio_user/virtio_user_dev.c  | 154 ++++++++++++------\n 1 file changed, 104 insertions(+), 50 deletions(-)",
    "diff": "diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c\nindex 33a25f4684..95204ea955 100644\n--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c\n+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c\n@@ -37,10 +37,15 @@ virtio_user_create_queue(struct virtio_user_dev *dev, uint32_t queue_sel)\n \t * pair.\n \t */\n \tstruct vhost_vring_file file;\n+\tint ret;\n \n \tfile.index = queue_sel;\n \tfile.fd = dev->callfds[queue_sel];\n-\tdev->ops->set_vring_call(dev, &file);\n+\tret = dev->ops->set_vring_call(dev, &file);\n+\tif (ret < 0) {\n+\t\tPMD_INIT_LOG(ERR, \"(%s) Failed to create queue %u\\n\", dev->path, queue_sel);\n+\t\treturn -1;\n+\t}\n \n \treturn 0;\n }\n@@ -48,6 +53,7 @@ virtio_user_create_queue(struct virtio_user_dev *dev, uint32_t queue_sel)\n static int\n virtio_user_kick_queue(struct virtio_user_dev *dev, uint32_t queue_sel)\n {\n+\tint ret;\n \tstruct vhost_vring_file file;\n \tstruct vhost_vring_state state;\n \tstruct vring *vring = &dev->vrings[queue_sel];\n@@ -73,15 +79,21 @@ virtio_user_kick_queue(struct virtio_user_dev *dev, uint32_t queue_sel)\n \n \tstate.index = queue_sel;\n \tstate.num = vring->num;\n-\tdev->ops->set_vring_num(dev, &state);\n+\tret = dev->ops->set_vring_num(dev, &state);\n+\tif (ret < 0)\n+\t\tgoto err;\n \n \tstate.index = queue_sel;\n \tstate.num = 0; /* no reservation */\n \tif (dev->features & (1ULL << VIRTIO_F_RING_PACKED))\n \t\tstate.num |= (1 << 15);\n-\tdev->ops->set_vring_base(dev, &state);\n+\tret = dev->ops->set_vring_base(dev, &state);\n+\tif (ret < 0)\n+\t\tgoto err;\n \n-\tdev->ops->set_vring_addr(dev, &addr);\n+\tret = dev->ops->set_vring_addr(dev, &addr);\n+\tif (ret < 0)\n+\t\tgoto err;\n \n \t/* Of all per virtqueue MSGs, make sure VHOST_USER_SET_VRING_KICK comes\n \t * lastly because vhost depends on this msg to judge if\n@@ -89,9 +101,15 @@ virtio_user_kick_queue(struct virtio_user_dev *dev, uint32_t queue_sel)\n \t */\n \tfile.index = queue_sel;\n \tfile.fd = dev->kickfds[queue_sel];\n-\tdev->ops->set_vring_kick(dev, &file);\n+\tret = dev->ops->set_vring_kick(dev, &file);\n+\tif (ret < 0)\n+\t\tgoto err;\n \n \treturn 0;\n+err:\n+\tPMD_INIT_LOG(ERR, \"(%s) Failed to kick queue %u\\n\", dev->path, queue_sel);\n+\n+\treturn -1;\n }\n \n static int\n@@ -103,14 +121,14 @@ virtio_user_queue_setup(struct virtio_user_dev *dev,\n \tfor (i = 0; i < dev->max_queue_pairs; ++i) {\n \t\tqueue_sel = 2 * i + VTNET_SQ_RQ_QUEUE_IDX;\n \t\tif (fn(dev, queue_sel) < 0) {\n-\t\t\tPMD_DRV_LOG(INFO, \"setup rx vq fails: %u\", i);\n+\t\t\tPMD_DRV_LOG(ERR, \"(%s) setup rx vq %u failed\", dev->path, i);\n \t\t\treturn -1;\n \t\t}\n \t}\n \tfor (i = 0; i < dev->max_queue_pairs; ++i) {\n \t\tqueue_sel = 2 * i + VTNET_SQ_TQ_QUEUE_IDX;\n \t\tif (fn(dev, queue_sel) < 0) {\n-\t\t\tPMD_DRV_LOG(INFO, \"setup tx vq fails: %u\", i);\n+\t\t\tPMD_DRV_LOG(INFO, \"(%s) setup tx vq %u failed\", dev->path, i);\n \t\t\treturn -1;\n \t\t}\n \t}\n@@ -144,7 +162,7 @@ virtio_user_dev_set_features(struct virtio_user_dev *dev)\n \tret = dev->ops->set_features(dev, features);\n \tif (ret < 0)\n \t\tgoto error;\n-\tPMD_DRV_LOG(INFO, \"set features: %\" PRIx64, features);\n+\tPMD_DRV_LOG(INFO, \"(%s) set features: 0x%\" PRIx64, dev->path, features);\n error:\n \tpthread_mutex_unlock(&dev->mutex);\n \n@@ -172,9 +190,10 @@ virtio_user_start_device(struct virtio_user_dev *dev)\n \trte_mcfg_mem_read_lock();\n \tpthread_mutex_lock(&dev->mutex);\n \n+\t/* Vhost-user client not connected yet, will start later */\n \tif (dev->backend_type == VIRTIO_USER_BACKEND_VHOST_USER &&\n \t\t\tdev->vhostfd < 0)\n-\t\tgoto error;\n+\t\tgoto out;\n \n \t/* Step 2: share memory regions */\n \tret = dev->ops->set_memory_table(dev);\n@@ -182,15 +201,19 @@ virtio_user_start_device(struct virtio_user_dev *dev)\n \t\tgoto error;\n \n \t/* Step 3: kick queues */\n-\tif (virtio_user_queue_setup(dev, virtio_user_kick_queue) < 0)\n+\tret = virtio_user_queue_setup(dev, virtio_user_kick_queue);\n+\tif (ret < 0)\n \t\tgoto error;\n \n \t/* Step 4: enable queues\n \t * we enable the 1st queue pair by default.\n \t */\n-\tdev->ops->enable_qp(dev, 0, 1);\n+\tret = dev->ops->enable_qp(dev, 0, 1);\n+\tif (ret < 0)\n+\t\tgoto error;\n \n \tdev->started = true;\n+out:\n \tpthread_mutex_unlock(&dev->mutex);\n \trte_mcfg_mem_read_unlock();\n \n@@ -198,6 +221,9 @@ virtio_user_start_device(struct virtio_user_dev *dev)\n error:\n \tpthread_mutex_unlock(&dev->mutex);\n \trte_mcfg_mem_read_unlock();\n+\n+\tPMD_INIT_LOG(ERR, \"(%s) Failed to start device\\n\", dev->path);\n+\n \t/* TODO: free resource here or caller to check */\n \treturn -1;\n }\n@@ -206,31 +232,40 @@ int virtio_user_stop_device(struct virtio_user_dev *dev)\n {\n \tstruct vhost_vring_state state;\n \tuint32_t i;\n-\tint error = 0;\n+\tint ret;\n \n \tpthread_mutex_lock(&dev->mutex);\n \tif (!dev->started)\n \t\tgoto out;\n \n-\tfor (i = 0; i < dev->max_queue_pairs; ++i)\n-\t\tdev->ops->enable_qp(dev, i, 0);\n+\tfor (i = 0; i < dev->max_queue_pairs; ++i) {\n+\t\tret = dev->ops->enable_qp(dev, i, 0);\n+\t\tif (ret < 0)\n+\t\t\tgoto err;\n+\t}\n \n \t/* Stop the backend. */\n \tfor (i = 0; i < dev->max_queue_pairs * 2; ++i) {\n \t\tstate.index = i;\n-\t\tif (dev->ops->get_vring_base(dev, &state) < 0) {\n-\t\t\tPMD_DRV_LOG(ERR, \"get_vring_base failed, index=%u\",\n-\t\t\t\t    i);\n-\t\t\terror = -1;\n-\t\t\tgoto out;\n+\t\tret = dev->ops->get_vring_base(dev, &state);\n+\t\tif (ret < 0) {\n+\t\t\tPMD_DRV_LOG(ERR, \"(%s) get_vring_base failed, index=%u\", dev->path, i);\n+\t\t\tgoto err;\n \t\t}\n \t}\n \n \tdev->started = false;\n+\n out:\n \tpthread_mutex_unlock(&dev->mutex);\n \n-\treturn error;\n+\treturn 0;\n+err:\n+\tpthread_mutex_unlock(&dev->mutex);\n+\n+\tPMD_INIT_LOG(ERR, \"(%s) Failed to stop device\\n\", dev->path);\n+\n+\treturn -1;\n }\n \n static inline void\n@@ -270,13 +305,13 @@ virtio_user_dev_init_notify(struct virtio_user_dev *dev)\n \t\t */\n \t\tcallfd = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK);\n \t\tif (callfd < 0) {\n-\t\t\tPMD_DRV_LOG(ERR, \"callfd error, %s\", strerror(errno));\n+\t\t\tPMD_DRV_LOG(ERR, \"(%s) callfd error, %s\", dev->path, strerror(errno));\n \t\t\tbreak;\n \t\t}\n \t\tkickfd = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK);\n \t\tif (kickfd < 0) {\n \t\t\tclose(callfd);\n-\t\t\tPMD_DRV_LOG(ERR, \"kickfd error, %s\", strerror(errno));\n+\t\t\tPMD_DRV_LOG(ERR, \"(%s) kickfd error, %s\", dev->path, strerror(errno));\n \t\t\tbreak;\n \t\t}\n \t\tdev->callfds[i] = callfd;\n@@ -304,7 +339,7 @@ virtio_user_fill_intr_handle(struct virtio_user_dev *dev)\n \tif (!eth_dev->intr_handle) {\n \t\teth_dev->intr_handle = malloc(sizeof(*eth_dev->intr_handle));\n \t\tif (!eth_dev->intr_handle) {\n-\t\t\tPMD_DRV_LOG(ERR, \"fail to allocate intr_handle\");\n+\t\t\tPMD_DRV_LOG(ERR, \"(%s) failed to allocate intr_handle\", dev->path);\n \t\t\treturn -1;\n \t\t}\n \t\tmemset(eth_dev->intr_handle, 0, sizeof(*eth_dev->intr_handle));\n@@ -335,6 +370,7 @@ virtio_user_mem_event_cb(enum rte_mem_event type __rte_unused,\n \tstruct virtio_user_dev *dev = arg;\n \tstruct rte_memseg_list *msl;\n \tuint16_t i;\n+\tint ret = 0;\n \n \t/* ignore externally allocated memory */\n \tmsl = rte_mem_virt2memseg_list(addr);\n@@ -347,18 +383,29 @@ virtio_user_mem_event_cb(enum rte_mem_event type __rte_unused,\n \t\tgoto exit;\n \n \t/* Step 1: pause the active queues */\n-\tfor (i = 0; i < dev->queue_pairs; i++)\n-\t\tdev->ops->enable_qp(dev, i, 0);\n+\tfor (i = 0; i < dev->queue_pairs; i++) {\n+\t\tret = dev->ops->enable_qp(dev, i, 0);\n+\t\tif (ret < 0)\n+\t\t\tgoto exit;\n+\t}\n \n \t/* Step 2: update memory regions */\n-\tdev->ops->set_memory_table(dev);\n+\tret = dev->ops->set_memory_table(dev);\n+\tif (ret < 0)\n+\t\tgoto exit;\n \n \t/* Step 3: resume the active queues */\n-\tfor (i = 0; i < dev->queue_pairs; i++)\n-\t\tdev->ops->enable_qp(dev, i, 1);\n+\tfor (i = 0; i < dev->queue_pairs; i++) {\n+\t\tret = dev->ops->enable_qp(dev, i, 1);\n+\t\tif (ret < 0)\n+\t\t\tgoto exit;\n+\t}\n \n exit:\n \tpthread_mutex_unlock(&dev->mutex);\n+\n+\tif (ret < 0)\n+\t\tPMD_DRV_LOG(ERR, \"(%s) Failed to update memory table\\n\", dev->path);\n }\n \n static int\n@@ -388,7 +435,7 @@ virtio_user_dev_setup(struct virtio_user_dev *dev)\n \t\t\tdev->tapfds = malloc(dev->max_queue_pairs *\n \t\t\t\t\t     sizeof(int));\n \t\t\tif (!dev->vhostfds || !dev->tapfds) {\n-\t\t\t\tPMD_INIT_LOG(ERR, \"Failed to malloc\");\n+\t\t\t\tPMD_INIT_LOG(ERR, \"(%s) Failed to allocate FDs\", dev->path);\n \t\t\t\treturn -1;\n \t\t\t}\n \n@@ -400,19 +447,25 @@ virtio_user_dev_setup(struct virtio_user_dev *dev)\n \t\t\t\tVIRTIO_USER_BACKEND_VHOST_VDPA) {\n \t\t\tdev->ops = &virtio_ops_vdpa;\n \t\t} else {\n-\t\t\tPMD_DRV_LOG(ERR, \"Unknown backend type\");\n+\t\t\tPMD_DRV_LOG(ERR, \"(%s) Unknown backend type\", dev->path);\n \t\t\treturn -1;\n \t\t}\n \t}\n \n-\tif (dev->ops->setup(dev) < 0)\n+\tif (dev->ops->setup(dev) < 0) {\n+\t\tPMD_INIT_LOG(ERR, \"(%s) Failed to setup backend\\n\", dev->path);\n \t\treturn -1;\n+\t}\n \n-\tif (virtio_user_dev_init_notify(dev) < 0)\n+\tif (virtio_user_dev_init_notify(dev) < 0) {\n+\t\tPMD_INIT_LOG(ERR, \"(%s) Failed to init notifiers\\n\", dev->path);\n \t\treturn -1;\n+\t}\n \n-\tif (virtio_user_fill_intr_handle(dev) < 0)\n+\tif (virtio_user_fill_intr_handle(dev) < 0) {\n+\t\tPMD_INIT_LOG(ERR, \"(%s) Failed to init interrupt handler\\n\", dev->path);\n \t\treturn -1;\n+\t}\n \n \treturn 0;\n }\n@@ -480,7 +533,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,\n \t}\n \n \tif (virtio_user_dev_setup(dev) < 0) {\n-\t\tPMD_INIT_LOG(ERR, \"backend set up fails\");\n+\t\tPMD_INIT_LOG(ERR, \"(%s) backend set up fails\", dev->path);\n \t\treturn -1;\n \t}\n \n@@ -490,27 +543,31 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,\n \n \tif (!dev->is_server) {\n \t\tif (dev->ops->set_owner(dev) < 0) {\n-\t\t\tPMD_INIT_LOG(ERR, \"set_owner fails: %s\",\n-\t\t\t\t     strerror(errno));\n+\t\t\tPMD_INIT_LOG(ERR, \"(%s) Failed to set backend owner\", dev->path);\n \t\t\treturn -1;\n \t\t}\n \n \t\tif (dev->ops->get_features(dev, &dev->device_features) < 0) {\n-\t\t\tPMD_INIT_LOG(ERR, \"get_features failed: %s\",\n-\t\t\t\t     strerror(errno));\n+\t\t\tPMD_INIT_LOG(ERR, \"(%s) Failed to get backend features\", dev->path);\n \t\t\treturn -1;\n \t\t}\n \n \n \t\tif ((dev->device_features & (1ULL << VHOST_USER_F_PROTOCOL_FEATURES)) ||\n \t\t\t\t(dev->backend_type == VIRTIO_USER_BACKEND_VHOST_VDPA)) {\n-\t\t\tif (dev->ops->get_protocol_features(dev, &protocol_features))\n+\t\t\tif (dev->ops->get_protocol_features(dev, &protocol_features)) {\n+\t\t\t\tPMD_INIT_LOG(ERR, \"(%s) Failed to get backend protocol features\",\n+\t\t\t\t\t\tdev->path);\n \t\t\t\treturn -1;\n+\t\t\t}\n \n \t\t\tdev->protocol_features &= protocol_features;\n \n-\t\t\tif (dev->ops->set_protocol_features(dev, dev->protocol_features))\n+\t\t\tif (dev->ops->set_protocol_features(dev, dev->protocol_features)) {\n+\t\t\t\tPMD_INIT_LOG(ERR, \"(%s) Failed to set backend protocol features\",\n+\t\t\t\t\t\tdev->path);\n \t\t\t\treturn -1;\n+\t\t\t}\n \n \t\t\tif (!(dev->protocol_features & (1ULL << VHOST_USER_PROTOCOL_F_MQ)))\n \t\t\t\tdev->unsupported_features |= (1ull << VIRTIO_NET_F_MQ);\n@@ -577,8 +634,8 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,\n \tif (rte_mem_event_callback_register(VIRTIO_USER_MEM_EVENT_CLB_NAME,\n \t\t\t\tvirtio_user_mem_event_cb, dev)) {\n \t\tif (rte_errno != ENOTSUP) {\n-\t\t\tPMD_INIT_LOG(ERR, \"Failed to register mem event\"\n-\t\t\t\t\t\" callback\\n\");\n+\t\t\tPMD_INIT_LOG(ERR, \"(%s) Failed to register mem event callback\\n\",\n+\t\t\t\t\tdev->path);\n \t\t\treturn -1;\n \t\t}\n \t}\n@@ -631,8 +688,8 @@ virtio_user_handle_mq(struct virtio_user_dev *dev, uint16_t q_pairs)\n \tuint8_t ret = 0;\n \n \tif (q_pairs > dev->max_queue_pairs) {\n-\t\tPMD_INIT_LOG(ERR, \"multi-q config %u, but only %u supported\",\n-\t\t\t     q_pairs, dev->max_queue_pairs);\n+\t\tPMD_INIT_LOG(ERR, \"(%s) multi-q config %u, but only %u supported\",\n+\t\t\t     dev->path, q_pairs, dev->max_queue_pairs);\n \t\treturn -1;\n \t}\n \n@@ -818,10 +875,8 @@ virtio_user_dev_set_status(struct virtio_user_dev *dev, uint8_t status)\n \tpthread_mutex_lock(&dev->mutex);\n \tdev->status = status;\n \tret = dev->ops->set_status(dev, status);\n-\tif (ret && ret != -ENOTSUP) {\n-\t\tPMD_INIT_LOG(ERR, \"Virtio-user set status failed (%d): %s\", ret,\n-\t\t\t     strerror(errno));\n-\t}\n+\tif (ret && ret != -ENOTSUP)\n+\t\tPMD_INIT_LOG(ERR, \"(%s) Failed to set backend status\\n\", dev->path);\n \n \tpthread_mutex_unlock(&dev->mutex);\n \treturn ret;\n@@ -855,8 +910,7 @@ virtio_user_dev_update_status(struct virtio_user_dev *dev)\n \t\t\t!!(dev->status & VIRTIO_CONFIG_STATUS_DEV_NEED_RESET),\n \t\t\t!!(dev->status & VIRTIO_CONFIG_STATUS_FAILED));\n \t} else if (ret != -ENOTSUP) {\n-\t\tPMD_INIT_LOG(ERR, \"Virtio-user get status failed (%d): %s\", ret,\n-\t\t\t     strerror(errno));\n+\t\tPMD_INIT_LOG(ERR, \"(%s) Failed to get backend status\\n\", dev->path);\n \t}\n \n \tpthread_mutex_unlock(&dev->mutex);\n",
    "prefixes": [
        "v4",
        "35/44"
    ]
}