get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 63350,
    "url": "https://patches.dpdk.org/api/patches/63350/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20191127134213.9003-1-thomas@monjalon.net/",
    "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": "<20191127134213.9003-1-thomas@monjalon.net>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191127134213.9003-1-thomas@monjalon.net",
    "date": "2019-11-27T13:42:13",
    "name": "ethdev: limit maximum number of queues",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "d04f0a61d9656477ef887c189bbe637813ab5e0d",
    "submitter": {
        "id": 685,
        "url": "https://patches.dpdk.org/api/people/685/?format=api",
        "name": "Thomas Monjalon",
        "email": "thomas@monjalon.net"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20191127134213.9003-1-thomas@monjalon.net/mbox/",
    "series": [
        {
            "id": 7666,
            "url": "https://patches.dpdk.org/api/series/7666/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=7666",
            "date": "2019-11-27T13:42:13",
            "name": "ethdev: limit maximum number of queues",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/7666/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/63350/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/63350/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 2F480A04E0;\n\tWed, 27 Nov 2019 14:42:37 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 16FF628EE;\n\tWed, 27 Nov 2019 14:42:36 +0100 (CET)",
            "from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com\n [66.111.4.230]) by dpdk.org (Postfix) with ESMTP id 95C45CF3;\n Wed, 27 Nov 2019 14:42:34 +0100 (CET)",
            "from compute1.internal (compute1.nyi.internal [10.202.2.41])\n by mailnew.nyi.internal (Postfix) with ESMTP id CFAF370FF;\n Wed, 27 Nov 2019 08:42:33 -0500 (EST)",
            "from mailfrontend1 ([10.202.2.162])\n by compute1.internal (MEProxy); Wed, 27 Nov 2019 08:42:33 -0500",
            "from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184])\n by mail.messagingengine.com (Postfix) with ESMTPA id 927D580061;\n Wed, 27 Nov 2019 08:42:31 -0500 (EST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=\n from:to:cc:subject:date:message-id:mime-version\n :content-transfer-encoding; s=mesmtp; bh=37i+5GSjFlL2Z2fU3pFjf88\n DV/LrfxlJd0kFvhKRiCA=; b=L/e5LgCbQknptuJVI8Rw12HbZWfLFINhtu12H94\n e5SCOdfxKtAK45SYjKWwjRdqdTVLrEaiOQwLMv3Iy/yVfH1GDAmymVoGzYkEI5/d\n 7maNqk1PpXsolJFEermOk1fO+OwkVZ8IuSrqZTlmw6v84TqwRAZYSE6payJu+pDN\n L2Cs=",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n messagingengine.com; h=cc:content-transfer-encoding:date:from\n :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy\n :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=37i+5GSjFlL2Z2fU3\n pFjf88DV/LrfxlJd0kFvhKRiCA=; b=ksYTDPDpCwO5dsfESfJjPG2oFks7BHbbA\n +4isdhDUR+p+N7tc0J4VJzj6Jp/48RYL9DQ8MZi4NTzgNAFIf+Hu8m8CkQ3ofYXd\n NpxFPyG7RXctks+96RhrNio/1hjwWsvXVncfLkmuC0iGAcvtWCKrODv0SEL8iK5A\n B+3i2Z4NrzUs6PvT/b9YnymHH9BF97DYvWU9+/cQ7OSA9JIYed/v2QqPJ0V+Tez/\n mIqxnJPdCCY1U2OcQ6IU0K2KFO2Wl3InVacp8Q5/DlJ8v/vqsLqixhHBbld42FIY\n W6xePGJcKLBwkO4dMIfC18BwnItwz7OdgSODMilQWwhHhlSW94T6g=="
        ],
        "X-ME-Sender": "<xms:SX3eXR17Ix3Nc0tuMSPJwMbFf7sOH7T1SHg_VvBgbm3-LMm5qzQrfg>",
        "X-ME-Proxy-Cause": "\n gggruggvucftvghtrhhoucdtuddrgedufedrudeihedgheegucetufdoteggodetrfdotf\n fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen\n uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne\n cujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgrshcu\n ofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecukfhppe\n ejjedrudefgedrvddtfedrudekgeenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhm\n rghssehmohhnjhgrlhhonhdrnhgvthenucevlhhushhtvghrufhiiigvpedt",
        "X-ME-Proxy": "<xmx:SX3eXXw77nay2jj_mi7QGCHQXUf1zuLFb2wFUY4f2Ko9KH6HVikOiw>\n <xmx:SX3eXdhBqW15ozSIRNFdBTLxvEpZ1Yacxf7cGeRsKhe4xF1PUKUPmw>\n <xmx:SX3eXapcp7xwUhIZI78qKEBYNDIVvj4686VMs6I4tAjw6VpbBr07PA>\n <xmx:SX3eXTXmMOuJTCnIvsUnoBQPCatL2c2kBK74EmpPjb_P-cPYeTdAgQ>",
        "From": "Thomas Monjalon <thomas@monjalon.net>",
        "To": "Matan Azrad <matan@mellanox.com>, Shahaf Shuler <shahafs@mellanox.com>,\n Viacheslav Ovsiienko <viacheslavo@mellanox.com>,\n Jasvinder Singh <jasvinder.singh@intel.com>,\n Cristian Dumitrescu <cristian.dumitrescu@intel.com>,\n Ferruh Yigit <ferruh.yigit@intel.com>,\n Andrew Rybchenko <arybchenko@solarflare.com>",
        "Cc": "david.marchand@redhat.com, dev@dpdk.org, stable@dpdk.org,\n Raslan Darawsheh <rasland@mellanox.com>",
        "Date": "Wed, 27 Nov 2019 14:42:13 +0100",
        "Message-Id": "<20191127134213.9003-1-thomas@monjalon.net>",
        "X-Mailer": "git-send-email 2.23.0",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH] ethdev: limit maximum number of queues",
        "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 <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": "A buffer overflow happens in testpmd with some drivers\nsince the queue arrays are limited to RTE_MAX_QUEUES_PER_PORT.\n\nThe advertised capabilities of mlx4, mlx5 and softnic\nfor the number of queues were the maximum number: UINT16_MAX.\nThey must be limited by the configured RTE_MAX_QUEUES_PER_PORT\nthat applications expect to be respected.\n\nThe limitation is applied in above drivers having no limitation,\nand at ethdev level (function rte_eth_dev_info_get), in order\nto force the configured limit for all drivers.\n\nFixes: 7fae69eeff13 (\"mlx4: new poll mode driver\")\nFixes: e60fbd5b24fc (\"mlx5: add device configure/start/stop\")\nFixes: cc6d421574fe (\"net/softnic: add softnic PMD\")\nFixes: 9e6b36c34ce9 (\"app/testpmd: reduce memory consumption\")\nCc: stable@dpdk.org\n\nReported-by: Raslan Darawsheh <rasland@mellanox.com>\nSigned-off-by: Thomas Monjalon <thomas@monjalon.net>\n---\n drivers/net/mlx4/mlx4_ethdev.c        | 4 +---\n drivers/net/mlx5/mlx5_ethdev.c        | 4 +---\n drivers/net/softnic/rte_eth_softnic.c | 4 ++--\n lib/librte_ethdev/rte_ethdev.c        | 6 ++++++\n 4 files changed, 10 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx4/mlx4_ethdev.c b/drivers/net/mlx4/mlx4_ethdev.c\nindex dfb24c22d0..a18a66cb4a 100644\n--- a/drivers/net/mlx4/mlx4_ethdev.c\n+++ b/drivers/net/mlx4/mlx4_ethdev.c\n@@ -646,9 +646,7 @@ mlx4_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)\n \t */\n \tmax = ((priv->device_attr.max_cq > priv->device_attr.max_qp) ?\n \t       priv->device_attr.max_qp : priv->device_attr.max_cq);\n-\t/* If max >= 65535 then max = 0, max_rx_queues is uint16_t. */\n-\tif (max >= 65535)\n-\t\tmax = 65535;\n+\tmax = RTE_MIN(max, (unsigned int)RTE_MAX_QUEUES_PER_PORT);\n \tinfo->max_rx_queues = max;\n \tinfo->max_tx_queues = max;\n \tinfo->max_mac_addrs = RTE_DIM(priv->mac);\ndiff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c\nindex d80ae458bc..045dae6b5a 100644\n--- a/drivers/net/mlx5/mlx5_ethdev.c\n+++ b/drivers/net/mlx5/mlx5_ethdev.c\n@@ -617,9 +617,7 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)\n \t */\n \tmax = RTE_MIN(priv->sh->device_attr.orig_attr.max_cq,\n \t\t      priv->sh->device_attr.orig_attr.max_qp);\n-\t/* If max >= 65535 then max = 0, max_rx_queues is uint16_t. */\n-\tif (max >= 65535)\n-\t\tmax = 65535;\n+\tmax = RTE_MIN(max, (unsigned int)RTE_MAX_QUEUES_PER_PORT);\n \tinfo->max_rx_queues = max;\n \tinfo->max_tx_queues = max;\n \tinfo->max_mac_addrs = MLX5_MAX_UC_MAC_ADDRESSES;\ndiff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c\nindex 11723778fd..1065cbf847 100644\n--- a/drivers/net/softnic/rte_eth_softnic.c\n+++ b/drivers/net/softnic/rte_eth_softnic.c\n@@ -91,8 +91,8 @@ pmd_dev_infos_get(struct rte_eth_dev *dev __rte_unused,\n \tstruct rte_eth_dev_info *dev_info)\n {\n \tdev_info->max_rx_pktlen = UINT32_MAX;\n-\tdev_info->max_rx_queues = UINT16_MAX;\n-\tdev_info->max_tx_queues = UINT16_MAX;\n+\tdev_info->max_rx_queues = RTE_MAX_QUEUES_PER_PORT;\n+\tdev_info->max_tx_queues = RTE_MAX_QUEUES_PER_PORT;\n \n \treturn 0;\n }\ndiff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c\nindex 8d2ce31a81..6e9cb243ea 100644\n--- a/lib/librte_ethdev/rte_ethdev.c\n+++ b/lib/librte_ethdev/rte_ethdev.c\n@@ -2986,6 +2986,12 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)\n \t\treturn eth_err(port_id, diag);\n \t}\n \n+\t/* Maximum number of queues should be <= RTE_MAX_QUEUES_PER_PORT */\n+\tdev_info->max_rx_queues = RTE_MIN(dev_info->max_rx_queues,\n+\t\t\tRTE_MAX_QUEUES_PER_PORT);\n+\tdev_info->max_tx_queues = RTE_MIN(dev_info->max_tx_queues,\n+\t\t\tRTE_MAX_QUEUES_PER_PORT);\n+\n \tdev_info->driver_name = dev->device->driver->name;\n \tdev_info->nb_rx_queues = dev->data->nb_rx_queues;\n \tdev_info->nb_tx_queues = dev->data->nb_tx_queues;\n",
    "prefixes": []
}