get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 714688,
    "url": "http://patchwork.ozlabs.org/api/patches/714688/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1484260510-9162-4-git-send-email-sridhar.samudrala@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": "<1484260510-9162-4-git-send-email-sridhar.samudrala@intel.com>",
    "list_archive_url": null,
    "date": "2017-01-12T22:35:06",
    "name": "[next-queue,v4,3/7] i40e: Sync link state between VFs and VFPRs",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "12fb4d34cb09484044744b3630f5df8afe61b0eb",
    "submitter": {
        "id": 65219,
        "url": "http://patchwork.ozlabs.org/api/people/65219/?format=api",
        "name": "Samudrala, Sridhar",
        "email": "sridhar.samudrala@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/1484260510-9162-4-git-send-email-sridhar.samudrala@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/714688/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/714688/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\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 3v00vc33wFz9t15\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 13 Jan 2017 09:35:24 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id BF48D2DEF9;\n\tThu, 12 Jan 2017 22:35:21 +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 KQG7XMhOhPo8; Thu, 12 Jan 2017 22:35:19 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 0F5E7303A0;\n\tThu, 12 Jan 2017 22:35:19 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id F2FE01C001E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 12 Jan 2017 22:35:17 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id EB09C268F4\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 12 Jan 2017 22:35: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 Ll8CjgXydc-v for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 12 Jan 2017 22:35:16 +0000 (UTC)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 3E2B52DAA8\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 12 Jan 2017 22:35:16 +0000 (UTC)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga101.fm.intel.com with ESMTP; 12 Jan 2017 14:35:16 -0800",
            "from sri-mi-02.jf.intel.com ([10.166.188.51])\n\tby FMSMGA003.fm.intel.com with ESMTP; 12 Jan 2017 14:35:15 -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.33,220,1477983600\"; d=\"scan'208\";a=\"808217572\"",
        "From": "Sridhar Samudrala <sridhar.samudrala@intel.com>",
        "To": "alexander.h.duyck@intel.com, john.r.fastabend@intel.com,\n\tanjali.singhai@intel.com, jakub.kicinski@netronome.com,\n\tdavem@davemloft.net, scott.d.peterson@intel.com, gerlitz.or@gmail.com,\n\tjiri@resnulli.us, intel-wired-lan@lists.osuosl.org,\n\tnetdev@vger.kernel.org",
        "Date": "Thu, 12 Jan 2017 14:35:06 -0800",
        "Message-Id": "<1484260510-9162-4-git-send-email-sridhar.samudrala@intel.com>",
        "X-Mailer": "git-send-email 2.5.5",
        "In-Reply-To": "<1484260510-9162-1-git-send-email-sridhar.samudrala@intel.com>",
        "References": "<1484260510-9162-1-git-send-email-sridhar.samudrala@intel.com>",
        "Subject": "[Intel-wired-lan] [next-queue v4 PATCH 3/7] i40e: Sync link state\n\tbetween VFs and VFPRs",
        "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": "This patch enables\n- reflecting the link state of VFPR based on VF admin state & link state\n  of VF based on admin state of VFPR.\n- bringing up/down the VFPR sends a notification to update VF link state.\n- bringing up/down the VF will cause the link state update of VFPR.\n- enable/disable VF link state via ndo_set_vf_link_state will update the\n  admin state of associated VFPR.\n\nPF: enp5s0f0, VFs: enp5s2,enp5s2f1 VFPRs:enp5s0f0-vf0, enp5s0f0-vf1\n# rmmod i40e; modprobe i40e\n# devlink dev eswitch set pci/0000:05:00.0 mode switchdev\n# echo 2 > /sys/class/net/enp5s0f0/device/sriov_numvfs\n\n# ip link set enp5s2 up\n# ip link set enp5s0f0-vf0 up\n# ip link set enp5s0f0-vf1 up\n\n/* enp5s2 UP -> enp5s0f0-vf0 CARRIER ON */\n# ip link show enp5s0f0-vf0\n215: enp5s0f0-vf0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000\n     link/ether 68:05:ca:2e:72:68 brd ff:ff:ff:ff:ff:ff\n\n/* enp5s0f0-vf0 UP -> enp5s2 CARRIER ON */\n# ip link show enp5s2\n218: enp5s2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000\n     link/ether ea:4d:60:bc:6f:85 brd ff:ff:ff:ff:ff:ff\n\n/* enp5s2f1 DOWN -> enp5s0f0-vf1 NO-CARRIER */\n# ip link show enp5s0f0-vf1\n216: enp5s0f0-vf1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000\n     link/ether 68:05:ca:2e:72:68 brd ff:ff:ff:ff:ff:ff\n\n# ip link set enp5s0f0-vf0 down\n# ip link set enp5s2f1 up\n\n/* enp5s0-vf0 DOWN -> enp5s2 NO_CARRIER */\n# ip link show enp5s2\n218: enp5s2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000\n     link/ether ea:4d:60:bc:6f:85 brd ff:ff:ff:ff:ff:ff\n\n# ip -d link show enp5s0f0\n213: enp5s0f0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop portid 6805ca27268 state DOWN mode DEFAULT group default qlen 1000\n     link/ether 68:05:ca:2e:72:68 brd ff:ff:ff:ff:ff:ff promiscuity 0 addrgenmode eui64\n     vf 0 MAC 00:00:00:00:00:00, spoof checking on, link-state disable, trust off\n     vf 1 MAC 00:00:00:00:00:00, spoof checking on, link-state enable, trust off\n\nSigned-off-by: Sridhar Samudrala <sridhar.samudrala@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 54 ++++++++++++++++++++++\n 1 file changed, 54 insertions(+)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\nindex f9927dc..275113c 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n@@ -1029,6 +1029,13 @@ void i40e_reset_vf(struct i40e_vf *vf, bool flr)\n  **/\n static int i40e_vfpr_netdev_open(struct net_device *dev)\n {\n+\tstruct i40e_vfpr_netdev_priv *priv = netdev_priv(dev);\n+\tstruct i40e_vf *vf = priv->vf;\n+\n+\tvf->link_forced = true;\n+\tvf->link_up = true;\n+\ti40e_vc_notify_vf_link_state(vf);\n+\n \treturn 0;\n }\n \n@@ -1040,6 +1047,13 @@ static int i40e_vfpr_netdev_open(struct net_device *dev)\n  **/\n static int i40e_vfpr_netdev_stop(struct net_device *dev)\n {\n+\tstruct i40e_vfpr_netdev_priv *priv = netdev_priv(dev);\n+\tstruct i40e_vf *vf = priv->vf;\n+\n+\tvf->link_forced = true;\n+\tvf->link_up = false;\n+\ti40e_vc_notify_vf_link_state(vf);\n+\n \treturn 0;\n }\n \n@@ -1126,6 +1140,13 @@ int i40e_alloc_vfpr_netdev(struct i40e_vf *vf, u16 vf_num)\n \t/* Delete broadcast filter for VF */\n \ti40e_update_vf_broadcast_filter(vf, false);\n \n+\t/* Reset VF link as we are changing the mode to 'switchdev'. VFPR netdev\n+\t * needs to be brought up to enable VF link.\n+\t */\n+\tvf->link_forced = true;\n+\tvf->link_up = false;\n+\ti40e_vc_notify_vf_link_state(vf);\n+\n \treturn 0;\n }\n \n@@ -1150,6 +1171,10 @@ void i40e_free_vfpr_netdev(struct i40e_vf *vf)\n \n \t/* Add broadcast filter to VF */\n \ti40e_update_vf_broadcast_filter(vf, true);\n+\n+\t/* In legacy mode, VF link is not controlled by VFPR */\n+\tvf->link_forced = false;\n+\ti40e_vc_notify_vf_link_state(vf);\n }\n \n /**\n@@ -1907,8 +1932,17 @@ static int i40e_vc_enable_queues_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)\n \t\tgoto error_param;\n \t}\n \n+\tif (vf->link_forced && !vf->link_up) {\n+\t\taq_ret = I40E_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n \tif (i40e_vsi_start_rings(pf->vsi[vf->lan_vsi_idx]))\n \t\taq_ret = I40E_ERR_TIMEOUT;\n+\n+\tif ((aq_ret == 0) && vf->vfpr_netdev)\n+\t\tnetif_carrier_on(vf->vfpr_netdev);\n+\n error_param:\n \t/* send the response to the VF */\n \treturn i40e_vc_send_resp_to_vf(vf, I40E_VIRTCHNL_OP_ENABLE_QUEUES,\n@@ -1946,8 +1980,16 @@ static int i40e_vc_disable_queues_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)\n \t\tgoto error_param;\n \t}\n \n+\tif (vf->link_forced && vf->link_up) {\n+\t\taq_ret = I40E_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n \ti40e_vsi_stop_rings(pf->vsi[vf->lan_vsi_idx]);\n \n+\tif ((aq_ret == 0) && vf->vfpr_netdev)\n+\t\tnetif_carrier_off(vf->vfpr_netdev);\n+\n error_param:\n \t/* send the response to the VF */\n \treturn i40e_vc_send_resp_to_vf(vf, I40E_VIRTCHNL_OP_DISABLE_QUEUES,\n@@ -3183,6 +3225,7 @@ int i40e_ndo_set_vf_link_state(struct net_device *netdev, int vf_id, int link)\n \tstruct i40e_netdev_priv *np = netdev_priv(netdev);\n \tstruct i40e_pf *pf = np->vsi->back;\n \tstruct i40e_virtchnl_pf_event pfe;\n+\tstruct net_device *vfpr_netdev;\n \tstruct i40e_hw *hw = &pf->hw;\n \tstruct i40e_vf *vf;\n \tint abs_vf_id;\n@@ -3225,6 +3268,17 @@ int i40e_ndo_set_vf_link_state(struct net_device *netdev, int vf_id, int link)\n \t\tret = -EINVAL;\n \t\tgoto error_out;\n \t}\n+\n+\tvfpr_netdev = vf->vfpr_netdev;\n+\tif (vfpr_netdev) {\n+\t\tunsigned int flags = vfpr_netdev->flags;\n+\n+\t\tif (vf->link_up)\n+\t\t\tdev_change_flags(vfpr_netdev, flags | IFF_UP);\n+\t\telse\n+\t\t\tdev_change_flags(vfpr_netdev, flags & ~IFF_UP);\n+\t}\n+\n \t/* Notify the VF of its new link state */\n \ti40e_aq_send_msg_to_vf(hw, abs_vf_id, I40E_VIRTCHNL_OP_EVENT,\n \t\t\t       0, (u8 *)&pfe, sizeof(pfe), NULL);\n",
    "prefixes": [
        "next-queue",
        "v4",
        "3/7"
    ]
}