get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 886997,
    "url": "http://patchwork.ozlabs.org/api/patches/886997/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180316082637.49915-5-alice.michael@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": "<20180316082637.49915-5-alice.michael@intel.com>",
    "list_archive_url": null,
    "date": "2018-03-16T08:26:34",
    "name": "[next,S89,5/8] i40e: move client flags into state bits",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "9f73128152d9bb8e56dca5cde34a4e534c3609fd",
    "submitter": {
        "id": 71123,
        "url": "http://patchwork.ozlabs.org/api/people/71123/?format=api",
        "name": "Michael, Alice",
        "email": "alice.michael@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/20180316082637.49915-5-alice.michael@intel.com/mbox/",
    "series": [
        {
            "id": 34226,
            "url": "http://patchwork.ozlabs.org/api/series/34226/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=34226",
            "date": "2018-03-16T08:26:33",
            "name": "[next,S89,1/8] i40e: move I40E_FLAG_FILTER_SYNC to a state bit",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/34226/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/886997/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/886997/checks/",
    "tags": {},
    "related": [],
    "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@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.133; helo=hemlock.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdmarc=none (p=none dis=none) header.from=intel.com"
        ],
        "Received": [
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 402rfC5X5Sz9sQm\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 17 Mar 2018 03:34:59 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 5DAAB8A5E4;\n\tFri, 16 Mar 2018 16:34:57 +0000 (UTC)",
            "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id OjxV+wzkdH+X; Fri, 16 Mar 2018 16:34:55 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 809B68A560;\n\tFri, 16 Mar 2018 16:34:55 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 76DE21C1011\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 16 Mar 2018 16:34:53 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 73228220CD\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 16 Mar 2018 16:34:53 +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 fXq-Z85-gux9 for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 16 Mar 2018 16:34:52 +0000 (UTC)",
            "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 83CF530485\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 16 Mar 2018 16:34:52 +0000 (UTC)",
            "from fmsmga008.fm.intel.com ([10.253.24.58])\n\tby fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t16 Mar 2018 09:34:47 -0700",
            "from alicemic-2.jf.intel.com ([10.166.16.121])\n\tby fmsmga008.fm.intel.com with ESMTP; 16 Mar 2018 09:34:47 -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-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.48,316,1517904000\"; d=\"scan'208\";a=\"25113540\"",
        "From": "Alice Michael <alice.michael@intel.com>",
        "To": "alice.michael@intel.com,\n\tintel-wired-lan@lists.osuosl.org",
        "Date": "Fri, 16 Mar 2018 01:26:34 -0700",
        "Message-Id": "<20180316082637.49915-5-alice.michael@intel.com>",
        "X-Mailer": "git-send-email 2.9.5",
        "In-Reply-To": "<20180316082637.49915-1-alice.michael@intel.com>",
        "References": "<20180316082637.49915-1-alice.michael@intel.com>",
        "Subject": "[Intel-wired-lan] [next PATCH S89 5/8] i40e: move client flags into\n\tstate bits",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.24",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<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\t<mailto:intel-wired-lan-request@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@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "From: Jacob Keller <jacob.e.keller@intel.com>\n\nThe iWarp client flags are all potentially changed when the RTNL lock is\nnot held, so they should not be part of the pf->flags variable. Instead,\nmove them into the state field so that we can use atomic bit operations.\n\nThis is part of a larger effort to remove cmpxchg64 in\ni40e_set_priv_flags()\n\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e.h        |  7 ++++---\n drivers/net/ethernet/intel/i40e/i40e_client.c |  7 +++----\n drivers/net/ethernet/intel/i40e/i40e_main.c   | 22 ++++++++++------------\n 3 files changed, 17 insertions(+), 19 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h\nindex 2dd89f8..029554e 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e.h\n@@ -167,6 +167,9 @@ enum i40e_state_t {\n \t__I40E_MACVLAN_SYNC_PENDING,\n \t__I40E_UDP_FILTER_SYNC_PENDING,\n \t__I40E_TEMP_LINK_POLLING,\n+\t__I40E_CLIENT_SERVICE_REQUESTED,\n+\t__I40E_CLIENT_L2_CHANGE,\n+\t__I40E_CLIENT_RESET,\n \t/* This must be last as it determines the size of the BITMAP */\n \t__I40E_STATE_SIZE__,\n };\n@@ -539,9 +542,7 @@ struct i40e_pf {\n #define I40E_FLAG_LEGACY_RX\t\t\tBIT_ULL(21)\n #define I40E_FLAG_PTP\t\t\t\tBIT_ULL(22)\n #define I40E_FLAG_IWARP_ENABLED\t\t\tBIT_ULL(23)\n-#define I40E_FLAG_SERVICE_CLIENT_REQUESTED\tBIT_ULL(24)\n-#define I40E_FLAG_CLIENT_L2_CHANGE\t\tBIT_ULL(25)\n-#define I40E_FLAG_CLIENT_RESET\t\t\tBIT_ULL(26)\n+/* Gap for BIT_ULL(24) through BIT_ULL(26) */\n #define I40E_FLAG_LINK_DOWN_ON_CLOSE_ENABLED\tBIT_ULL(27)\n #define I40E_FLAG_SOURCE_PRUNING_DISABLED\tBIT_ULL(28)\n #define I40E_FLAG_TC_MQPRIO\t\t\tBIT_ULL(29)\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_client.c b/drivers/net/ethernet/intel/i40e/i40e_client.c\nindex a04bbfc..0484c7e 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_client.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_client.c\n@@ -376,9 +376,8 @@ void i40e_client_subtask(struct i40e_pf *pf)\n \tstruct i40e_vsi *vsi = pf->vsi[pf->lan_vsi];\n \tint ret = 0;\n \n-\tif (!(pf->flags & I40E_FLAG_SERVICE_CLIENT_REQUESTED))\n+\tif (!test_and_clear_bit(__I40E_CLIENT_SERVICE_REQUESTED, pf->state))\n \t\treturn;\n-\tpf->flags &= ~I40E_FLAG_SERVICE_CLIENT_REQUESTED;\n \tcdev = pf->cinst;\n \n \t/* If we're down or resetting, just bail */\n@@ -459,7 +458,7 @@ int i40e_lan_add_device(struct i40e_pf *pf)\n \t * added, we can schedule a subtask to go initiate the clients if\n \t * they can be launched at probe time.\n \t */\n-\tpf->flags |= I40E_FLAG_SERVICE_CLIENT_REQUESTED;\n+\tset_bit(__I40E_CLIENT_SERVICE_REQUESTED, pf->state);\n \ti40e_service_event_schedule(pf);\n \n out:\n@@ -554,7 +553,7 @@ static void i40e_client_prepare(struct i40e_client *client)\n \t\tpf = ldev->pf;\n \t\ti40e_client_add_instance(pf);\n \t\t/* Start the client subtask */\n-\t\tpf->flags |= I40E_FLAG_SERVICE_CLIENT_REQUESTED;\n+\t\tset_bit(__I40E_CLIENT_SERVICE_REQUESTED, pf->state);\n \t\ti40e_service_event_schedule(pf);\n \t}\n \tmutex_unlock(&i40e_device_mutex);\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex 01ecd9d..debc3a3 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -2634,8 +2634,8 @@ static int i40e_change_mtu(struct net_device *netdev, int new_mtu)\n \tnetdev->mtu = new_mtu;\n \tif (netif_running(netdev))\n \t\ti40e_vsi_reinit_locked(vsi);\n-\tpf->flags |= (I40E_FLAG_SERVICE_CLIENT_REQUESTED |\n-\t\t      I40E_FLAG_CLIENT_L2_CHANGE);\n+\tset_bit(__I40E_CLIENT_SERVICE_REQUESTED, pf->state);\n+\tset_bit(__I40E_CLIENT_L2_CHANGE, pf->state);\n \treturn 0;\n }\n \n@@ -4722,9 +4722,9 @@ static void i40e_vsi_close(struct i40e_vsi *vsi)\n \ti40e_vsi_free_tx_resources(vsi);\n \ti40e_vsi_free_rx_resources(vsi);\n \tvsi->current_netdev_flags = 0;\n-\tpf->flags |= I40E_FLAG_SERVICE_CLIENT_REQUESTED;\n+\tset_bit(__I40E_CLIENT_SERVICE_REQUESTED, pf->state);\n \tif (test_bit(__I40E_RESET_RECOVERY_PENDING, pf->state))\n-\t\tpf->flags |=  I40E_FLAG_CLIENT_RESET;\n+\t\tset_bit(__I40E_CLIENT_RESET, pf->state);\n }\n \n /**\n@@ -6495,7 +6495,7 @@ static int i40e_up_complete(struct i40e_vsi *vsi)\n \t/* On the next run of the service_task, notify any clients of the new\n \t * opened netdev\n \t */\n-\tpf->flags |= I40E_FLAG_SERVICE_CLIENT_REQUESTED;\n+\tset_bit(__I40E_CLIENT_SERVICE_REQUESTED, pf->state);\n \ti40e_service_event_schedule(pf);\n \n \treturn 0;\n@@ -8037,8 +8037,8 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf,\n \t\ti40e_service_event_schedule(pf);\n \t} else {\n \t\ti40e_pf_unquiesce_all_vsi(pf);\n-\tpf->flags |= (I40E_FLAG_SERVICE_CLIENT_REQUESTED |\n-\t\t      I40E_FLAG_CLIENT_L2_CHANGE);\n+\tset_bit(__I40E_CLIENT_SERVICE_REQUESTED, pf->state);\n+\tset_bit(__I40E_CLIENT_L2_CHANGE, pf->state);\n \t}\n \n exit:\n@@ -9785,17 +9785,15 @@ static void i40e_service_task(struct work_struct *work)\n \ti40e_vc_process_vflr_event(pf);\n \ti40e_watchdog_subtask(pf);\n \ti40e_fdir_reinit_subtask(pf);\n-\tif (pf->flags & I40E_FLAG_CLIENT_RESET) {\n+\tif (test_and_clear_bit(__I40E_CLIENT_RESET, pf->state)) {\n \t\t/* Client subtask will reopen next time through. */\n \t\ti40e_notify_client_of_netdev_close(pf->vsi[pf->lan_vsi], true);\n-\t\tpf->flags &= ~I40E_FLAG_CLIENT_RESET;\n \t} else {\n \t\ti40e_client_subtask(pf);\n-\t\tif (pf->flags & I40E_FLAG_CLIENT_L2_CHANGE) {\n+\t\tif (test_and_clear_bit(__I40E_CLIENT_L2_CHANGE,\n+\t\t\t\t       pf->state))\n \t\t\ti40e_notify_client_of_l2_param_changes(\n \t\t\t\t\t\t\tpf->vsi[pf->lan_vsi]);\n-\t\t\tpf->flags &= ~I40E_FLAG_CLIENT_L2_CHANGE;\n-\t\t}\n \t}\n \ti40e_sync_filters_subtask(pf);\n \ti40e_sync_udp_filters_subtask(pf);\n",
    "prefixes": [
        "next",
        "S89",
        "5/8"
    ]
}