get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 523588,
    "url": "http://patchwork.ozlabs.org/api/patches/523588/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1443472632-33873-1-git-send-email-anjali.singhai@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": "<1443472632-33873-1-git-send-email-anjali.singhai@intel.com>",
    "list_archive_url": null,
    "date": "2015-09-28T20:37:12",
    "name": "i40e: Fix for recursive RTNL lock during PROMISC change",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "620ccfad634002253c3d9889227fd794c3b8e6db",
    "submitter": {
        "id": 65487,
        "url": "http://patchwork.ozlabs.org/api/people/65487/?format=api",
        "name": "Singhai, Anjali",
        "email": "anjali.singhai@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/1443472632-33873-1-git-send-email-anjali.singhai@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/523588/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/523588/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 75E32140909\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 29 Sep 2015 06:21:20 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 8D63533442;\n\tMon, 28 Sep 2015 20:21:19 +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 P1OdwNY-+wRe; Mon, 28 Sep 2015 20:21:18 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 4204727453;\n\tMon, 28 Sep 2015 20:21:18 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 48BB41C156A\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 28 Sep 2015 20:21:17 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 417E831BCD\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 28 Sep 2015 20:21:17 +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 WK+kj2KC8y9I for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 28 Sep 2015 20:21:15 +0000 (UTC)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby silver.osuosl.org (Postfix) with ESMTP id AB71227453\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 28 Sep 2015 20:21:15 +0000 (UTC)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga101.jf.intel.com with ESMTP; 28 Sep 2015 13:21:16 -0700",
            "from asinghai-cp.jf.intel.com ([134.134.3.57])\n\tby orsmga001.jf.intel.com with ESMTP; 28 Sep 2015 13:21:15 -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.17,604,1437462000\"; d=\"scan'208\";a=\"779279462\"",
        "From": "Anjali Singhai Jain <anjali.singhai@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Mon, 28 Sep 2015 13:37:12 -0700",
        "Message-Id": "<1443472632-33873-1-git-send-email-anjali.singhai@intel.com>",
        "X-Mailer": "git-send-email 1.8.1.4",
        "Subject": "[Intel-wired-lan] [PATCH] i40e: Fix for recursive RTNL lock during\n\tPROMISC change",
        "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": "The sync_vsi_filters function can be called directly under RTNL\nor through the timer subtask without one. This was causing a deadlock.\n\nIf sync_vsi_filters is called from a thread which held the lock,\nand in another thread the PROMISC setting got changed we would\nbe executing the PROMISC change in the thread which already held\nthe lock alongside the other filter update. The PROMISC change\nrequires a reset if we are on a VEB, which requires it to be called\nunder RTNL.\n\nEarlier the driver would call reset for PROMISC change without\nchecking if we were already under RTNL and would try to grab it\ncausing a deadlock. This patch changes the flow to see if we are\nalready under RTNL before trying to grab it.\n\nSigned-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>\nSigned-off-by: Kiran Patil <kiran.patil@intel.com>\nSigned-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e.h             |  2 +-\n drivers/net/ethernet/intel/i40e/i40e_debugfs.c     |  4 ++--\n drivers/net/ethernet/intel/i40e/i40e_main.c        | 19 ++++++++++++-------\n drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c |  8 ++++----\n 4 files changed, 19 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h\nindex 0ed6506..65e9db6 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e.h\n@@ -678,7 +678,7 @@ struct i40e_mac_filter *i40e_add_filter(struct i40e_vsi *vsi,\n \t\t\t\t\tbool is_vf, bool is_netdev);\n void i40e_del_filter(struct i40e_vsi *vsi, u8 *macaddr, s16 vlan,\n \t\t     bool is_vf, bool is_netdev);\n-int i40e_sync_vsi_filters(struct i40e_vsi *vsi);\n+int i40e_sync_vsi_filters(struct i40e_vsi *vsi, bool grab_rtnl);\n struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf, u8 type,\n \t\t\t\tu16 uplink, u32 param1);\n int i40e_vsi_release(struct i40e_vsi *vsi);\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c\nindex 2f0e2f5..c38e9ee 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c\n@@ -1138,7 +1138,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,\n \t\t}\n \n \t\tf = i40e_add_filter(vsi, ma, vlan, false, false);\n-\t\tret = i40e_sync_vsi_filters(vsi);\n+\t\tret = i40e_sync_vsi_filters(vsi, true);\n \t\tif (f && !ret)\n \t\t\tdev_info(&pf->pdev->dev,\n \t\t\t\t \"add macaddr: %pM vlan=%d added to VSI %d\\n\",\n@@ -1175,7 +1175,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,\n \t\t}\n \n \t\ti40e_del_filter(vsi, ma, vlan, false, false);\n-\t\tret = i40e_sync_vsi_filters(vsi);\n+\t\tret = i40e_sync_vsi_filters(vsi, true);\n \t\tif (!ret)\n \t\t\tdev_info(&pf->pdev->dev,\n \t\t\t\t \"del macaddr: %pM vlan=%d removed from VSI %d\\n\",\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex f8401d0..0c590a1 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -1564,7 +1564,7 @@ static int i40e_set_mac(struct net_device *netdev, void *p)\n \t\tspin_unlock(&vsi->mac_filter_list_lock);\n \t}\n \n-\ti40e_sync_vsi_filters(vsi);\n+\ti40e_sync_vsi_filters(vsi, false);\n \tether_addr_copy(netdev->dev_addr, addr->sa_data);\n \n \treturn 0;\n@@ -1868,12 +1868,13 @@ static void i40e_cleanup_add_list(struct list_head *add_list)\n /**\n  * i40e_sync_vsi_filters - Update the VSI filter list to the HW\n  * @vsi: ptr to the VSI\n+ * @grab_rtnl: whether RTNL needs to be grabbed\n  *\n  * Push any outstanding VSI filter changes through the AdminQ.\n  *\n  * Returns 0 or error value\n  **/\n-int i40e_sync_vsi_filters(struct i40e_vsi *vsi)\n+int i40e_sync_vsi_filters(struct i40e_vsi *vsi, bool grab_rtnl)\n {\n \tstruct list_head tmp_del_list, tmp_add_list;\n \tstruct i40e_mac_filter *f, *ftmp, *fclone;\n@@ -2128,7 +2129,11 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)\n \t\t\t */\n \t\t\tif (pf->cur_promisc != cur_promisc) {\n \t\t\t\tpf->cur_promisc = cur_promisc;\n-\t\t\t\ti40e_do_reset_safe(pf,\n+\t\t\t\tif (grab_rtnl)\n+\t\t\t\t\ti40e_do_reset_safe(pf,\n+\t\t\t\t\t\tBIT(__I40E_PF_RESET_REQUESTED));\n+\t\t\t\telse\n+\t\t\t\t\ti40e_do_reset(pf,\n \t\t\t\t\t\tBIT(__I40E_PF_RESET_REQUESTED));\n \t\t\t}\n \t\t} else {\n@@ -2179,7 +2184,7 @@ static void i40e_sync_filters_subtask(struct i40e_pf *pf)\n \tfor (v = 0; v < pf->num_alloc_vsi; v++) {\n \t\tif (pf->vsi[v] &&\n \t\t    (pf->vsi[v]->flags & I40E_VSI_FLAG_FILTER_CHANGED))\n-\t\t\ti40e_sync_vsi_filters(pf->vsi[v]);\n+\t\t\ti40e_sync_vsi_filters(pf->vsi[v], true);\n \t}\n }\n \n@@ -2398,7 +2403,7 @@ int i40e_vsi_add_vlan(struct i40e_vsi *vsi, s16 vid)\n \t    test_bit(__I40E_RESET_RECOVERY_PENDING, &vsi->back->state))\n \t\treturn 0;\n \n-\treturn i40e_sync_vsi_filters(vsi);\n+\treturn i40e_sync_vsi_filters(vsi, false);\n }\n \n /**\n@@ -2480,7 +2485,7 @@ int i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid)\n \t    test_bit(__I40E_RESET_RECOVERY_PENDING, &vsi->back->state))\n \t\treturn 0;\n \n-\treturn i40e_sync_vsi_filters(vsi);\n+\treturn i40e_sync_vsi_filters(vsi, false);\n }\n \n /**\n@@ -9032,7 +9037,7 @@ int i40e_vsi_release(struct i40e_vsi *vsi)\n \t\t\t\tf->is_vf, f->is_netdev);\n \tspin_unlock(&vsi->mac_filter_list_lock);\n \n-\ti40e_sync_vsi_filters(vsi);\n+\ti40e_sync_vsi_filters(vsi, false);\n \n \ti40e_vsi_delete(vsi);\n \ti40e_vsi_free_q_vectors(vsi);\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\nindex 465b1e9..769faf7 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n@@ -565,7 +565,7 @@ static int i40e_alloc_vsi_res(struct i40e_vf *vf, enum i40e_vsi_type type)\n \t}\n \n \t/* program mac filter */\n-\tret = i40e_sync_vsi_filters(vsi);\n+\tret = i40e_sync_vsi_filters(vsi, false);\n \tif (ret)\n \t\tdev_err(&pf->pdev->dev, \"Unable to program ucast filters\\n\");\n \n@@ -1629,7 +1629,7 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)\n \tspin_unlock(&vsi->mac_filter_list_lock);\n \n \t/* program the updated filter list */\n-\tif (i40e_sync_vsi_filters(vsi))\n+\tif (i40e_sync_vsi_filters(vsi, false))\n \t\tdev_err(&pf->pdev->dev, \"Unable to program VF MAC filters\\n\");\n \n error_param:\n@@ -1682,7 +1682,7 @@ static int i40e_vc_del_mac_addr_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)\n \tspin_unlock(&vsi->mac_filter_list_lock);\n \n \t/* program the updated filter list */\n-\tif (i40e_sync_vsi_filters(vsi))\n+\tif (i40e_sync_vsi_filters(vsi, false))\n \t\tdev_err(&pf->pdev->dev, \"Unable to program VF MAC filters\\n\");\n \n error_param:\n@@ -2096,7 +2096,7 @@ int i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)\n \n \tdev_info(&pf->pdev->dev, \"Setting MAC %pM on VF %d\\n\", mac, vf_id);\n \t/* program mac filter */\n-\tif (i40e_sync_vsi_filters(vsi)) {\n+\tif (i40e_sync_vsi_filters(vsi, false)) {\n \t\tdev_err(&pf->pdev->dev, \"Unable to program ucast filters\\n\");\n \t\tret = -EIO;\n \t\tgoto error_param;\n",
    "prefixes": []
}