get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 806319,
    "url": "http://patchwork.ozlabs.org/api/patches/806319/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20170828001603.75876-13-jeffrey.t.kirsher@intel.com/",
    "project": {
        "id": 7,
        "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api",
        "name": "Linux network development",
        "link_name": "netdev",
        "list_id": "netdev.vger.kernel.org",
        "list_email": "netdev@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170828001603.75876-13-jeffrey.t.kirsher@intel.com>",
    "list_archive_url": null,
    "date": "2017-08-28T00:16:00",
    "name": "[net-next,12/15] i40e: initialize our affinity_mask based on cpu_possible_mask",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "9b6a6ac57ae0f6fb84251665aaf3907ab634d305",
    "submitter": {
        "id": 473,
        "url": "http://patchwork.ozlabs.org/api/people/473/?format=api",
        "name": "Kirsher, Jeffrey T",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "delegate": {
        "id": 34,
        "url": "http://patchwork.ozlabs.org/api/users/34/?format=api",
        "username": "davem",
        "first_name": "David",
        "last_name": "Miller",
        "email": "davem@davemloft.net"
    },
    "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20170828001603.75876-13-jeffrey.t.kirsher@intel.com/mbox/",
    "series": [
        {
            "id": 52,
            "url": "http://patchwork.ozlabs.org/api/series/52/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=52",
            "date": "2017-08-28T00:15:49",
            "name": "40GbE Intel Wired LAN Driver Updates 2017-08-27",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/52/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/806319/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/806319/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<netdev-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming@ozlabs.org",
        "Delivered-To": "patchwork-incoming@ozlabs.org",
        "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xgXQ03KJNz9s8J\n\tfor <patchwork-incoming@ozlabs.org>;\n\tMon, 28 Aug 2017 10:16:56 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751804AbdH1AQy (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tSun, 27 Aug 2017 20:16:54 -0400",
            "from mga14.intel.com ([192.55.52.115]:47467 \"EHLO mga14.intel.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1751693AbdH1AQV (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tSun, 27 Aug 2017 20:16:21 -0400",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t27 Aug 2017 17:16:20 -0700",
            "from davidpwo-mobl1.amr.corp.intel.com (HELO\n\tjtkirshe-DESK.amr.corp.intel.com.com) ([10.254.22.134])\n\tby fmsmga004.fm.intel.com with ESMTP; 27 Aug 2017 17:16:20 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.41,439,1498546800\"; d=\"scan'208\";a=\"304981096\"",
        "From": "Jeff Kirsher <jeffrey.t.kirsher@intel.com>",
        "To": "davem@davemloft.net",
        "Cc": "Jacob Keller <jacob.e.keller@intel.com>, netdev@vger.kernel.org,\n\tnhorman@redhat.com, sassmann@redhat.com, jogreene@redhat.com,\n\tJeff Kirsher <jeffrey.t.kirsher@intel.com>",
        "Subject": "[net-next 12/15] i40e: initialize our affinity_mask based on\n\tcpu_possible_mask",
        "Date": "Sun, 27 Aug 2017 17:16:00 -0700",
        "Message-Id": "<20170828001603.75876-13-jeffrey.t.kirsher@intel.com>",
        "X-Mailer": "git-send-email 2.14.1",
        "In-Reply-To": "<20170828001603.75876-1-jeffrey.t.kirsher@intel.com>",
        "References": "<20170828001603.75876-1-jeffrey.t.kirsher@intel.com>",
        "Sender": "netdev-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "From: Jacob Keller <jacob.e.keller@intel.com>\n\nOn older kernels a call to irq_set_affinity_hint does not guarantee that\nthe IRQ affinity will be set. If nothing else on the system sets the IRQ\naffinity this can result in a bug in the i40e_napi_poll() routine where\nwe notice that our interrupt fired on the \"wrong\" CPU according to our\ninternal affinity_mask variable.\n\nThis results in a bug where we continuously tell NAPI to stop polling to\nmove the interrupt to a new CPU, but the CPU never changes because our\naffinity mask does not match the actual mask setup for the IRQ.\n\nThe root problem is a mismatched affinity mask value. So lets initialize\nthe value to cpu_possible_mask instead. This ensures that prior to the\nfirst time we get an IRQ affinity notification we'll have the mask set\nto include every possible CPU.\n\nWe use cpu_possible_mask instead of cpu_online_mask since the former is\nalmost certainly never going to change, while the later might change\nafter we've made a copy.\n\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\nTested-by: Andrew Bowers <andrewx.bowers@intel.com>\nSigned-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e_main.c     | 12 +++++++-----\n drivers/net/ethernet/intel/i40evf/i40evf_main.c |  7 +++++--\n 2 files changed, 12 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex 7366e7c7f399..6498da8806cb 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -2881,7 +2881,7 @@ static void i40e_config_xps_tx_ring(struct i40e_ring *ring)\n \tif ((vsi->tc_config.numtc <= 1) &&\n \t    !test_and_set_bit(__I40E_TX_XPS_INIT_DONE, &ring->state)) {\n \t\tnetif_set_xps_queue(ring->netdev,\n-\t\t\t\t    &ring->q_vector->affinity_mask,\n+\t\t\t\t    get_cpu_mask(ring->q_vector->v_idx),\n \t\t\t\t    ring->queue_index);\n \t}\n \n@@ -3506,8 +3506,10 @@ static int i40e_vsi_request_irq_msix(struct i40e_vsi *vsi, char *basename)\n \t\tq_vector->affinity_notify.notify = i40e_irq_affinity_notify;\n \t\tq_vector->affinity_notify.release = i40e_irq_affinity_release;\n \t\tirq_set_affinity_notifier(irq_num, &q_vector->affinity_notify);\n-\t\t/* assign the mask for this irq */\n-\t\tirq_set_affinity_hint(irq_num, &q_vector->affinity_mask);\n+\t\t/* get_cpu_mask returns a static constant mask with\n+\t\t * a permanent lifetime so it's ok to use here.\n+\t\t */\n+\t\tirq_set_affinity_hint(irq_num, get_cpu_mask(q_vector->v_idx));\n \t}\n \n \tvsi->irqs_ready = true;\n@@ -4289,7 +4291,7 @@ static void i40e_vsi_free_irq(struct i40e_vsi *vsi)\n \n \t\t\t/* clear the affinity notifier in the IRQ descriptor */\n \t\t\tirq_set_affinity_notifier(irq_num, NULL);\n-\t\t\t/* clear the affinity_mask in the IRQ descriptor */\n+\t\t\t/* remove our suggested affinity mask for this IRQ */\n \t\t\tirq_set_affinity_hint(irq_num, NULL);\n \t\t\tsynchronize_irq(irq_num);\n \t\t\tfree_irq(irq_num, vsi->q_vectors[i]);\n@@ -8235,7 +8237,7 @@ static int i40e_vsi_alloc_q_vector(struct i40e_vsi *vsi, int v_idx, int cpu)\n \n \tq_vector->vsi = vsi;\n \tq_vector->v_idx = v_idx;\n-\tcpumask_set_cpu(cpu, &q_vector->affinity_mask);\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,\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c\nindex 9ee277e87f10..1825d956bb00 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c\n@@ -584,8 +584,10 @@ i40evf_request_traffic_irqs(struct i40evf_adapter *adapter, char *basename)\n \t\tq_vector->affinity_notify.release =\n \t\t\t\t\t\t   i40evf_irq_affinity_release;\n \t\tirq_set_affinity_notifier(irq_num, &q_vector->affinity_notify);\n-\t\t/* assign the mask for this irq */\n-\t\tirq_set_affinity_hint(irq_num, &q_vector->affinity_mask);\n+\t\t/* get_cpu_mask returns a static constant mask with\n+\t\t * a permanent lifetime so it's ok to use here.\n+\t\t */\n+\t\tirq_set_affinity_hint(irq_num, get_cpu_mask(q_vector->v_idx));\n \t}\n \n \treturn 0;\n@@ -1456,6 +1458,7 @@ static int i40evf_alloc_q_vectors(struct i40evf_adapter *adapter)\n \t\tq_vector->adapter = adapter;\n \t\tq_vector->vsi = &adapter->vsi;\n \t\tq_vector->v_idx = q_idx;\n+\t\tcpumask_copy(&q_vector->affinity_mask, cpu_possible_mask);\n \t\tnetif_napi_add(adapter->netdev, &q_vector->napi,\n \t\t\t       i40evf_napi_poll, NAPI_POLL_WEIGHT);\n \t}\n",
    "prefixes": [
        "net-next",
        "12/15"
    ]
}