get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 139282,
    "url": "https://patches.dpdk.org/api/patches/139282/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/PA4PR83MB05261AB024A2F6A286CBF22E97092@PA4PR83MB0526.EURPRD83.prod.outlook.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": "<PA4PR83MB05261AB024A2F6A286CBF22E97092@PA4PR83MB0526.EURPRD83.prod.outlook.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/PA4PR83MB05261AB024A2F6A286CBF22E97092@PA4PR83MB0526.EURPRD83.prod.outlook.com",
    "date": "2024-04-15T14:40:44",
    "name": "[v4] net/netvsc: fix number Tx queues > Rx queues",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "7ae757aa6339ab6b92d07a99fafa791ed4ca3b48",
    "submitter": {
        "id": 3272,
        "url": "https://patches.dpdk.org/api/people/3272/?format=api",
        "name": "Alan Elder",
        "email": "alan.elder@microsoft.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/PA4PR83MB05261AB024A2F6A286CBF22E97092@PA4PR83MB0526.EURPRD83.prod.outlook.com/mbox/",
    "series": [
        {
            "id": 31741,
            "url": "https://patches.dpdk.org/api/series/31741/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=31741",
            "date": "2024-04-15T14:40:44",
            "name": "[v4] net/netvsc: fix number Tx queues > Rx queues",
            "version": 4,
            "mbox": "https://patches.dpdk.org/series/31741/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/139282/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/139282/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 7147A43E7B;\n\tMon, 15 Apr 2024 16:40:50 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id E2F044026C;\n\tMon, 15 Apr 2024 16:40:49 +0200 (CEST)",
            "from EUR05-VI1-obe.outbound.protection.outlook.com\n (mail-vi1eur05on2102.outbound.protection.outlook.com [40.107.21.102])\n by mails.dpdk.org (Postfix) with ESMTP id DC83E400EF\n for <dev@dpdk.org>; Mon, 15 Apr 2024 16:40:48 +0200 (CEST)",
            "from PA4PR83MB0526.EURPRD83.prod.outlook.com (2603:10a6:102:26b::17)\n by PA4PR83MB0526.EURPRD83.prod.outlook.com (2603:10a6:102:26b::17)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.6; Mon, 15 Apr\n 2024 14:40:45 +0000",
            "from PA4PR83MB0526.EURPRD83.prod.outlook.com\n ([fe80::f0b:6b7f:eef8:2bcc]) by PA4PR83MB0526.EURPRD83.prod.outlook.com\n ([fe80::f0b:6b7f:eef8:2bcc%2]) with mapi id 15.20.7519.005; Mon, 15 Apr 2024\n 14:40:45 +0000"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=XS4SssZubSaw6WPSV7Oq7/Lbaf9QoHxr5Fw35YsmBvVDyQMU57Z1ZHs9I9e031+6jmlk9/qKFzaMhPkSaoPrCPirVTw57b6rSvw7EqrRnQhn0gYAtylqjma8xWmbNH5nMLUxTit+PuIXPHxQahOWzHwmRMQSrppra5ylnmBF+EQkCXkehngA1GT+O59ubCY28BVXtpf3I2ECKmbW3dYbaowwYF0Kw53PcpUnJjBr9Lgo5PHZ0Rz90YfUKh01XOh7L/h7sbzEaYx3CEdhkRbvR0tQ7z2+cFWnJa4Xz54Suk1+A8lkgUyZ1p7+U/rifJ6oYqGjj7bV9+bAhA5d8dVpdQ==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector9901;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=8UWPmYAHBnwmzVpMswF0+Ip1WAGvdksXVqGv+2S5r44=;\n b=Oie+MRMKIzD6j+QJbudP4pFTKXRcmz7gevewoSxKpU3DYw4adWC+xneHqeBJB8vPiUGogSQGOEUP6qbCR7lVFDCEyFO97nXfmi4mXGfM0+yL5kxmfJQghYH5jMAgAVDDyLEQ7lNLC/n+KEpX99V3FNyhc6zKtV30SBTzGtQJoN/E8Homm/6VIqU5u/pHB0hjFVt9hQICBB+4KwbQ/HLOY7sGPDsbSo9XKaa9C9hNYK+kdjHlaNZAss56cZAmwrzfYBLD8b3Ah/rnERhSjMMVLD2jL37X2Z2fZsr2V+7q8hHKMNcMFhGSUCHr/kYAlA5lDBvV2waAkQ3Neez4v+B2fA==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass\n smtp.mailfrom=microsoft.com; dmarc=pass action=none\n header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=selector2;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=8UWPmYAHBnwmzVpMswF0+Ip1WAGvdksXVqGv+2S5r44=;\n b=PihYmPXSWXb79kW+2gQC9oa7Ip2kwNQiZVWOI2uq5JH9BDOLSkoEEwSqld4yfcsp4rJBPYEE2AffgNbmJJ/HHdhMtwLQ7Rifu1J1mGzKjrVDiaJPRhLxZU4mHoe6gZz+cBsP6/L63qg7nzQglk2b4JLSHx00aVfF1w0m9LwwEjI=",
        "From": "Alan Elder <alan.elder@microsoft.com>",
        "To": "Long Li <longli@microsoft.com>, Ferruh Yigit <ferruh.yigit@amd.com>,\n Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>",
        "CC": "\"dev@dpdk.org\" <dev@dpdk.org>, stephen <stephen@networkplumber.org>",
        "Subject": "[PATCH v4] net/netvsc: fix number Tx queues > Rx queues",
        "Thread-Topic": "[PATCH v4] net/netvsc: fix number Tx queues > Rx queues",
        "Thread-Index": "AQHaj0LlOhmlskdRP0OAUkt+bSOHnA==",
        "Date": "Mon, 15 Apr 2024 14:40:44 +0000",
        "Message-ID": "\n <PA4PR83MB05261AB024A2F6A286CBF22E97092@PA4PR83MB0526.EURPRD83.prod.outlook.com>",
        "References": "\n <PA4PR83MB0526128CDADC4DCC27FAF491975F2@PA4PR83MB0526.EURPRD83.prod.outlook.com>\n <DU0PR83MB05321DB2ADBEDAE7687773DF97272@DU0PR83MB0532.EURPRD83.prod.outlook.com>\n <SJ1PR21MB3457C3F4261C263951DE9F4BCE2B2@SJ1PR21MB3457.namprd21.prod.outlook.com>\n <PA4PR83MB0526053A870E8358B7CB3643972C2@PA4PR83MB0526.EURPRD83.prod.outlook.com>",
        "In-Reply-To": "\n <PA4PR83MB0526053A870E8358B7CB3643972C2@PA4PR83MB0526.EURPRD83.prod.outlook.com>",
        "Accept-Language": "en-US",
        "Content-Language": "en-US",
        "X-MS-Has-Attach": "",
        "X-MS-TNEF-Correlator": "",
        "msip_labels": "\n MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=979ac031-206c-4225-b627-540697dac625;\n MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;\n MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true;\n MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard;\n MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal;\n MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2024-02-29T19:11:26Z;\n MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;",
        "authentication-results": "dkim=none (message not signed)\n header.d=none;dmarc=none action=none header.from=microsoft.com;",
        "x-ms-publictraffictype": "Email",
        "x-ms-traffictypediagnostic": "PA4PR83MB0526:EE_",
        "x-ms-office365-filtering-correlation-id": "a05cacbc-25d5-47db-7976-08dc5d5a086b",
        "x-ms-exchange-senderadcheck": "1",
        "x-ms-exchange-antispam-relay": "0",
        "x-microsoft-antispam": "BCL:0;\n ARA:13230031|366007|376005|1800799015|38070700009;",
        "x-microsoft-antispam-message-info": "\n 8S8n1WodLMUuCJHo1jem/HiXbK7Vy+sE1U0/wkz9XLEv+ANSGGdDmwfs8W6L6pLrY1QG89ZMnYNG2oER5nwJ+bpIA0b9yNl/4mA7LtI3LMfXZGZsLYXS6BUCvhRQuH9bzzElgmH2HPeKjm/3YKag2czPbPcYK5WCJyqPZZBDMslnn7Eim391SK2f3myCZwgIoLThG/+Nukc2/3nvpjT/p36KE5lWzf8TftclndhD1F3r01TMzwf8SDYUrm0hvfea7btDx6Bx/zeWUn5VlfxkWo0sGt5akMkDh68bdfm8ee/mb4nER5QFJ7+hKlv4WYKlavz4kEhpAN/hfp1pbEDYrvZYUM/zqWMcFkXodJtaN8v+FSCo3uzYKOCj0KiZkICeAag1NSD4Fi4uh9pLbRmAuRDme+GMArWHnRSuBJl/gZouXVazkQpg9dVK/e/d55tTvG1oOuH0zTiMvDyxDJfDjfXuuwdKd+ik1reuJ6sv54ZE55o1fO8QwNOkO5D6hPqsO5vzFGnPfaycM3JjF5z9AbKTa8DCsh3qIyfo1bNMXaVPYrAwx5ChD5yZ54UPUxVNbv18tIK09yO8zxWvL7/Q6gOfwREk9S5mCmscrorbuVsCXl5p1n7ebwU7JBEaKwuvI+E3I1G1eazWJFP3Qq3GJlDMEB1C4ezoDKYVbi7xIfxbLQ6hJYXCmE9DV2jiBITOxQXM+bRCJv/okUK2OL4733mZwALm9sTtF7Vg2BXZstpkawm8+NuQW0Ir9bEbl2iw0+km1hXl6sDlWSquBKbIKHfIGEX9P3hkgYpgUeAmSsljxcDo8eB+rCfalZqAJwOwljDV/ZpuKg1R7HKHFnV7Ff+bjwXuM/to4vELeuknzENgzWqWTJoYxlcK6uVYzkcGqzuUr10AG+qloCtwbhPS4dO4UP994C1MtZOH731nGWbvnTcQH5po8diLCOc8ostaH7W/uxIiV1lrzgQorNtpfj3+TnWzufcixMnvb4zzrwMBaF6EaxC1+Z0DyguQGWtB93T/B3pmKgMTt/EGEMz2sYZuqXA3bCHplGskl9j7nVhKgwiG4iBVlRXkizdDJ5b0+J5v9ky+0hYRbcgbDgrcR72tJjKtUQ9zDQ0RivUI7mnTCze4oPrqWVyp+wvr9uJlgiPvJUs/5Qom7p4iFOWRJCE3u+z3j3VTK3BAnwNcoMWLecWOs1jaGztB5SEodtZ5vegfzo1aGYQNgr0EYrEIBJMS4c/oOaD2mSqUjYQCchsK/nqMPUbYhim7XtrDZgI4lgKgn/oZ8pUCSER0IccfA6DSR9/RCGyBe0A71xP+VJlV14AkylR/dxzJxyxgg4rP5Fx7W+/pWar7ur986u5J+g==",
        "x-forefront-antispam-report": "CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:PA4PR83MB0526.EURPRD83.prod.outlook.com; PTR:; CAT:NONE;\n SFS:(13230031)(366007)(376005)(1800799015)(38070700009); DIR:OUT; SFP:1102;",
        "x-ms-exchange-antispam-messagedata-chunkcount": "1",
        "x-ms-exchange-antispam-messagedata-0": "\n Aw1Bz5jPdxHB+4LmOT3YhcXB7vsPmpSduv317vHivBsPhqpt0XcpPIZ0z6Ln7Xhp9F3l8EX6cvYcTJr9a5oS8bHIoZEfSIQUPXtNwjPQo13n+If5015cgzMgr4dGjDEhpfeULg0vjKCRANvzqa/Y2snGGYQm24Q9e3lSujrA0GraMBmosuunhFujf4QLS50JORdDQGBh+HkbFVbRVAGAggBukpkYRnIPDX+IHIB+fM9lST80uyiNy3IHHEtVou3YJZhQWv7Lu8VdL0Rvf0B/TaXh6MeGvnXYqlv/CSGZJv0z+uwM4Yxp8KejiEDwBQf8ZY2WDTHe6oR0HBHwTvWbFfWaVotNe0lsUm1UeuW8MdFZivaeRRLNkXONshRk6/at/dHbNzqRUZriqSgRFJUeF+VYf1VQovXvYrTbrabgMk3Imluv3A7HlHTE9sTnmJ9vlPEpAUybmJMGZatEW6CzHE18QJoD1QKFAGEAg47w7FltvbcdF+VcilwxwnXUKBYAvu7O5dmk5/toJncQA90HTdveZ/VUQ6+ysxt1iJ4fN9eH53yMkrtJ3L1zQXnVJ5VZX4zFUqE5ayBeGR2ShPvj79S/CoDy1YQFKV1bexbhFC1zmNF0DEVx5lYVrghsqLiy2XtVVCcKoHfLng09U3QCbMufRPDbokSIct7Av9JPa59k4Fnm+QxOzHtirBvaeScNUo+wANwjJ3ApbPZjRcVrDAQ35kf8VVtQ+LKnTre9SFS+MJdNCZ7+INJ/RTEQpSL48gEXlHYhddAm9V4I2V4z/cPssKk8pCHhMvbDNmYoSxxgCc5buIeEAtvbziN2WZakSkKzkqZLpbaGZ7M3Y7g7TJqObhXrJTyEhwO/2BzRbpIsEEVvIRKNrnmOAKpwQQOayla8gm6piW/27FHj9NT6W0/fDnQi+Rx4LAZ/3a0+q10MehLbySEMcDzfTUtC+yO19cWX0ketoUUryXJUQz9jsC+DW4wMULZ645rykgjBrf1JZwGj3mJ8DeaX3O07MfYBW8P6WvW0oqVfnwJSfSHFRDsrOXUs5eDSZT9SZ/Jdl0nJA2eWTk52pEziQG/22mILtIl/GSMHaZp70ER+rPJFzkLzswnc1wX/nFGmlnYuCCyGgn6uAq3EcmK1Sk0CuGIlq8MC7v+8YstdpfvToemrzyEheqOHELVmmzxq+whne6Myc7WZ3ntG0Dbh6PDh8GmTnG1x86s4VPKpKx74fZ3q0hTR6h+h73ZTpGjDes22zPNG1FHhZYZoXqkAVbEwiOVfpVJyNfGIoc3Wvv5uSsUoKqBVP6ZqddYKuHdIabQYmcIgSIUbW7Fscdgnjm4esX2usfwwEKNdIIgSG/yozS9aLYyq1ewdB3LNuuwXgHYwGVPnTlHJScn56qKIWUzumwbp0EoXRUIxs9t8SA/BODEhYkbgYvvM+lpQjIleHGcfYEXplPPtgaNdLtauN9C8PlP2fY2UJjD3fqqjveJx/u3LuozCjjIFWmETtvGci/Ved4P6MYsbpEkhE6rn9GiNxkxU89FIjzJh5IB2R+iW6yUXtzHo6JMfOveA1xgxmefkuNTe52eZEnhIuEno5Uzy5mRL",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "quoted-printable",
        "MIME-Version": "1.0",
        "X-OriginatorOrg": "microsoft.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Internal",
        "X-MS-Exchange-CrossTenant-AuthSource": "PA4PR83MB0526.EURPRD83.prod.outlook.com",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n a05cacbc-25d5-47db-7976-08dc5d5a086b",
        "X-MS-Exchange-CrossTenant-originalarrivaltime": "15 Apr 2024 14:40:44.8935 (UTC)",
        "X-MS-Exchange-CrossTenant-fromentityheader": "Hosted",
        "X-MS-Exchange-CrossTenant-id": "72f988bf-86f1-41af-91ab-2d7cd011db47",
        "X-MS-Exchange-CrossTenant-mailboxtype": "HOSTED",
        "X-MS-Exchange-CrossTenant-userprincipalname": "\n a4zVilRogmCwajlhjENmooGUJ4VkS5Pj6mOhCMo8hyXVR4lixUVsx6g4uUoGShqmdE6mFNL3GcljYKjLVefPSg==",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "PA4PR83MB0526",
        "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": "The previous code allowed the number of Tx queues to be set higher than the number of Rx queues.  If a packet was sent on a Tx queue with index\n>= number Rx queues there was a segfault due to accessing beyond the end of the dev->data->rx_queues[] array.\n\n#0 rte_spinlock_trylock (sl = invalid address) at /include/rte_spinlock.h L63\n#1  hn_process_events at /drivers/net/netvsc/hn_rxtx.c L 1129\n#2  hn_xmit_pkts at /drivers/net/netvsc/hn_rxtx.c L1553\n\nThis commit fixes the issue by creating an Rx queue for every Tx queue meaning that an event buffer is allocated to handle receiving Tx completion messages.\n\nmbuf pool and Rx ring are not allocated for these additional Rx queues and RSS configuration ensures that no packets are received on them.\n\nFixes: 4e9c73e96e83 (\"net/netvsc: add Hyper-V network device\")\nCc: sthemmin@microsoft.com\nCc: stable@dpdk.org\n\nSigned-off-by: Alan Elder <alan.elder@microsoft.com>\n---\nv4:\n* Include segfault core stack in commit message\n\nv3:\n* Handle case of Rx queue creation failure in hn_dev_tx_queue_setup.\n* Re-use rx queue if it has already been allocated.\n* Don't allocate an mbuf if pool is NULL.  This avoids segfault if RSS\n  configuration is incorrect.\n\nv2:\n* Remove function declaration for static non-member function\n\n---\n drivers/net/netvsc/hn_ethdev.c |  9 +++++\n drivers/net/netvsc/hn_rxtx.c   | 70 +++++++++++++++++++++++++++++-----\n 2 files changed, 70 insertions(+), 9 deletions(-)\n\n \tstruct hn_tx_queue *txq;\n+\tstruct hn_rx_queue *rxq = NULL;\n \tchar name[RTE_MEMPOOL_NAMESIZE];\n \tuint32_t tx_free_thresh;\n \tint err = -ENOMEM;\n@@ -301,6 +313,27 @@ hn_dev_tx_queue_setup(struct rte_eth_dev *dev,\n \t\tgoto error;\n \t}\n \n+\t/*\n+\t * If there are more Tx queues than Rx queues, allocate rx_queues\n+\t * with event buffer so that Tx completion messages can still be\n+\t * received\n+\t */\n+\tif (queue_idx >= dev->data->nb_rx_queues) {\n+\t\trxq = hn_rx_queue_alloc(hv, queue_idx, socket_id);\n+\n+\t\tif (!rxq) {\n+\t\t\terr = -ENOMEM;\n+\t\t\tgoto error;\n+\t\t}\n+\n+\t\t/*\n+\t\t * Don't allocate mbuf pool or rx ring.  RSS is always configured\n+\t\t * to ensure packets aren't received by this Rx queue.\n+\t\t */\n+\t\trxq->mb_pool = NULL;\n+\t\trxq->rx_ring = NULL;\n+\t}\n+\n \ttxq->agg_szmax  = RTE_MIN(hv->chim_szmax, hv->rndis_agg_size);\n \ttxq->agg_pktmax = hv->rndis_agg_pkts;\n \ttxq->agg_align  = hv->rndis_agg_align; @@ -311,12 +344,15 @@ hn_dev_tx_queue_setup(struct rte_eth_dev *dev,\n \t\t\t\t     socket_id, tx_conf);\n \tif (err == 0) {\n \t\tdev->data->tx_queues[queue_idx] = txq;\n+\t\tif (rxq != NULL)\n+\t\t\tdev->data->rx_queues[queue_idx] = rxq;\n \t\treturn 0;\n \t}\n \n error:\n \trte_mempool_free(txq->txdesc_pool);\n \trte_memzone_free(txq->tx_rndis_mz);\n+\thn_rx_queue_free_common(rxq);\n \trte_free(txq);\n \treturn err;\n }\n@@ -364,6 +400,13 @@ hn_dev_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid)\n \tif (!txq)\n \t\treturn;\n \n+\t/*\n+\t * Free any Rx queues allocated for a Tx queue without a corresponding\n+\t * Rx queue\n+\t */\n+\tif (qid >= dev->data->nb_rx_queues)\n+\t\thn_rx_queue_free_common(dev->data->rx_queues[qid]);\n+\n \trte_mempool_free(txq->txdesc_pool);\n \n \trte_memzone_free(txq->tx_rndis_mz);\n@@ -552,10 +595,12 @@ static void hn_rxpkt(struct hn_rx_queue *rxq, struct hn_rx_bufinfo *rxb,\n \t\t     const struct hn_rxinfo *info)\n {\n \tstruct hn_data *hv = rxq->hv;\n-\tstruct rte_mbuf *m;\n+\tstruct rte_mbuf *m = NULL;\n \tbool use_extbuf = false;\n \n-\tm = rte_pktmbuf_alloc(rxq->mb_pool);\n+\tif (likely(rxq->mb_pool != NULL))\n+\t\tm = rte_pktmbuf_alloc(rxq->mb_pool);\n+\n \tif (unlikely(!m)) {\n \t\tstruct rte_eth_dev *dev =\n \t\t\t&rte_eth_devices[rxq->port_id];\n@@ -942,7 +987,15 @@ hn_dev_rx_queue_setup(struct rte_eth_dev *dev,\n \tif (queue_idx == 0) {\n \t\trxq = hv->primary;\n \t} else {\n-\t\trxq = hn_rx_queue_alloc(hv, queue_idx, socket_id);\n+\t\t/*\n+\t\t * If the number of Tx queues was previously greater than the\n+\t\t * number of Rx queues, we may already have allocated an rxq.\n+\t\t */\n+\t\tif (!dev->data->rx_queues[queue_idx])\n+\t\t\trxq = hn_rx_queue_alloc(hv, queue_idx, socket_id);\n+\t\telse\n+\t\t\trxq = dev->data->rx_queues[queue_idx];\n+\n \t\tif (!rxq)\n \t\t\treturn -ENOMEM;\n \t}\n@@ -975,9 +1028,10 @@ hn_dev_rx_queue_setup(struct rte_eth_dev *dev,\n \n fail:\n \trte_ring_free(rxq->rx_ring);\n-\trte_free(rxq->rxbuf_info);\n-\trte_free(rxq->event_buf);\n-\trte_free(rxq);\n+\t/* Only free rxq if it was created in this function. */\n+\tif (!dev->data->rx_queues[queue_idx])\n+\t\thn_rx_queue_free_common(rxq);\n+\n \treturn error;\n }\n \n@@ -998,9 +1052,7 @@ hn_rx_queue_free(struct hn_rx_queue *rxq, bool keep_primary)\n \tif (keep_primary && rxq == rxq->hv->primary)\n \t\treturn;\n \n-\trte_free(rxq->rxbuf_info);\n-\trte_free(rxq->event_buf);\n-\trte_free(rxq);\n+\thn_rx_queue_free_common(rxq);\n }\n \n void\n--\n2.25.1",
    "diff": "diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index b8a32832d7..d7e3f12346 100644\n--- a/drivers/net/netvsc/hn_ethdev.c\n+++ b/drivers/net/netvsc/hn_ethdev.c\n@@ -313,6 +313,15 @@ static int hn_rss_reta_update(struct rte_eth_dev *dev,\n \n \t\tif (reta_conf[idx].mask & mask)\n \t\t\thv->rss_ind[i] = reta_conf[idx].reta[shift];\n+\n+\t\t/*\n+\t\t * Ensure we don't allow config that directs traffic to an Rx\n+\t\t * queue that we aren't going to poll\n+\t\t */\n+\t\tif (hv->rss_ind[i] >=  dev->data->nb_rx_queues) {\n+\t\t\tPMD_DRV_LOG(ERR, \"RSS distributing traffic to invalid Rx queue\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n \t}\n \n \terr = hn_rndis_conf_rss(hv, NDIS_RSS_FLAG_DISABLE); diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c index 9bf1ec5509..e23880c176 100644\n--- a/drivers/net/netvsc/hn_rxtx.c\n+++ b/drivers/net/netvsc/hn_rxtx.c\n@@ -234,6 +234,17 @@ static void hn_reset_txagg(struct hn_tx_queue *txq)\n \ttxq->agg_prevpkt = NULL;\n }\n \n+static void\n+hn_rx_queue_free_common(struct hn_rx_queue *rxq) {\n+\tif (!rxq)\n+\t\treturn;\n+\n+\trte_free(rxq->rxbuf_info);\n+\trte_free(rxq->event_buf);\n+\trte_free(rxq);\n+}\n+\n int\n hn_dev_tx_queue_setup(struct rte_eth_dev *dev,\n \t\t      uint16_t queue_idx, uint16_t nb_desc, @@ -243,6 +254,7 @@ hn_dev_tx_queue_setup(struct rte_eth_dev *dev,  {\n \tstruct hn_data *hv = dev->data->dev_private;\n",
    "prefixes": [
        "v4"
    ]
}