Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/660512/?format=api
{ "id": 660512, "url": "http://patchwork.ozlabs.org/api/patches/660512/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1471542901-13405-2-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": "<1471542901-13405-2-git-send-email-sridhar.samudrala@intel.com>", "list_archive_url": null, "date": "2016-08-18T17:54:59", "name": "[dev-queue,v2,1/3] i40e: Introduce VF port representor/control netdevs.", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "139a950015081cbd45220e2dd225e170700f6303", "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/1471542901-13405-2-git-send-email-sridhar.samudrala@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/660512/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/660512/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 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 3sFb6P1JYCz9t1F\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 19 Aug 2016 05:01:17 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id AD59F8A51C;\n\tThu, 18 Aug 2016 19:01:15 +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 udtPXhQLY3zG; Thu, 18 Aug 2016 19:01:13 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id BC99D8703B;\n\tThu, 18 Aug 2016 19:01:13 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id C82361C2D62\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 18 Aug 2016 19:01:10 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id BDF96306EF\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 18 Aug 2016 19:01:10 +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 SOArTd5oVdP4 for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 18 Aug 2016 19:01:08 +0000 (UTC)", "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby silver.osuosl.org (Postfix) with ESMTP id BC0D23176A\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 18 Aug 2016 19:01:08 +0000 (UTC)", "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby orsmga103.jf.intel.com with ESMTP; 18 Aug 2016 12:01:08 -0700", "from unknown (HELO sri-mi-02.jf.intel.com) ([10.166.31.66])\n\tby fmsmga001.fm.intel.com with ESMTP; 18 Aug 2016 12:01:09 -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.28,541,1464678000\"; d=\"scan'208\";\n\ta=\"1027890210\"", "From": "Sridhar Samudrala <sridhar.samudrala@intel.com>", "To": "intel-wired-lan@lists.osuosl.org, anjali.singhai@intel.com,\n\tjohn.r.fastabend@intel.com, amritha.nambiar@intel.com,\n\talexander.h.duyck@intel.com", "Date": "Thu, 18 Aug 2016 19:54:59 +0200", "Message-Id": "<1471542901-13405-2-git-send-email-sridhar.samudrala@intel.com>", "X-Mailer": "git-send-email 2.5.5", "In-Reply-To": "<1471542901-13405-1-git-send-email-sridhar.samudrala@intel.com>", "References": "<1471542901-13405-1-git-send-email-sridhar.samudrala@intel.com>", "Subject": "[Intel-wired-lan] [dev-queue PATCH v2 1/3] i40e: Introduce VF port\n\trepresentor/control netdevs.", "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 creation of a VF Port representor/Control netdev\nassociated with each VF. These netdevs can be used to control and configure\nVFs from PFs namespace. They enable exposing VF statistics, configuring\nlink state, mtu, fdb/vlan entries etc.\n\n # echo 2 > /sys/class/net/enp5s0f0/device/sriov_numvfs\n # ip l show\n 297: 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\n vf 0 MAC 00:00:00:00:00:00, spoof checking on, link-state auto, trust off\n vf 1 MAC 00:00:00:00:00:00, spoof checking on, link-state auto, trust off\n 299: enp5s0f0-vf0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop 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 300: enp5s0f0-vf1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop 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\nSigned-off-by: Sridhar Samudrala <sridhar.samudrala@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 88 ++++++++++++++++++++++\n drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h | 14 ++++\n 2 files changed, 102 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 da34235..6167e56 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n@@ -1003,6 +1003,90 @@ complete_reset:\n \tclear_bit(__I40E_VF_DISABLE, &pf->state);\n }\n \n+static int i40e_vf_netdev_open(struct net_device *dev)\n+{\n+\treturn 0;\n+}\n+\n+static int i40e_vf_netdev_stop(struct net_device *dev)\n+{\n+\treturn 0;\n+}\n+\n+static const struct net_device_ops i40e_vf_netdev_ops = {\n+\t.ndo_open = i40e_vf_netdev_open,\n+\t.ndo_stop = i40e_vf_netdev_stop,\n+};\n+\n+/**\n+ * i40e_alloc_vf_netdev\n+ * @vf: pointer to the VF structure\n+ * @vf_num: VF number\n+ *\n+ * Create VF representor/control netdev\n+ **/\n+int i40e_alloc_vf_netdev(struct i40e_vf *vf, u16 vf_num)\n+{\n+\tstruct net_device *netdev;\n+\tchar netdev_name[IFNAMSIZ];\n+\tstruct i40e_vf_netdev_priv *priv;\n+\tstruct i40e_pf *pf = vf->pf;\n+\tstruct i40e_vsi *vsi = pf->vsi[pf->lan_vsi];\n+\tint err;\n+\n+\tsnprintf(netdev_name, IFNAMSIZ, \"%s-vf%d\", vsi->netdev->name, vf_num);\n+\tnetdev = alloc_netdev(sizeof(struct i40e_vf_netdev_priv), netdev_name,\n+\t\t\t NET_NAME_UNKNOWN, ether_setup);\n+\tif (!netdev) {\n+\t\tdev_err(&pf->pdev->dev, \"alloc_netdev failed for vf:%d\\n\",\n+\t\t\tvf_num);\n+\t\treturn -ENOMEM;\n+\t}\n+\n+\tpf->vf[vf_num].ctrl_netdev = netdev;\n+\n+\tpriv = netdev_priv(netdev);\n+\tpriv->vf = &(pf->vf[vf_num]);\n+\n+\tnetdev->netdev_ops = &i40e_vf_netdev_ops;\n+\n+\tnetif_carrier_off(netdev);\n+\tnetif_tx_disable(netdev);\n+\n+\terr = register_netdev(netdev);\n+\tif (err) {\n+\t\tdev_err(&pf->pdev->dev, \"register_netdev failed for vf: %s\\n\",\n+\t\t\tvf->ctrl_netdev->name);\n+\t\tfree_netdev(netdev);\n+\t\treturn err;\n+\t}\n+\n+\tdev_info(&pf->pdev->dev, \"VF representor(%s) created for VF %d\\n\",\n+\t\t vf->ctrl_netdev->name, vf_num);\n+\n+\treturn 0;\n+}\n+\n+/**\n+ * i40e_free_vf_netdev\n+ * @vf: pointer to the VF structure\n+ *\n+ * Free VF representor/control netdev\n+ **/\n+void i40e_free_vf_netdev(struct i40e_vf *vf)\n+{\n+\tstruct i40e_pf *pf = vf->pf;\n+\n+\tif (!vf->ctrl_netdev)\n+\t\treturn;\n+\n+\tdev_info(&pf->pdev->dev, \"Freeing VF representor(%s)\\n\",\n+\t\t vf->ctrl_netdev->name);\n+\n+\tunregister_netdev(vf->ctrl_netdev);\n+\tfree_netdev(vf->ctrl_netdev);\n+}\n+\n /**\n * i40e_free_vfs\n * @pf: pointer to the PF structure\n@@ -1045,6 +1129,8 @@ void i40e_free_vfs(struct i40e_pf *pf)\n \t\t\ti40e_free_vf_res(&pf->vf[i]);\n \t\t/* disable qp mappings */\n \t\ti40e_disable_vf_mappings(&pf->vf[i]);\n+\n+\t\ti40e_free_vf_netdev(&pf->vf[i]);\n \t}\n \n \tkfree(pf->vf);\n@@ -1112,6 +1198,8 @@ int i40e_alloc_vfs(struct i40e_pf *pf, u16 num_alloc_vfs)\n \t\t/* VF resources get allocated during reset */\n \t\ti40e_reset_vf(&vfs[i], false);\n \n+\t\ti40e_alloc_vf_netdev(&vfs[i], i);\n+\n \t}\n \tpf->num_alloc_vfs = num_alloc_vfs;\n \ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h\nindex 8751741..1d54b95 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h\n@@ -72,10 +72,21 @@ enum i40e_vf_capabilities {\n \tI40E_VIRTCHNL_VF_CAP_IWARP,\n };\n \n+/* VF Ctrl netdev private structure */\n+struct i40e_vf_netdev_priv {\n+\tstruct i40e_vf *vf;\n+};\n+\n /* VF information structure */\n struct i40e_vf {\n \tstruct i40e_pf *pf;\n \n+\t/* VF Port representor netdev that allows control and configuration\n+\t * of VFs from the host. Enables returning VF stats, configuring link\n+\t * state, mtu, fdb/vlans etc.\n+\t */\n+\tstruct net_device *ctrl_netdev;\n+\n \t/* VF id in the PF space */\n \ts16 vf_id;\n \t/* all VF vsis connect to the same parent */\n@@ -142,4 +153,7 @@ int i40e_ndo_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool enable);\n void i40e_vc_notify_link_state(struct i40e_pf *pf);\n void i40e_vc_notify_reset(struct i40e_pf *pf);\n \n+int i40e_alloc_vf_netdev(struct i40e_vf *vf, u16 vf_num);\n+void i40e_free_vf_netdev(struct i40e_vf *vf);\n+\n #endif /* _I40E_VIRTCHNL_PF_H_ */\n", "prefixes": [ "dev-queue", "v2", "1/3" ] }