get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 118515,
    "url": "http://patches.dpdk.org/api/patches/118515/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1666168884-104665-4-git-send-email-andy.pei@intel.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<1666168884-104665-4-git-send-email-andy.pei@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1666168884-104665-4-git-send-email-andy.pei@intel.com",
    "date": "2022-10-19T08:41:15",
    "name": "[v9,03/12] vdpa/ifc: set max queues based on virtio spec",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "29983ac22d5c269a94d8760b7fe7aefac51c8471",
    "submitter": {
        "id": 1185,
        "url": "http://patches.dpdk.org/api/people/1185/?format=api",
        "name": "Pei, Andy",
        "email": "andy.pei@intel.com"
    },
    "delegate": {
        "id": 2642,
        "url": "http://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1666168884-104665-4-git-send-email-andy.pei@intel.com/mbox/",
    "series": [
        {
            "id": 25297,
            "url": "http://patches.dpdk.org/api/series/25297/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=25297",
            "date": "2022-10-19T08:41:12",
            "name": "vdpa/ifc: add multi queue support",
            "version": 9,
            "mbox": "http://patches.dpdk.org/series/25297/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/118515/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/118515/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 A9978A0581;\n\tWed, 19 Oct 2022 11:32:00 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 4992842825;\n\tWed, 19 Oct 2022 11:31:52 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n by mails.dpdk.org (Postfix) with ESMTP id 7176D4281B\n for <dev@dpdk.org>; Wed, 19 Oct 2022 11:31:50 +0200 (CEST)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 19 Oct 2022 02:31:46 -0700",
            "from dpdk-dipei.sh.intel.com ([10.67.110.251])\n by fmsmga001.fm.intel.com with ESMTP; 19 Oct 2022 02:31:44 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1666171910; x=1697707910;\n h=from:to:cc:subject:date:message-id:in-reply-to: references;\n bh=B8ztTGzaGj+iPoPQvv5PN5iCSJ5ejZf1TdCqRnf0ebI=;\n b=NLiad570grByIryoZg37g9gRkPv6ZHShxkZzzJOhyD2TeRbBXtmCiT7r\n f2uwqxvo3MY0jkolhhOeVPihInzY6W3StVKdXkXrmeDBGRpGw4W8A+qbO\n XAU4ndg43pj47xW9htfG5E+UPdFdJIAnbM64+BCksE2OMQslPAqbVGqdv\n E0pyWLHa2PzVN1M+Vwr5FQ1zIPfdbdTYlN0MpUlHMc2d9Nnw//yTJbDWl\n PQTT4VberAVvQB/GKAg54iIL6CPCi91mFPjQrCTuhVNkUtu5ldLU1Nbwn\n aqh+KM6EP6/2AX61P9xEQm4HKQ4h0X3/KyEIfZDzf4sZg4cHhA7N8HFBH g==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6500,9779,10504\"; a=\"303976912\"",
            "E=Sophos;i=\"5.95,195,1661842800\"; d=\"scan'208\";a=\"303976912\"",
            "E=McAfee;i=\"6500,9779,10504\"; a=\"771690882\"",
            "E=Sophos;i=\"5.95,195,1661842800\"; d=\"scan'208\";a=\"771690882\""
        ],
        "X-ExtLoop1": "1",
        "From": "Andy Pei <andy.pei@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "chenbo.xia@intel.com, rosen.xu@intel.com, wei.huang@intel.com,\n gang.cao@intel.com, maxime.coquelin@redhat.com",
        "Subject": "[PATCH v9 03/12] vdpa/ifc: set max queues based on virtio spec",
        "Date": "Wed, 19 Oct 2022 16:41:15 +0800",
        "Message-Id": "<1666168884-104665-4-git-send-email-andy.pei@intel.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1666168884-104665-1-git-send-email-andy.pei@intel.com>",
        "References": "<1661229305-240952-2-git-send-email-andy.pei@intel.com>\n <1666168884-104665-1-git-send-email-andy.pei@intel.com>",
        "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": "Set max_queues according to virtio spec.\nFor virtio BLK device, set max_queues to the value of num_queues\nin struct virtio_blk_config.\nFor virtio NET device, read num_queues from struct ifcvf_pci_common_cfg,\nget the queue pair number using num_queues and set max_queues to it.\n\nSigned-off-by: Andy Pei <andy.pei@intel.com>\nSigned-off-by: Huang Wei <wei.huang@intel.com>\nReviewed-by: Chenbo Xia <chenbo.xia@intel.com>\n---\n drivers/vdpa/ifc/base/ifcvf.h |  2 +-\n drivers/vdpa/ifc/ifcvf_vdpa.c | 19 ++++++++++++++++++-\n 2 files changed, 19 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/vdpa/ifc/base/ifcvf.h b/drivers/vdpa/ifc/base/ifcvf.h\nindex d16d9ab..1e133c0 100644\n--- a/drivers/vdpa/ifc/base/ifcvf.h\n+++ b/drivers/vdpa/ifc/base/ifcvf.h\n@@ -21,7 +21,7 @@\n #define IFCVF_SUBSYS_NET_DEVICE_ID          0x0001\n #define IFCVF_SUBSYS_BLK_DEVICE_ID          0x0002\n \n-#define IFCVF_MAX_QUEUES\t\t1\n+#define IFCVF_MAX_QUEUES\t\t32\n \n #ifndef VIRTIO_F_IOMMU_PLATFORM\n #define VIRTIO_F_IOMMU_PLATFORM\t\t33\ndiff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c\nindex 008cf89..5a24204 100644\n--- a/drivers/vdpa/ifc/ifcvf_vdpa.c\n+++ b/drivers/vdpa/ifc/ifcvf_vdpa.c\n@@ -26,6 +26,12 @@\n \n #include \"base/ifcvf.h\"\n \n+/*\n+ * RTE_MIN() cannot be used since braced-group within expression allowed\n+ * only inside a function.\n+ */\n+#define MIN(v1, v2)\t((v1) < (v2) ? (v1) : (v2))\n+\n RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.vdpa.ifcvf, NOTICE);\n #define DRV_LOG(level, fmt, args...) \\\n \trte_log(RTE_LOG_ ## level, ifcvf_vdpa_logtype, \\\n@@ -1512,6 +1518,7 @@ struct rte_vdpa_dev_info dev_info[] = {\n \tuint64_t capacity = 0;\n \tuint8_t *byte;\n \tuint32_t i;\n+\tuint16_t queue_pairs;\n \n \tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n \t\treturn 0;\n@@ -1559,7 +1566,6 @@ struct rte_vdpa_dev_info dev_info[] = {\n \t}\n \n \tinternal->configured = 0;\n-\tinternal->max_queues = IFCVF_MAX_QUEUES;\n \tfeatures = ifcvf_get_features(&internal->hw);\n \n \tdevice_id = ifcvf_pci_get_device_type(pci_dev);\n@@ -1570,6 +1576,14 @@ struct rte_vdpa_dev_info dev_info[] = {\n \n \tif (device_id == VIRTIO_ID_NET) {\n \t\tinternal->hw.device_type = IFCVF_NET;\n+\t\t/*\n+\t\t * ifc device always has CTRL_VQ,\n+\t\t * and supports VIRTIO_NET_F_CTRL_VQ feature.\n+\t\t */\n+\t\tqueue_pairs = (internal->hw.common_cfg->num_queues - 1) / 2;\n+\t\tDRV_LOG(INFO, \"%s support %u queue pairs\", pci_dev->name,\n+\t\t\tqueue_pairs);\n+\t\tinternal->max_queues = MIN(IFCVF_MAX_QUEUES, queue_pairs);\n \t\tinternal->features = features &\n \t\t\t\t\t~(1ULL << VIRTIO_F_IOMMU_PLATFORM);\n \t\tinternal->features |= dev_info[IFCVF_NET].features;\n@@ -1609,6 +1623,9 @@ struct rte_vdpa_dev_info dev_info[] = {\n \t\t\tinternal->hw.blk_cfg->geometry.sectors);\n \t\tDRV_LOG(DEBUG, \"num_queues: 0x%08x\",\n \t\t\tinternal->hw.blk_cfg->num_queues);\n+\n+\t\tinternal->max_queues = MIN(IFCVF_MAX_QUEUES,\n+\t\t\tinternal->hw.blk_cfg->num_queues);\n \t}\n \n \tlist->internal = internal;\n",
    "prefixes": [
        "v9",
        "03/12"
    ]
}