get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 536388,
    "url": "http://patchwork.ozlabs.org/api/patches/536388/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1445903081-155893-14-git-send-email-catherine.sullivan@intel.com/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/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": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1445903081-155893-14-git-send-email-catherine.sullivan@intel.com>",
    "list_archive_url": null,
    "date": "2015-10-26T23:44:39",
    "name": "[next,S20,13/15] i40evf: allocate queue vectors dynamically",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "587105301d1a7de3a77839983ea6ab0516f1f0e7",
    "submitter": {
        "id": 13931,
        "url": "http://patchwork.ozlabs.org/api/people/13931/?format=api",
        "name": "Catherine Sullivan",
        "email": "catherine.sullivan@intel.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1445903081-155893-14-git-send-email-catherine.sullivan@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/536388/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/536388/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@lists.osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Received": [
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ozlabs.org (Postfix) with ESMTP id EEAA514030E\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 27 Oct 2015 10:45:59 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 4DF9232DCA;\n\tMon, 26 Oct 2015 23:45:59 +0000 (UTC)",
            "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 3LSSO2bx7kWC; Mon, 26 Oct 2015 23:45:57 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id D411526F27;\n\tMon, 26 Oct 2015 23:45:57 +0000 (UTC)",
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id BA2E71CEEC7\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 26 Oct 2015 23:45:56 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id B132088BB5\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 26 Oct 2015 23:45:56 +0000 (UTC)",
            "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 64uTOZfRE4sX for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 26 Oct 2015 23:45:55 +0000 (UTC)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id C27078C0B7\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 26 Oct 2015 23:45:55 +0000 (UTC)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby orsmga101.jf.intel.com with ESMTP; 26 Oct 2015 16:45:40 -0700",
            "from catheri1-tigger.jf.intel.com ([134.134.176.92])\n\tby FMSMGA003.fm.intel.com with ESMTP; 26 Oct 2015 16:45:42 -0700"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.20,202,1444719600\"; d=\"scan'208\";a=\"588532692\"",
        "From": "Catherine Sullivan <catherine.sullivan@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Mon, 26 Oct 2015 19:44:39 -0400",
        "Message-Id": "<1445903081-155893-14-git-send-email-catherine.sullivan@intel.com>",
        "X-Mailer": "git-send-email 1.9.3",
        "In-Reply-To": "<1445903081-155893-1-git-send-email-catherine.sullivan@intel.com>",
        "References": "<1445903081-155893-1-git-send-email-catherine.sullivan@intel.com>",
        "Subject": "[Intel-wired-lan] [next PATCH S20 13/15] i40evf: allocate queue\n\tvectors dynamically",
        "X-BeenThere": "intel-wired-lan@lists.osuosl.org",
        "X-Mailman-Version": "2.1.18-1",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>",
        "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>",
        "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>"
    },
    "content": "From: Mitch Williams <mitch.a.williams@intel.com>\n\nChange the queue_vector array from a statically-sized member of the\nadapter structure to a dynamically-allocated and -sized array.\n\nThis reduces the size of the adapter structure, and allows us to support\nany number of queue vectors in the future without changing the code.\n\nSigned-off-by: Mitch Williams <mitch.a.williams@intel.com>\nChange-ID: I08dc622cb2f2ad01e832e51c1ad9b86524730693\n\n---\nTesting-hints: Open and close the interface several times and ensure\nthat traffic continues to pass.\n drivers/net/ethernet/intel/i40evf/i40evf.h         |  5 +--\n drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c |  2 +-\n drivers/net/ethernet/intel/i40evf/i40evf_main.c    | 38 ++++++++++------------\n .../net/ethernet/intel/i40evf/i40evf_virtchnl.c    |  2 +-\n 4 files changed, 21 insertions(+), 26 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40evf/i40evf.h b/drivers/net/ethernet/intel/i40evf/i40evf.h\nindex 090c604..bd185ad 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf.h\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf.h\n@@ -145,9 +145,6 @@ struct i40e_q_vector {\n #define OTHER_VECTOR 1\n #define NONQ_VECS (OTHER_VECTOR)\n \n-#define MAX_MSIX_Q_VECTORS 4\n-#define MAX_MSIX_COUNT 5\n-\n #define MIN_MSIX_Q_VECTORS 1\n #define MIN_MSIX_COUNT (MIN_MSIX_Q_VECTORS + NONQ_VECS)\n \n@@ -193,7 +190,7 @@ struct i40evf_adapter {\n \tstruct work_struct reset_task;\n \tstruct work_struct adminq_task;\n \tstruct delayed_work init_task;\n-\tstruct i40e_q_vector *q_vector[MAX_MSIX_Q_VECTORS];\n+\tstruct i40e_q_vector *q_vectors;\n \tstruct list_head vlan_filter_list;\n \tchar misc_vector_name[IFNAMSIZ + 9];\n \tint num_active_queues;\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c\nindex 4f4e5a3..ec059b3 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c\n@@ -351,7 +351,7 @@ static int i40evf_set_coalesce(struct net_device *netdev,\n \t\tvsi->tx_itr_setting &= ~I40E_ITR_DYNAMIC;\n \n \tfor (i = 0; i < adapter->num_msix_vectors - NONQ_VECS; i++) {\n-\t\tq_vector = adapter->q_vector[i];\n+\t\tq_vector = &adapter->q_vectors[i];\n \t\tq_vector->rx.itr = ITR_TO_REG(vsi->rx_itr_setting);\n \t\twr32(hw, I40E_VFINT_ITRN1(0, i), q_vector->rx.itr);\n \t\tq_vector->tx.itr = ITR_TO_REG(vsi->tx_itr_setting);\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c\nindex f5d6932..d12bd56 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c\n@@ -347,7 +347,7 @@ static irqreturn_t i40evf_msix_clean_rings(int irq, void *data)\n static void\n i40evf_map_vector_to_rxq(struct i40evf_adapter *adapter, int v_idx, int r_idx)\n {\n-\tstruct i40e_q_vector *q_vector = adapter->q_vector[v_idx];\n+\tstruct i40e_q_vector *q_vector = &adapter->q_vectors[v_idx];\n \tstruct i40e_ring *rx_ring = adapter->rx_rings[r_idx];\n \n \trx_ring->q_vector = q_vector;\n@@ -368,7 +368,7 @@ i40evf_map_vector_to_rxq(struct i40evf_adapter *adapter, int v_idx, int r_idx)\n static void\n i40evf_map_vector_to_txq(struct i40evf_adapter *adapter, int v_idx, int t_idx)\n {\n-\tstruct i40e_q_vector *q_vector = adapter->q_vector[v_idx];\n+\tstruct i40e_q_vector *q_vector = &adapter->q_vectors[v_idx];\n \tstruct i40e_ring *tx_ring = adapter->tx_rings[t_idx];\n \n \ttx_ring->q_vector = q_vector;\n@@ -464,7 +464,7 @@ static void i40evf_netpoll(struct net_device *netdev)\n \t\treturn;\n \n \tfor (i = 0; i < q_vectors; i++)\n-\t\ti40evf_msix_clean_rings(0, adapter->q_vector[i]);\n+\t\ti40evf_msix_clean_rings(0, &adapter->q_vectors[i]);\n }\n \n #endif\n@@ -486,7 +486,7 @@ i40evf_request_traffic_irqs(struct i40evf_adapter *adapter, char *basename)\n \tq_vectors = adapter->num_msix_vectors - NONQ_VECS;\n \n \tfor (vector = 0; vector < q_vectors; vector++) {\n-\t\tstruct i40e_q_vector *q_vector = adapter->q_vector[vector];\n+\t\tstruct i40e_q_vector *q_vector = &adapter->q_vectors[vector];\n \n \t\tif (q_vector->tx.ring && q_vector->rx.ring) {\n \t\t\tsnprintf(q_vector->name, sizeof(q_vector->name) - 1,\n@@ -531,7 +531,7 @@ free_queue_irqs:\n \t\t\tadapter->msix_entries[vector + NONQ_VECS].vector,\n \t\t\tNULL);\n \t\tfree_irq(adapter->msix_entries[vector + NONQ_VECS].vector,\n-\t\t\t adapter->q_vector[vector]);\n+\t\t\t &adapter->q_vectors[vector]);\n \t}\n \treturn err;\n }\n@@ -581,7 +581,7 @@ static void i40evf_free_traffic_irqs(struct i40evf_adapter *adapter)\n \t\tirq_set_affinity_hint(adapter->msix_entries[i+1].vector,\n \t\t\t\t      NULL);\n \t\tfree_irq(adapter->msix_entries[i+1].vector,\n-\t\t\t adapter->q_vector[i]);\n+\t\t\t &adapter->q_vectors[i]);\n \t}\n }\n \n@@ -953,7 +953,7 @@ static void i40evf_napi_enable_all(struct i40evf_adapter *adapter)\n \tfor (q_idx = 0; q_idx < q_vectors; q_idx++) {\n \t\tstruct napi_struct *napi;\n \n-\t\tq_vector = adapter->q_vector[q_idx];\n+\t\tq_vector = &adapter->q_vectors[q_idx];\n \t\tnapi = &q_vector->napi;\n \t\tnapi_enable(napi);\n \t}\n@@ -970,7 +970,7 @@ static void i40evf_napi_disable_all(struct i40evf_adapter *adapter)\n \tint q_vectors = adapter->num_msix_vectors - NONQ_VECS;\n \n \tfor (q_idx = 0; q_idx < q_vectors; q_idx++) {\n-\t\tq_vector = adapter->q_vector[q_idx];\n+\t\tq_vector = &adapter->q_vectors[q_idx];\n \t\tnapi_disable(&q_vector->napi);\n \t}\n }\n@@ -1483,21 +1483,22 @@ static int i40evf_init_rss(struct i40evf_adapter *adapter)\n  **/\n static int i40evf_alloc_q_vectors(struct i40evf_adapter *adapter)\n {\n-\tint q_idx, num_q_vectors;\n+\tint q_idx = 0, num_q_vectors;\n \tstruct i40e_q_vector *q_vector;\n \n \tnum_q_vectors = adapter->num_msix_vectors - NONQ_VECS;\n+\tadapter->q_vectors = kzalloc(sizeof(*q_vector) * num_q_vectors,\n+\t\t\t\t     GFP_KERNEL);\n+\tif (!adapter->q_vectors)\n+\t\tgoto err_out;\n \n \tfor (q_idx = 0; q_idx < num_q_vectors; q_idx++) {\n-\t\tq_vector = kzalloc(sizeof(*q_vector), GFP_KERNEL);\n-\t\tif (!q_vector)\n-\t\t\tgoto err_out;\n+\t\tq_vector = &adapter->q_vectors[q_idx];\n \t\tq_vector->adapter = adapter;\n \t\tq_vector->vsi = &adapter->vsi;\n \t\tq_vector->v_idx = q_idx;\n \t\tnetif_napi_add(adapter->netdev, &q_vector->napi,\n \t\t\t       i40evf_napi_poll, NAPI_POLL_WEIGHT);\n-\t\tadapter->q_vector[q_idx] = q_vector;\n \t}\n \n \treturn 0;\n@@ -1505,11 +1506,10 @@ static int i40evf_alloc_q_vectors(struct i40evf_adapter *adapter)\n err_out:\n \twhile (q_idx) {\n \t\tq_idx--;\n-\t\tq_vector = adapter->q_vector[q_idx];\n+\t\tq_vector = &adapter->q_vectors[q_idx];\n \t\tnetif_napi_del(&q_vector->napi);\n-\t\tkfree(q_vector);\n-\t\tadapter->q_vector[q_idx] = NULL;\n \t}\n+\tkfree(adapter->q_vectors);\n \treturn -ENOMEM;\n }\n \n@@ -1530,13 +1530,11 @@ static void i40evf_free_q_vectors(struct i40evf_adapter *adapter)\n \tnapi_vectors = adapter->num_active_queues;\n \n \tfor (q_idx = 0; q_idx < num_q_vectors; q_idx++) {\n-\t\tstruct i40e_q_vector *q_vector = adapter->q_vector[q_idx];\n-\n-\t\tadapter->q_vector[q_idx] = NULL;\n+\t\tstruct i40e_q_vector *q_vector = &adapter->q_vectors[q_idx];\n \t\tif (q_idx < napi_vectors)\n \t\t\tnetif_napi_del(&q_vector->napi);\n-\t\tkfree(q_vector);\n \t}\n+\tkfree(adapter->q_vectors);\n }\n \n /**\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c\nindex 46b0516..24b3af3 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c\n@@ -360,7 +360,7 @@ void i40evf_map_queues(struct i40evf_adapter *adapter)\n \tvimi->num_vectors = adapter->num_msix_vectors;\n \t/* Queue vectors first */\n \tfor (v_idx = 0; v_idx < q_vectors; v_idx++) {\n-\t\tq_vector = adapter->q_vector[v_idx];\n+\t\tq_vector = adapter->q_vectors + v_idx;\n \t\tvimi->vecmap[v_idx].vsi_id = adapter->vsi_res->vsi_id;\n \t\tvimi->vecmap[v_idx].vector_id = v_idx + NONQ_VECS;\n \t\tvimi->vecmap[v_idx].txq_map = q_vector->ring_mask;\n",
    "prefixes": [
        "next",
        "S20",
        "13/15"
    ]
}