Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/665035/?format=api
{ "id": 665035, "url": "http://patchwork.ozlabs.org/api/patches/665035/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1472761803-2683-1-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": "<1472761803-2683-1-git-send-email-sridhar.samudrala@intel.com>", "list_archive_url": null, "date": "2016-09-01T20:30:03", "name": "[dev-queue] i40e: Sync link state between VFs and VF Port representors(VFPR).", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "0b6e5339f650615d25a4710f11e54a45b5cb2672", "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/1472761803-2683-1-git-send-email-sridhar.samudrala@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/665035/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/665035/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 3sQFtw5gyvz9s8x\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 2 Sep 2016 07:36:24 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 51AB631B17;\n\tThu, 1 Sep 2016 21:36:23 +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 BwH+aUie4gZn; Thu, 1 Sep 2016 21:36:20 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 241EE31B24;\n\tThu, 1 Sep 2016 21:36:20 +0000 (UTC)", "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 7FECA1CE830\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 1 Sep 2016 21:36:18 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 7BFEE86267\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 1 Sep 2016 21:36:18 +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 KYtqrsYd6RFY for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 1 Sep 2016 21:36:17 +0000 (UTC)", "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id D692585AD0\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 1 Sep 2016 21:36:17 +0000 (UTC)", "from orsmga005.jf.intel.com ([10.7.209.41])\n\tby fmsmga104.fm.intel.com with ESMTP; 01 Sep 2016 14:36:17 -0700", "from unknown (HELO sri-mi-02.jf.intel.com) ([10.166.31.66])\n\tby orsmga005.jf.intel.com with ESMTP; 01 Sep 2016 14:36:17 -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.30,268,1470726000\"; d=\"scan'208\";a=\"3841314\"", "From": "Sridhar Samudrala <sridhar.samudrala@intel.com>", "To": "intel-wired-lan@lists.osuosl.org, john.r.fastabend@intel.com,\n\tanjali.singhai@intel.com, alexander.h.duyck@intel.com", "Date": "Thu, 1 Sep 2016 22:30:03 +0200", "Message-Id": "<1472761803-2683-1-git-send-email-sridhar.samudrala@intel.com>", "X-Mailer": "git-send-email 2.5.5", "Subject": "[Intel-wired-lan] [dev-queue PATCH] i40e: Sync link state between\n\tVFs and VF Port representors(VFPR).", "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\n PF: enp5s0f0, VFs: enp5s2,enp5s2f1 VFPRs:enp5s0f0-vf0, enp5s0f0-vf1\n # modprobe i40e\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 # 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 00:00:00:00:00:00 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 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff\n\n # ip link set enp5s0f0-vf0 down\n # ip link set enp5s2f1 up\n\n /* enp5s2 UP -> enp5s0f0-vf1 CARRIER ON */\n # ip link show enp5s0f0-vf1\n216: enp5s0f0-vf1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000\n link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff\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 6805ca2e7268 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\n vf 1 MAC 00:00:00:00:00:00, spoof checking on, link-state enable\n\nSigned-off-by: Sridhar Samudrala <sridhar.samudrala@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 33 ++++++++++++++++++++++\n 1 file changed, 33 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 5eb2069..99b2ee3 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n@@ -1013,11 +1013,25 @@ complete_reset:\n \n static int i40e_vf_netdev_open(struct net_device *dev)\n {\n+\tstruct i40e_vf_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 static int i40e_vf_netdev_stop(struct net_device *dev)\n {\n+\tstruct i40e_vf_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@@ -1907,6 +1921,10 @@ static int i40e_vc_enable_queues_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)\n \n \tif (i40e_vsi_control_rings(pf->vsi[vf->lan_vsi_idx], true))\n \t\taq_ret = I40E_ERR_TIMEOUT;\n+\n+\tif ((0 == aq_ret) && vf->ctrl_netdev)\n+\t\tnetif_carrier_on(vf->ctrl_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@@ -1947,6 +1965,9 @@ static int i40e_vc_disable_queues_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)\n \tif (i40e_vsi_control_rings(pf->vsi[vf->lan_vsi_idx], false))\n \t\taq_ret = I40E_ERR_TIMEOUT;\n \n+\tif ((0 == aq_ret) && vf->ctrl_netdev)\n+\t\tnetif_carrier_off(vf->ctrl_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@@ -3179,6 +3200,7 @@ int i40e_ndo_set_vf_link_state(struct net_device *netdev, int vf_id, int link)\n \tstruct i40e_virtchnl_pf_event pfe;\n \tstruct i40e_hw *hw = &pf->hw;\n \tstruct i40e_vf *vf;\n+\tstruct net_device *vf_netdev;\n \tint abs_vf_id;\n \tint ret = 0;\n \n@@ -3219,6 +3241,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+\tvf_netdev = vf->ctrl_netdev;\n+\tif (vf_netdev) {\n+\t\tunsigned int flags = vf_netdev->flags;\n+\n+\t\tif (vf->link_up)\n+\t\t\tdev_change_flags(vf_netdev, flags | IFF_UP);\n+\t\telse\n+\t\t\tdev_change_flags(vf_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": [ "dev-queue" ] }