get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2223085,
    "url": "http://patchwork.ozlabs.org/api/1.0/patches/2223085/?format=api",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/1.0/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20260414121405.631092-1-maciej.fijalkowski@intel.com>",
    "date": "2026-04-14T12:14:05",
    "name": "[iwl-net] i40e: keep q_vectors array in sync with channel count changes",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "ae2b3a3e04379da60cbd6628b19a1545090754d2",
    "submitter": {
        "id": 77750,
        "url": "http://patchwork.ozlabs.org/api/1.0/people/77750/?format=api",
        "name": "Maciej Fijalkowski",
        "email": "maciej.fijalkowski@intel.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20260414121405.631092-1-maciej.fijalkowski@intel.com/mbox/",
    "series": [
        {
            "id": 499826,
            "url": "http://patchwork.ozlabs.org/api/1.0/series/499826/?format=api",
            "date": "2026-04-14T12:14:05",
            "name": "[iwl-net] i40e: keep q_vectors array in sync with channel count changes",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/499826/mbox/"
        }
    ],
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2223085/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@legolas.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256\n header.s=default header.b=p7vc0dFM;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=140.211.166.137; helo=smtp4.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fw39d5p6fz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 22:14:27 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby smtp4.osuosl.org (Postfix) with ESMTP id 49B5A4293B;\n\tTue, 14 Apr 2026 12:14:25 +0000 (UTC)",
            "from smtp4.osuosl.org ([127.0.0.1])\n by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id cvK9gncYjg8g; Tue, 14 Apr 2026 12:14:24 +0000 (UTC)",
            "from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142])\n\tby smtp4.osuosl.org (Postfix) with ESMTP id 77D8642941;\n\tTue, 14 Apr 2026 12:14:24 +0000 (UTC)",
            "from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n by lists1.osuosl.org (Postfix) with ESMTP id 7F635375\n for <intel-wired-lan@lists.osuosl.org>; Tue, 14 Apr 2026 12:14:23 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by smtp3.osuosl.org (Postfix) with ESMTP id 70BE460D92\n for <intel-wired-lan@lists.osuosl.org>; Tue, 14 Apr 2026 12:14:23 +0000 (UTC)",
            "from smtp3.osuosl.org ([127.0.0.1])\n by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id I-k3qTKR7niW for <intel-wired-lan@lists.osuosl.org>;\n Tue, 14 Apr 2026 12:14:22 +0000 (UTC)",
            "from mgamail.intel.com (mgamail.intel.com [192.198.163.13])\n by smtp3.osuosl.org (Postfix) with ESMTPS id 18CA560690\n for <intel-wired-lan@lists.osuosl.org>; Tue, 14 Apr 2026 12:14:21 +0000 (UTC)",
            "from fmviesa009.fm.intel.com ([10.60.135.149])\n by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 14 Apr 2026 05:14:21 -0700",
            "from boxer.igk.intel.com ([10.102.20.173])\n by fmviesa009.fm.intel.com with ESMTP; 14 Apr 2026 05:14:18 -0700"
        ],
        "X-Virus-Scanned": [
            "amavis at osuosl.org",
            "amavis at osuosl.org"
        ],
        "X-Comment": "SPF check N/A for local connections - client-ip=140.211.166.142;\n helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=<UNKNOWN> ",
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 smtp4.osuosl.org 77D8642941",
            "OpenDKIM Filter v2.11.0 smtp3.osuosl.org 18CA560690"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org;\n\ts=default; t=1776168864;\n\tbh=wqQenfokxain9EbkT49QtxNVdoVXtevBjzEuO+ngWNc=;\n\th=From:To:Cc:Date:Subject:List-Id:List-Unsubscribe:List-Archive:\n\t List-Post:List-Help:List-Subscribe:From;\n\tb=p7vc0dFMtItHsiOPKfGX42q/HMAD8b5Y7h0OdsrOvwhPVH1Qzy/mhaKNkp0CHI6kj\n\t JkVZCpH4VFYIk1NNI25MkxN+RgBBUWmH1Tw9ihgCi9WgZ4BvBnG2lpICinPhsCN+Lr\n\t Mp2QH3NDA2FChH2cFCZim5FscRIYZF0Js9deQDcdWwN33kvTrz5bDlj2aAxY6jiqEx\n\t CPYNzjKdErlB/hw/gZ4eJ+/uWRLCcGhSs+rAUUt6+9nLAkh4VKblZ6DihcUev6cw7c\n\t Bjd2JK6y1oZVzHwykwGqvAVKwS2jSIDjSXmo9lWybuY8wG48SlYKf+E3Ah7Sb20/f3\n\t EzuG9qFOQ/58Q==",
        "Received-SPF": "Pass (mailfrom) identity=mailfrom; client-ip=192.198.163.13;\n helo=mgamail.intel.com; envelope-from=maciej.fijalkowski@intel.com;\n receiver=<UNKNOWN>",
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 smtp3.osuosl.org 18CA560690",
        "X-CSE-ConnectionGUID": [
            "rgtXPJR2QgmUrfwr2x6FQg==",
            "XWSIhP6NQ06y/MK2T9SRjQ=="
        ],
        "X-CSE-MsgGUID": [
            "Im1EZ69/Tv2HdXHrpo7NYw==",
            "GNf6lb5bS/mOHE3aWRvTvg=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6800,10657,11759\"; a=\"79707433\"",
            "E=Sophos;i=\"6.23,179,1770624000\"; d=\"scan'208\";a=\"79707433\"",
            "E=Sophos;i=\"6.23,179,1770624000\"; d=\"scan'208\";a=\"223580738\""
        ],
        "X-ExtLoop1": "1",
        "From": "Maciej Fijalkowski <maciej.fijalkowski@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Cc": "netdev@vger.kernel.org, magnus.karlsson@intel.com, kuba@kernel.org,\n pabeni@redhat.com, horms@kernel.org, przemyslaw.kitszel@intel.com,\n jacob.e.keller@intel.com, Maciej Fijalkowski <maciej.fijalkowski@intel.com>",
        "Date": "Tue, 14 Apr 2026 14:14:05 +0200",
        "Message-Id": "<20260414121405.631092-1-maciej.fijalkowski@intel.com>",
        "X-Mailer": "git-send-email 2.38.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Mailman-Original-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1776168862; x=1807704862;\n h=from:to:cc:subject:date:message-id:mime-version:\n content-transfer-encoding;\n bh=aoQqQPGJhc03KFS3wOJRIWobNOhGmxoRm0pwr6KLZKU=;\n b=SBByf8hQ5HthC2ar00iOD9vXgGyHNTbvl7qEjen7lUMXz45M3bgUUeD1\n ipC+FirDpicIss+F842AvpROPdSRKqpbxtv/cFNvW3spbK3prw2wUBaMl\n YLa0/A20WZkQJ618z6njP5b7sfdkrS4mhi+OYJvQawgRUDrlcMbMsPfSJ\n YCNmi7zCkdhvey4vQHBMMc0qj+dORvKQWuiL8GWenXpBjTnbwefsyigR7\n /9jgbvPKR0HOzukYFrRj4NGuDFaJbXokgkqIZGoEoIEBmqFkykFH0wqcn\n SVPry5bpUo0NDZrZ+TKx0h7LdmMY5SzHDQpNy7wfi/7tA0ts+5nsZdjXN\n A==;",
        "X-Mailman-Original-Authentication-Results": [
            "smtp3.osuosl.org;\n dmarc=pass (p=none dis=none)\n header.from=intel.com",
            "smtp3.osuosl.org;\n dkim=pass (2048-bit key,\n unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256\n header.s=Intel header.b=SBByf8hQ"
        ],
        "Subject": "[Intel-wired-lan] [PATCH iwl-net] i40e: keep q_vectors array in\n sync with channel count changes",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.30",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n <intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "For the main VSI, i40e_set_num_rings_in_vsi() always derives\nnum_q_vectors from pf->num_lan_msix. At the same time, ethtool -L stores\nthe user requested channel count in vsi->req_queue_pairs and the queue\nsetup path uses that value for the effective number of queue pairs.\n\nThis leaves queue and vector counts out of sync after shrinking channel\ncount via ethtool -L. The active queue configuration is reduced, but the\nVSI still keeps the full PF-sized q_vector topology.\n\nThat mismatch breaks reconfiguration flows which rely on vector/NAPI\nstate matching the effective channel configuration. In particular,\ntoggling /sys/class/net/<dev>/threaded after reducing the channel count\ncan hang, and later channel-count changes can fail because VSI reinit\ndoes not rebuild q_vectors to match the new vector count.\n\nFix this by making the main VSI num_q_vectors follow the effective\nrequested channel count, capped by the available MSI-X vectors. Update\ni40e_vsi_reinit_setup() to rebuild q_vectors during VSI reinit so the\nvector topology is refreshed together with the ring arrays when channel\ncount changes.\n\nKeep alloc_queue_pairs unchanged and based on pf->num_lan_qps so the VSI\nretains its full queue capacity.\n\nSelftest napi_threaded.py was originally used when Jakub reported hang\non /sys/class/net/<dev>/threaded toggle. In order to make it pass on\ni40e, use persistent NAPI configuration for q_vector NAPIs so NAPI\nidentity and threaded settings survive q_vector reallocation across\nchannel-count changes. This is achieved by using netif_napi_add_config()\nwhen configuring q_vectors.\n\n$ export NETIF=ens259f1np1\n$ sudo -E env PATH=\"$PATH\" ./tools/testing/selftests/drivers/net/napi_threaded.py\nTAP version 13\n1..3\nok 1 napi_threaded.napi_init\nok 2 napi_threaded.change_num_queues\nok 3 napi_threaded.enable_dev_threaded_disable_napi_threaded\nTotals: pass:3 fail:0 xfail:0 xpass:0 skip:0 error:0\n\nReported-by: Jakub Kicinski <kuba@kernel.org>\nCloses: https://lore.kernel.org/intel-wired-lan/20260316133100.6054a11f@kernel.org/\nFixes: d2a69fefd756 (\"i40e: Fix changing previously set num_queue_pairs for PFs\")\nSigned-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e_main.c | 34 +++++++++++++++++----\n 1 file changed, 28 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex 926d001b2150..5636ad71f940 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -11403,10 +11403,14 @@ static void i40e_service_timer(struct timer_list *t)\n static int i40e_set_num_rings_in_vsi(struct i40e_vsi *vsi)\n {\n \tstruct i40e_pf *pf = vsi->back;\n+\tu16 qps;\n \n \tswitch (vsi->type) {\n \tcase I40E_VSI_MAIN:\n \t\tvsi->alloc_queue_pairs = pf->num_lan_qps;\n+\t\tqps = vsi->req_queue_pairs ?\n+\t\t      min_t(u16, vsi->req_queue_pairs, pf->num_lan_qps) :\n+\t\t      pf->num_lan_qps;\n \t\tif (!vsi->num_tx_desc)\n \t\t\tvsi->num_tx_desc = ALIGN(I40E_DEFAULT_NUM_DESCRIPTORS,\n \t\t\t\t\t\t I40E_REQ_DESCRIPTOR_MULTIPLE);\n@@ -11414,7 +11418,8 @@ static int i40e_set_num_rings_in_vsi(struct i40e_vsi *vsi)\n \t\t\tvsi->num_rx_desc = ALIGN(I40E_DEFAULT_NUM_DESCRIPTORS,\n \t\t\t\t\t\t I40E_REQ_DESCRIPTOR_MULTIPLE);\n \t\tif (test_bit(I40E_FLAG_MSIX_ENA, pf->flags))\n-\t\t\tvsi->num_q_vectors = pf->num_lan_msix;\n+\t\t\tvsi->num_q_vectors = max_t(int, 1,\n+\t\t\t\t\t\t   min_t(int, qps, pf->num_lan_msix));\n \t\telse\n \t\t\tvsi->num_q_vectors = 1;\n \n@@ -12043,7 +12048,8 @@ static int i40e_vsi_alloc_q_vector(struct i40e_vsi *vsi, int v_idx)\n \tcpumask_copy(&q_vector->affinity_mask, cpu_possible_mask);\n \n \tif (vsi->netdev)\n-\t\tnetif_napi_add(vsi->netdev, &q_vector->napi, i40e_napi_poll);\n+\t\tnetif_napi_add_config(vsi->netdev, &q_vector->napi,\n+\t\t\t\t      i40e_napi_poll, v_idx);\n \n \t/* tie q_vector and vsi together */\n \tvsi->q_vectors[v_idx] = q_vector;\n@@ -14265,12 +14271,27 @@ static struct i40e_vsi *i40e_vsi_reinit_setup(struct i40e_vsi *vsi)\n \n \tpf = vsi->back;\n \n+\tif (test_bit(I40E_FLAG_MSIX_ENA, pf->flags)) {\n+\t\ti40e_put_lump(pf->irq_pile, vsi->base_vector, vsi->idx);\n+\t\tvsi->base_vector = 0;\n+\t}\n+\n \ti40e_put_lump(pf->qp_pile, vsi->base_queue, vsi->idx);\n \ti40e_vsi_clear_rings(vsi);\n \n-\ti40e_vsi_free_arrays(vsi, false);\n+\ti40e_vsi_free_q_vectors(vsi);\n+\ti40e_vsi_free_arrays(vsi, true);\n \ti40e_set_num_rings_in_vsi(vsi);\n-\tret = i40e_vsi_alloc_arrays(vsi, false);\n+\n+\tret = i40e_vsi_alloc_arrays(vsi, true);\n+\tif (ret)\n+\t\tgoto err_vsi;\n+\n+\t/* Rebuild q_vectors during VSI reinit because the effective channel\n+\t * count may change num_q_vectors. Keep vector topology aligned with the\n+\t * queue configuration after ethtool's .set_channels() callback.\n+\t */\n+\tret = i40e_vsi_setup_vectors(vsi);\n \tif (ret)\n \t\tgoto err_vsi;\n \n@@ -14282,7 +14303,7 @@ static struct i40e_vsi *i40e_vsi_reinit_setup(struct i40e_vsi *vsi)\n \t\tdev_info(&pf->pdev->dev,\n \t\t\t \"failed to get tracking for %d queues for VSI %d err %d\\n\",\n \t\t\t alloc_queue_pairs, vsi->seid, ret);\n-\t\tgoto err_vsi;\n+\t\tgoto err_lump;\n \t}\n \tvsi->base_queue = ret;\n \n@@ -14306,7 +14327,6 @@ static struct i40e_vsi *i40e_vsi_reinit_setup(struct i40e_vsi *vsi)\n \treturn vsi;\n \n err_rings:\n-\ti40e_vsi_free_q_vectors(vsi);\n \tif (vsi->netdev_registered) {\n \t\tvsi->netdev_registered = false;\n \t\tunregister_netdev(vsi->netdev);\n@@ -14316,6 +14336,8 @@ static struct i40e_vsi *i40e_vsi_reinit_setup(struct i40e_vsi *vsi)\n \tif (vsi->type == I40E_VSI_MAIN)\n \t\ti40e_devlink_destroy_port(pf);\n \ti40e_aq_delete_element(&pf->hw, vsi->seid, NULL);\n+err_lump:\n+\ti40e_vsi_free_q_vectors(vsi);\n err_vsi:\n \ti40e_vsi_clear(vsi);\n \treturn NULL;\n",
    "prefixes": [
        "iwl-net"
    ]
}