get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 106581,
    "url": "https://patches.dpdk.org/api/patches/106581/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20220126095510.389566-8-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": "<20220126095510.389566-8-maxime.coquelin@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220126095510.389566-8-maxime.coquelin@redhat.com",
    "date": "2022-01-26T09:55:08",
    "name": "[v3,7/9] vhost: remove multi-line logs",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "5e3e250b186074afdbd76f58d9867b85fdc56fe8",
    "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/20220126095510.389566-8-maxime.coquelin@redhat.com/mbox/",
    "series": [
        {
            "id": 21382,
            "url": "https://patches.dpdk.org/api/series/21382/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=21382",
            "date": "2022-01-26T09:55:01",
            "name": "vhost: improve logging",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/21382/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/106581/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/106581/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 71B3CA04A8;\n\tWed, 26 Jan 2022 10:56:50 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 5AEE442712;\n\tWed, 26 Jan 2022 10:56:50 +0100 (CET)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.124])\n by mails.dpdk.org (Postfix) with ESMTP id A19264069D\n for <dev@dpdk.org>; Wed, 26 Jan 2022 10:56:48 +0100 (CET)",
            "from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com\n [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n us-mta-103-K0qR_vJNPMSOruAmx-lwNA-1; Wed, 26 Jan 2022 04:56:45 -0500",
            "from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com\n [10.5.11.13])\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 06DCE84DA42;\n Wed, 26 Jan 2022 09:56:44 +0000 (UTC)",
            "from max-t490s.redhat.com (unknown [10.39.208.28])\n by smtp.corp.redhat.com (Postfix) with ESMTP id BF64773153;\n Wed, 26 Jan 2022 09:56:03 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1643191008;\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=Slau6+zfUMxm3F7XWeOFkK31atDD+JWKGxOdeFtOW4E=;\n b=U1RwDQwmFRrCzmfIkjqAlkHdsQrg6RkuRGjeV5PMVMjv4DPQ6aiycMsChBG0jpBhyqJW2Q\n GMJf1URm3MCvFyHcwtObtE5VrIc2peUF9kcDC69/ItV/qeXW7zFmmGOeLzd2/UbgPyONQ5\n JnD22DHIIQJxWUiIjYQIaybhL6I3ieU=",
        "X-MC-Unique": "K0qR_vJNPMSOruAmx-lwNA-1",
        "From": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "To": "dev@dpdk.org,\n\tchenbo.xia@intel.com,\n\tdavid.marchand@redhat.com",
        "Cc": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "Subject": "[PATCH v3 7/9] vhost: remove multi-line logs",
        "Date": "Wed, 26 Jan 2022 10:55:08 +0100",
        "Message-Id": "<20220126095510.389566-8-maxime.coquelin@redhat.com>",
        "In-Reply-To": "<20220126095510.389566-1-maxime.coquelin@redhat.com>",
        "References": "<20220126095510.389566-1-maxime.coquelin@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.13",
        "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\"",
        "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"
    },
    "content": "This patch replaces multi-lines logs in multiple single-\nline logs in order to ease logs filtering based on their\nsocket path.\n\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\n lib/vhost/socket.c     |  10 ++--\n lib/vhost/vhost.c      |   8 ++--\n lib/vhost/vhost_user.c | 103 ++++++++++++++++++++---------------------\n 3 files changed, 59 insertions(+), 62 deletions(-)",
    "diff": "diff --git a/lib/vhost/socket.c b/lib/vhost/socket.c\nindex ad3471d6a9..c2f8013cd5 100644\n--- a/lib/vhost/socket.c\n+++ b/lib/vhost/socket.c\n@@ -868,8 +868,8 @@ rte_vhost_driver_register(const char *path, uint64_t flags)\n \tif (vsocket->async_copy &&\n \t\t(flags & (RTE_VHOST_USER_IOMMU_SUPPORT |\n \t\tRTE_VHOST_USER_POSTCOPY_SUPPORT))) {\n-\t\tVHOST_LOG_CONFIG(ERR, \"(%s) enabling async copy and IOMMU \"\n-\t\t\t\"or post-copy feature simultaneously is not supported\\n\", path);\n+\t\tVHOST_LOG_CONFIG(ERR, \"(%s) async copy with IOMMU or post-copy not supported\\n\",\n+\t\t\t\tpath);\n \t\tgoto out_mutex;\n \t}\n \n@@ -908,8 +908,10 @@ rte_vhost_driver_register(const char *path, uint64_t flags)\n \t\t\t\t(1ULL << VIRTIO_NET_F_HOST_TSO6) |\n \t\t\t\t(1ULL << VIRTIO_NET_F_HOST_UFO);\n \n-\t\tVHOST_LOG_CONFIG(INFO, \"(%s) Linear buffers requested without external buffers, \"\n-\t\t\t\"disabling host segmentation offloading support\\n\", path);\n+\t\tVHOST_LOG_CONFIG(INFO, \"(%s) Linear buffers requested without external buffers,\\n\",\n+\t\t\t\tpath);\n+\t\tVHOST_LOG_CONFIG(INFO, \"(%s) disabling host segmentation offloading support\\n\",\n+\t\t\t\tpath);\n \t\tvsocket->supported_features &= ~seg_offload_features;\n \t\tvsocket->features &= ~seg_offload_features;\n \t}\ndiff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c\nindex 3b05f17a50..cd62dc238b 100644\n--- a/lib/vhost/vhost.c\n+++ b/lib/vhost/vhost.c\n@@ -1786,8 +1786,8 @@ rte_vhost_async_channel_unregister(int vid, uint16_t queue_id)\n \t}\n \n \tif (vq->async->pkts_inflight_n) {\n-\t\tVHOST_LOG_CONFIG(ERR, \"(%s) failed to unregister async channel. \"\n-\t\t\t\"async inflight packets must be completed before unregistration.\\n\",\n+\t\tVHOST_LOG_CONFIG(ERR, \"(%s) failed to unregister async channel.\\n\", dev->ifname);\n+\t\tVHOST_LOG_CONFIG(ERR, \"(%s) inflight packets must be completed before unregistration.\\n\",\n \t\t\tdev->ifname);\n \t\tret = -1;\n \t\tgoto out;\n@@ -1821,8 +1821,8 @@ rte_vhost_async_channel_unregister_thread_unsafe(int vid, uint16_t queue_id)\n \t\treturn 0;\n \n \tif (vq->async->pkts_inflight_n) {\n-\t\tVHOST_LOG_CONFIG(ERR, \"(%s) failed to unregister async channel. \"\n-\t\t\t\"async inflight packets must be completed before unregistration.\\n\",\n+\t\tVHOST_LOG_CONFIG(ERR, \"(%s) failed to unregister async channel.\\n\", dev->ifname);\n+\t\tVHOST_LOG_CONFIG(ERR, \"(%s) inflight packets must be completed before unregistration.\\n\",\n \t\t\tdev->ifname);\n \t\treturn -1;\n \t}\ndiff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c\nindex e207ace426..d54ac075cd 100644\n--- a/lib/vhost/vhost_user.c\n+++ b/lib/vhost/vhost_user.c\n@@ -872,13 +872,13 @@ translate_ring_addresses(struct virtio_net *dev, int vq_index)\n \t}\n \n \tif (vq->last_used_idx != vq->used->idx) {\n-\t\tVHOST_LOG_CONFIG(WARNING,\n-\t\t\t\"(%s) 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\tVHOST_LOG_CONFIG(WARNING, \"(%s) last_used_idx (%u) and vq->used->idx (%u) mismatches;\\n\",\n \t\t\tdev->ifname,\n \t\t\tvq->last_used_idx, vq->used->idx);\n \t\tvq->last_used_idx  = vq->used->idx;\n \t\tvq->last_avail_idx = vq->used->idx;\n+\t\tVHOST_LOG_CONFIG(WARNING, \"(%s) some packets maybe resent for Tx and dropped for Rx\\n\",\n+\t\t\tdev->ifname);\n \t}\n \n \tvq->access_ok = true;\n@@ -1066,15 +1066,14 @@ 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\tVHOST_LOG_CONFIG(INFO,\n-\t\t\t\"(%s) 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-\t\t\t\"\\t size           : %\" PRIx64 \"\\n\",\n-\t\t\tdev->ifname, i,\n-\t\t\tpage->guest_phys_addr,\n-\t\t\tpage->host_phys_addr,\n-\t\t\tpage->size);\n+\t\tVHOST_LOG_CONFIG(INFO, \"(%s) guest physical page region %u\\n\",\n+\t\t\t\tdev->ifname, i);\n+\t\tVHOST_LOG_CONFIG(INFO, \"(%s)\\tguest_phys_addr: %\" PRIx64 \"\\n\",\n+\t\t\t\tdev->ifname, page->guest_phys_addr);\n+\t\tVHOST_LOG_CONFIG(INFO, \"(%s)\\thost_phys_addr : %\" PRIx64 \"\\n\",\n+\t\t\t\tdev->ifname, page->host_phys_addr);\n+\t\tVHOST_LOG_CONFIG(INFO, \"(%s)\\tsize           : %\" PRIx64 \"\\n\",\n+\t\t\t\tdev->ifname, page->size);\n \t}\n }\n #else\n@@ -1133,7 +1132,8 @@ vhost_user_postcopy_region_register(struct virtio_net *dev,\n \t\treturn -1;\n \t}\n \n-\tVHOST_LOG_CONFIG(INFO, \"(%s)\\t userfaultfd registered for range : %\" PRIx64 \" - %\" PRIx64 \"\\n\",\n+\tVHOST_LOG_CONFIG(INFO,\n+\t\t\t\"(%s)\\t userfaultfd registered for range : %\" PRIx64 \" - %\" PRIx64 \"\\n\",\n \t\t\tdev->ifname,\n \t\t\t(uint64_t)reg_struct.range.start,\n \t\t\t(uint64_t)reg_struct.range.start +\n@@ -1218,8 +1218,7 @@ vhost_user_mmap_region(struct virtio_net *dev,\n \n \t/* Check for memory_size + mmap_offset overflow */\n \tif (mmap_offset >= -region->size) {\n-\t\tVHOST_LOG_CONFIG(ERR, \"(%s) mmap_offset (%#\"PRIx64\") and memory_size \"\n-\t\t\t\t\"(%#\"PRIx64\") overflow\\n\",\n+\t\tVHOST_LOG_CONFIG(ERR, \"(%s) mmap_offset (%#\"PRIx64\") and memory_size (%#\"PRIx64\") overflow\\n\",\n \t\t\t\tdev->ifname, mmap_offset, region->size);\n \t\treturn -1;\n \t}\n@@ -1248,8 +1247,7 @@ vhost_user_mmap_region(struct virtio_net *dev,\n \t\t * mmap() kernel implementation would return an error, but\n \t\t * better catch it before and provide useful info in the logs.\n \t\t */\n-\t\tVHOST_LOG_CONFIG(ERR, \"(%s) mmap size (0x%\" PRIx64 \") \"\n-\t\t\t\t\"or alignment (0x%\" PRIx64 \") is invalid\\n\",\n+\t\tVHOST_LOG_CONFIG(ERR, \"(%s) mmap size (0x%\" PRIx64 \") or alignment (0x%\" PRIx64 \") is invalid\\n\",\n \t\t\t\tdev->ifname, region->size + mmap_offset, alignment);\n \t\treturn -1;\n \t}\n@@ -1285,24 +1283,22 @@ vhost_user_mmap_region(struct virtio_net *dev,\n \t\t}\n \t}\n \n-\tVHOST_LOG_CONFIG(INFO,\n-\t\t\t\"(%s) guest memory region 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-\t\t\t\"\\t host  virtual  addr: 0x%\" PRIx64 \"\\n\"\n-\t\t\t\"\\t mmap addr : 0x%\" PRIx64 \"\\n\"\n-\t\t\t\"\\t mmap size : 0x%\" PRIx64 \"\\n\"\n-\t\t\t\"\\t mmap align: 0x%\" PRIx64 \"\\n\"\n-\t\t\t\"\\t mmap off  : 0x%\" PRIx64 \"\\n\",\n-\t\t\tdev->ifname,\n-\t\t\tregion->size,\n-\t\t\tregion->guest_phys_addr,\n-\t\t\tregion->guest_user_addr,\n-\t\t\tregion->host_user_addr,\n-\t\t\t(uint64_t)(uintptr_t)mmap_addr,\n-\t\t\tmmap_size,\n-\t\t\talignment,\n-\t\t\tmmap_offset);\n+\tVHOST_LOG_CONFIG(INFO, \"(%s) guest memory region size: 0x%\" PRIx64 \"\\n\",\n+\t\t\tdev->ifname, region->size);\n+\tVHOST_LOG_CONFIG(INFO, \"(%s)\\t guest physical addr: 0x%\" PRIx64 \"\\n\",\n+\t\t\tdev->ifname, region->guest_phys_addr);\n+\tVHOST_LOG_CONFIG(INFO, \"(%s)\\t guest virtual  addr: 0x%\" PRIx64 \"\\n\",\n+\t\t\tdev->ifname, region->guest_user_addr);\n+\tVHOST_LOG_CONFIG(INFO, \"(%s)\\t host  virtual  addr: 0x%\" PRIx64 \"\\n\",\n+\t\t\tdev->ifname, region->host_user_addr);\n+\tVHOST_LOG_CONFIG(INFO, \"(%s)\\t mmap addr : 0x%\" PRIx64 \"\\n\",\n+\t\t\tdev->ifname, (uint64_t)(uintptr_t)mmap_addr);\n+\tVHOST_LOG_CONFIG(INFO, \"(%s)\\t mmap size : 0x%\" PRIx64 \"\\n\",\n+\t\t\tdev->ifname, mmap_size);\n+\tVHOST_LOG_CONFIG(INFO, \"(%s)\\t mmap align: 0x%\" PRIx64 \"\\n\",\n+\t\t\tdev->ifname, alignment);\n+\tVHOST_LOG_CONFIG(INFO, \"(%s)\\t mmap off  : 0x%\" PRIx64 \"\\n\",\n+\t\t\tdev->ifname, mmap_offset);\n \n \treturn 0;\n }\n@@ -2201,9 +2197,9 @@ vhost_user_set_vring_enable(struct virtio_net **pdev,\n \n \tif (enable && dev->virtqueue[index]->async) {\n \t\tif (dev->virtqueue[index]->async->pkts_inflight_n) {\n-\t\t\tVHOST_LOG_CONFIG(ERR, \"(%s) failed to enable vring. \"\n-\t\t\t\"async inflight packets must be completed first\\n\",\n-\t\t\tdev->ifname);\n+\t\t\tVHOST_LOG_CONFIG(ERR,\n+\t\t\t\t\"(%s) failed to enable vring. Inflight packets must be completed first\\n\",\n+\t\t\t\tdev->ifname);\n \t\t\treturn RTE_VHOST_MSG_RESULT_ERR;\n \t\t}\n \t}\n@@ -2709,22 +2705,21 @@ vhost_user_set_status(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \t\tdev->status &= ~VIRTIO_DEVICE_STATUS_FEATURES_OK;\n \t}\n \n-\tVHOST_LOG_CONFIG(INFO, \"(%s) new device status(0x%08x):\\n\"\n-\t\t\t\"\\t-RESET: %u\\n\"\n-\t\t\t\"\\t-ACKNOWLEDGE: %u\\n\"\n-\t\t\t\"\\t-DRIVER: %u\\n\"\n-\t\t\t\"\\t-FEATURES_OK: %u\\n\"\n-\t\t\t\"\\t-DRIVER_OK: %u\\n\"\n-\t\t\t\"\\t-DEVICE_NEED_RESET: %u\\n\"\n-\t\t\t\"\\t-FAILED: %u\\n\",\n-\t\t\tdev->ifname,\n-\t\t\tdev->status,\n-\t\t\t(dev->status == VIRTIO_DEVICE_STATUS_RESET),\n-\t\t\t!!(dev->status & VIRTIO_DEVICE_STATUS_ACK),\n-\t\t\t!!(dev->status & VIRTIO_DEVICE_STATUS_DRIVER),\n-\t\t\t!!(dev->status & VIRTIO_DEVICE_STATUS_FEATURES_OK),\n-\t\t\t!!(dev->status & VIRTIO_DEVICE_STATUS_DRIVER_OK),\n-\t\t\t!!(dev->status & VIRTIO_DEVICE_STATUS_DEV_NEED_RESET),\n+\tVHOST_LOG_CONFIG(INFO, \"(%s) new device status(0x%08x):\\n\", dev->ifname,\n+\t\t\tdev->status);\n+\tVHOST_LOG_CONFIG(INFO, \"(%s)\\t-RESET: %u\\n\", dev->ifname,\n+\t\t\t(dev->status == VIRTIO_DEVICE_STATUS_RESET));\n+\tVHOST_LOG_CONFIG(INFO, \"(%s)\\t-ACKNOWLEDGE: %u\\n\", dev->ifname,\n+\t\t\t!!(dev->status & VIRTIO_DEVICE_STATUS_ACK));\n+\tVHOST_LOG_CONFIG(INFO, \"(%s)\\t-DRIVER: %u\\n\", dev->ifname,\n+\t\t\t!!(dev->status & VIRTIO_DEVICE_STATUS_DRIVER));\n+\tVHOST_LOG_CONFIG(INFO, \"(%s)\\t-FEATURES_OK: %u\\n\", dev->ifname,\n+\t\t\t!!(dev->status & VIRTIO_DEVICE_STATUS_FEATURES_OK));\n+\tVHOST_LOG_CONFIG(INFO, \"(%s)\\t-DRIVER_OK: %u\\n\", dev->ifname,\n+\t\t\t!!(dev->status & VIRTIO_DEVICE_STATUS_DRIVER_OK));\n+\tVHOST_LOG_CONFIG(INFO, \"(%s)\\t-DEVICE_NEED_RESET: %u\\n\", dev->ifname,\n+\t\t\t!!(dev->status & VIRTIO_DEVICE_STATUS_DEV_NEED_RESET));\n+\tVHOST_LOG_CONFIG(INFO, \"(%s)\\t-FAILED: %u\\n\", dev->ifname,\n \t\t\t!!(dev->status & VIRTIO_DEVICE_STATUS_FAILED));\n \n \treturn RTE_VHOST_MSG_RESULT_OK;\n",
    "prefixes": [
        "v3",
        "7/9"
    ]
}