get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 542056,
    "url": "http://patchwork.ozlabs.org/api/patches/542056/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1447112150-10713-1-git-send-email-joshua.a.hay@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": "<1447112150-10713-1-git-send-email-joshua.a.hay@intel.com>",
    "list_archive_url": null,
    "date": "2015-11-09T23:35:50",
    "name": "[next,S21,v2,07/14] i40e: propagate properly",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "b18f9a611f78cd92039f7d0d80e2aaea31a01805",
    "submitter": {
        "id": 19461,
        "url": "http://patchwork.ozlabs.org/api/people/19461/?format=api",
        "name": "Joshua Hay",
        "email": "joshua.a.hay@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/1447112150-10713-1-git-send-email-joshua.a.hay@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/542056/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/542056/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 98C4C140082\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 10 Nov 2015 10:35:57 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 6C4FB31661;\n\tMon,  9 Nov 2015 23:35:56 +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 yXzIlR-lUkQv; Mon,  9 Nov 2015 23:35:54 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 0F7B6307BC;\n\tMon,  9 Nov 2015 23:35:54 +0000 (UTC)",
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 0355D1C1EFE\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  9 Nov 2015 23:35:52 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id F1D5B883F6\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  9 Nov 2015 23:35:51 +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 wp4MpP6-JJf1 for <intel-wired-lan@lists.osuosl.org>;\n\tMon,  9 Nov 2015 23:35:50 +0000 (UTC)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id C019F88363\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  9 Nov 2015 23:35:50 +0000 (UTC)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga101.fm.intel.com with ESMTP; 09 Nov 2015 15:35:50 -0800",
            "from jahay1-mobl2.amr.corp.intel.com (HELO\n\tlocalhost.localdomain.localdomain) ([134.134.176.79])\n\tby FMSMGA003.fm.intel.com with ESMTP; 09 Nov 2015 15:35:51 -0800"
        ],
        "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,267,1444719600\"; d=\"scan'208\";a=\"597198585\"",
        "From": "Joshua Hay <joshua.a.hay@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Mon,  9 Nov 2015 15:35:50 -0800",
        "Message-Id": "<1447112150-10713-1-git-send-email-joshua.a.hay@intel.com>",
        "X-Mailer": "git-send-email 2.1.0",
        "Subject": "[Intel-wired-lan] [next PATCH S21 v2 07/14] i40e: propagate properly",
        "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\ni40e_sync_vsi_filters() is the surly teenager of this driver. It says\nit's going to report errors, but it doesn't actually do that most of the\ntime. And when it does, it leaves a mess.\n\nChange this function to have a common exit point so it will properly\nrelease the busy lock on the VSI. Propagate errors to the callers.\nFinally, adjust a few callers to check for and deal with errors from\nthis function.\n\nSigned-off-by: Mitch Williams <mitch.a.williams@intel.com>\nChange-ID: Ic6af4956491e72402ebb3c538a3c31a0ad7f8667\n---\n drivers/net/ethernet/intel/i40e/i40e_main.c        | 113 +++++++++++++--------\n drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c |  14 +--\n 2 files changed, 76 insertions(+), 51 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex e19a579..c5a24fe 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -1553,11 +1553,8 @@ static int i40e_set_mac(struct net_device *netdev, void *p)\n \t}\n \n \tether_addr_copy(netdev->dev_addr, addr->sa_data);\n-\t/* schedule our worker thread which will take care of\n-\t * applying the new filter changes\n-\t */\n-\ti40e_service_event_schedule(vsi->back);\n-\treturn 0;\n+\n+\treturn i40e_sync_vsi_filters(vsi);\n }\n \n /**\n@@ -1872,8 +1869,9 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)\n \tbool add_happened = false;\n \tint filter_list_len = 0;\n \tu32 changed_flags = 0;\n+\ti40e_status aq_ret = 0;\n \tbool err_cond = false;\n-\ti40e_status ret = 0;\n+\tint retval = 0;\n \tstruct i40e_pf *pf;\n \tint num_add = 0;\n \tint num_del = 0;\n@@ -1936,8 +1934,11 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)\n \t\t}\n \t\tspin_unlock_bh(&vsi->mac_filter_list_lock);\n \n-\t\tif (err_cond)\n+\t\tif (err_cond) {\n \t\t\ti40e_cleanup_add_list(&tmp_add_list);\n+\t\t\tretval = -ENOMEM;\n+\t\t\tgoto out;\n+\t\t}\n \t}\n \n \t/* Now process 'del_list' outside the lock */\n@@ -1955,7 +1956,8 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)\n \t\t\ti40e_undo_del_filter_entries(vsi, &tmp_del_list);\n \t\t\ti40e_undo_add_filter_entries(vsi);\n \t\t\tspin_unlock_bh(&vsi->mac_filter_list_lock);\n-\t\t\treturn -ENOMEM;\n+\t\t\tretval = -ENOMEM;\n+\t\t\tgoto out;\n \t\t}\n \n \t\tlist_for_each_entry_safe(f, ftmp, &tmp_del_list, list) {\n@@ -1973,18 +1975,22 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)\n \n \t\t\t/* flush a full buffer */\n \t\t\tif (num_del == filter_list_len) {\n-\t\t\t\tret = i40e_aq_remove_macvlan(&pf->hw,\n-\t\t\t\t\t\t  vsi->seid, del_list, num_del,\n-\t\t\t\t\t\t  NULL);\n+\t\t\t\taq_ret = i40e_aq_remove_macvlan(&pf->hw,\n+\t\t\t\t\t\t\t\tvsi->seid,\n+\t\t\t\t\t\t\t\tdel_list,\n+\t\t\t\t\t\t\t\tnum_del,\n+\t\t\t\t\t\t\t\tNULL);\n \t\t\t\taq_err = pf->hw.aq.asq_last_status;\n \t\t\t\tnum_del = 0;\n \t\t\t\tmemset(del_list, 0, sizeof(*del_list));\n \n-\t\t\t\tif (ret && aq_err != I40E_AQ_RC_ENOENT)\n+\t\t\t\tif (aq_ret && aq_err != I40E_AQ_RC_ENOENT) {\n+\t\t\t\t\tretval = -EIO;\n \t\t\t\t\tdev_err(&pf->pdev->dev,\n \t\t\t\t\t\t\"ignoring delete macvlan error, err %s, aq_err %s while flushing a full buffer\\n\",\n-\t\t\t\t\t\ti40e_stat_str(&pf->hw, ret),\n+\t\t\t\t\t\ti40e_stat_str(&pf->hw, aq_ret),\n \t\t\t\t\t\ti40e_aq_str(&pf->hw, aq_err));\n+\t\t\t\t}\n \t\t\t}\n \t\t\t/* Release memory for MAC filter entries which were\n \t\t\t * synced up with HW.\n@@ -1994,15 +2000,16 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)\n \t\t}\n \n \t\tif (num_del) {\n-\t\t\tret = i40e_aq_remove_macvlan(&pf->hw, vsi->seid,\n-\t\t\t\t\t\t     del_list, num_del, NULL);\n+\t\t\taq_ret = i40e_aq_remove_macvlan(&pf->hw, vsi->seid,\n+\t\t\t\t\t\t\tdel_list, num_del,\n+\t\t\t\t\t\t\tNULL);\n \t\t\taq_err = pf->hw.aq.asq_last_status;\n \t\t\tnum_del = 0;\n \n-\t\t\tif (ret && aq_err != I40E_AQ_RC_ENOENT)\n+\t\t\tif (aq_ret && aq_err != I40E_AQ_RC_ENOENT)\n \t\t\t\tdev_info(&pf->pdev->dev,\n \t\t\t\t\t \"ignoring delete macvlan error, err %s aq_err %s\\n\",\n-\t\t\t\t\t i40e_stat_str(&pf->hw, ret),\n+\t\t\t\t\t i40e_stat_str(&pf->hw, aq_ret),\n \t\t\t\t\t i40e_aq_str(&pf->hw, aq_err));\n \t\t}\n \n@@ -2026,7 +2033,8 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)\n \t\t\tspin_lock_bh(&vsi->mac_filter_list_lock);\n \t\t\ti40e_undo_add_filter_entries(vsi);\n \t\t\tspin_unlock_bh(&vsi->mac_filter_list_lock);\n-\t\t\treturn -ENOMEM;\n+\t\t\tretval = -ENOMEM;\n+\t\t\tgoto out;\n \t\t}\n \n \t\tlist_for_each_entry_safe(f, ftmp, &tmp_add_list, list) {\n@@ -2047,13 +2055,13 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)\n \n \t\t\t/* flush a full buffer */\n \t\t\tif (num_add == filter_list_len) {\n-\t\t\t\tret = i40e_aq_add_macvlan(&pf->hw, vsi->seid,\n-\t\t\t\t\t\t\t  add_list, num_add,\n-\t\t\t\t\t\t\t  NULL);\n+\t\t\t\taq_ret = i40e_aq_add_macvlan(&pf->hw, vsi->seid,\n+\t\t\t\t\t\t\t     add_list, num_add,\n+\t\t\t\t\t\t\t     NULL);\n \t\t\t\taq_err = pf->hw.aq.asq_last_status;\n \t\t\t\tnum_add = 0;\n \n-\t\t\t\tif (ret)\n+\t\t\t\tif (aq_ret)\n \t\t\t\t\tbreak;\n \t\t\t\tmemset(add_list, 0, sizeof(*add_list));\n \t\t\t}\n@@ -2065,18 +2073,19 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)\n \t\t}\n \n \t\tif (num_add) {\n-\t\t\tret = i40e_aq_add_macvlan(&pf->hw, vsi->seid,\n-\t\t\t\t\t\t  add_list, num_add, NULL);\n+\t\t\taq_ret = i40e_aq_add_macvlan(&pf->hw, vsi->seid,\n+\t\t\t\t\t\t     add_list, num_add, NULL);\n \t\t\taq_err = pf->hw.aq.asq_last_status;\n \t\t\tnum_add = 0;\n \t\t}\n \t\tkfree(add_list);\n \t\tadd_list = NULL;\n \n-\t\tif (add_happened && ret && aq_err != I40E_AQ_RC_EINVAL) {\n+\t\tif (add_happened && aq_ret && aq_err != I40E_AQ_RC_EINVAL) {\n+\t\t\tretval = i40e_aq_rc_to_posix(aq_ret, aq_err);\n \t\t\tdev_info(&pf->pdev->dev,\n \t\t\t\t \"add filter failed, err %s aq_err %s\\n\",\n-\t\t\t\t i40e_stat_str(&pf->hw, ret),\n+\t\t\t\t i40e_stat_str(&pf->hw, aq_ret),\n \t\t\t\t i40e_aq_str(&pf->hw, aq_err));\n \t\t\tif ((pf->hw.aq.asq_last_status == I40E_AQ_RC_ENOSPC) &&\n \t\t\t    !test_bit(__I40E_FILTER_OVERFLOW_PROMISC,\n@@ -2094,16 +2103,19 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)\n \t\tbool cur_multipromisc;\n \n \t\tcur_multipromisc = !!(vsi->current_netdev_flags & IFF_ALLMULTI);\n-\t\tret = i40e_aq_set_vsi_multicast_promiscuous(&vsi->back->hw,\n-\t\t\t\t\t\t\t    vsi->seid,\n-\t\t\t\t\t\t\t    cur_multipromisc,\n-\t\t\t\t\t\t\t    NULL);\n-\t\tif (ret)\n+\t\taq_ret = i40e_aq_set_vsi_multicast_promiscuous(&vsi->back->hw,\n+\t\t\t\t\t\t\t       vsi->seid,\n+\t\t\t\t\t\t\t       cur_multipromisc,\n+\t\t\t\t\t\t\t       NULL);\n+\t\tif (aq_ret) {\n+\t\t\tretval = i40e_aq_rc_to_posix(aq_ret,\n+\t\t\t\t\t\t     pf->hw.aq.asq_last_status);\n \t\t\tdev_info(&pf->pdev->dev,\n \t\t\t\t \"set multi promisc failed, err %s aq_err %s\\n\",\n-\t\t\t\t i40e_stat_str(&pf->hw, ret),\n+\t\t\t\t i40e_stat_str(&pf->hw, aq_ret),\n \t\t\t\t i40e_aq_str(&pf->hw,\n \t\t\t\t\t     pf->hw.aq.asq_last_status));\n+\t\t}\n \t}\n \tif ((changed_flags & IFF_PROMISC) || promisc_forced_on) {\n \t\tbool cur_promisc;\n@@ -2122,36 +2134,47 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)\n \t\t\t\tset_bit(__I40E_PF_RESET_REQUESTED, &pf->state);\n \t\t\t}\n \t\t} else {\n-\t\t\tret = i40e_aq_set_vsi_unicast_promiscuous(\n+\t\t\taq_ret = i40e_aq_set_vsi_unicast_promiscuous(\n \t\t\t\t\t\t\t  &vsi->back->hw,\n \t\t\t\t\t\t\t  vsi->seid,\n \t\t\t\t\t\t\t  cur_promisc, NULL);\n-\t\t\tif (ret)\n+\t\t\tif (aq_ret) {\n+\t\t\t\tretval =\n+\t\t\t\ti40e_aq_rc_to_posix(aq_ret,\n+\t\t\t\t\t\t    pf->hw.aq.asq_last_status);\n \t\t\t\tdev_info(&pf->pdev->dev,\n \t\t\t\t\t \"set unicast promisc failed, err %d, aq_err %d\\n\",\n-\t\t\t\t\t ret, pf->hw.aq.asq_last_status);\n-\t\t\tret = i40e_aq_set_vsi_multicast_promiscuous(\n+\t\t\t\t\t aq_ret, pf->hw.aq.asq_last_status);\n+\t\t\t}\n+\t\t\taq_ret = i40e_aq_set_vsi_multicast_promiscuous(\n \t\t\t\t\t\t\t  &vsi->back->hw,\n \t\t\t\t\t\t\t  vsi->seid,\n \t\t\t\t\t\t\t  cur_promisc, NULL);\n-\t\t\tif (ret)\n+\t\t\tif (aq_ret) {\n+\t\t\t\tretval =\n+\t\t\t\ti40e_aq_rc_to_posix(aq_ret,\n+\t\t\t\t\t\t    pf->hw.aq.asq_last_status);\n \t\t\t\tdev_info(&pf->pdev->dev,\n \t\t\t\t\t \"set multicast promisc failed, err %d, aq_err %d\\n\",\n-\t\t\t\t\t ret, pf->hw.aq.asq_last_status);\n+\t\t\t\t\t aq_ret, pf->hw.aq.asq_last_status);\n+\t\t\t}\n \t\t}\n-\t\tret = i40e_aq_set_vsi_broadcast(&vsi->back->hw,\n-\t\t\t\t\t\tvsi->seid,\n-\t\t\t\t\t\tcur_promisc, NULL);\n-\t\tif (ret)\n+\t\taq_ret = i40e_aq_set_vsi_broadcast(&vsi->back->hw,\n+\t\t\t\t\t\t   vsi->seid,\n+\t\t\t\t\t\t   cur_promisc, NULL);\n+\t\tif (aq_ret) {\n+\t\t\tretval = i40e_aq_rc_to_posix(aq_ret,\n+\t\t\t\t\t\t     pf->hw.aq.asq_last_status);\n \t\t\tdev_info(&pf->pdev->dev,\n \t\t\t\t \"set brdcast promisc failed, err %s, aq_err %s\\n\",\n-\t\t\t\t i40e_stat_str(&pf->hw, ret),\n+\t\t\t\t i40e_stat_str(&pf->hw, aq_ret),\n \t\t\t\t i40e_aq_str(&pf->hw,\n \t\t\t\t\t     pf->hw.aq.asq_last_status));\n+\t\t}\n \t}\n-\n+out:\n \tclear_bit(__I40E_CONFIG_BUSY, &vsi->state);\n-\treturn 0;\n+\treturn retval;\n }\n \n /**\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\nindex 819803c8..30a1d30 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n@@ -1633,9 +1633,10 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)\n \tspin_unlock_bh(&vsi->mac_filter_list_lock);\n \n \t/* program the updated filter list */\n-\tif (i40e_sync_vsi_filters(vsi))\n-\t\tdev_err(&pf->pdev->dev, \"Unable to program VF %d MAC filters\\n\",\n-\t\t\tvf->vf_id);\n+\tret = i40e_sync_vsi_filters(vsi);\n+\tif (ret)\n+\t\tdev_err(&pf->pdev->dev, \"Unable to program VF %d MAC filters, error %d\\n\",\n+\t\t\tvf->vf_id, ret);\n \n error_param:\n \t/* send the response to the VF */\n@@ -1687,9 +1688,10 @@ static int i40e_vc_del_mac_addr_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)\n \tspin_unlock_bh(&vsi->mac_filter_list_lock);\n \n \t/* program the updated filter list */\n-\tif (i40e_sync_vsi_filters(vsi))\n-\t\tdev_err(&pf->pdev->dev, \"Unable to program VF %d MAC filters\\n\",\n-\t\t\tvf->vf_id);\n+\tret = i40e_sync_vsi_filters(vsi);\n+\tif (ret)\n+\t\tdev_err(&pf->pdev->dev, \"Unable to program VF %d MAC filters, error %d\\n\",\n+\t\t\tvf->vf_id, ret);\n \n error_param:\n \t/* send the response to the VF */\n",
    "prefixes": [
        "next",
        "S21",
        "v2",
        "07/14"
    ]
}