Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/660582/?format=api
{ "id": 660582, "url": "http://patchwork.ozlabs.org/api/patches/660582/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160818230123.6522.37801.stgit@terminator23.jf.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": "<20160818230123.6522.37801.stgit@terminator23.jf.intel.com>", "list_archive_url": null, "date": "2016-08-18T23:01:23", "name": "[dev-queue] i40e: Add support for switchdev API for Switch ID", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "4bf9ae963ba70e045c90040d91bf079d9f402726", "submitter": { "id": 68504, "url": "http://patchwork.ozlabs.org/api/people/68504/?format=api", "name": "Nambiar, Amritha", "email": "amritha.nambiar@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/20160818230123.6522.37801.stgit@terminator23.jf.intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/660582/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/660582/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 whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\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 3sFhlN2fG9z9t1b\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 19 Aug 2016 09:15:10 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id C9FEF8BFBC;\n\tThu, 18 Aug 2016 23:15:08 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id MSpUrt3FFbAJ; Thu, 18 Aug 2016 23:15:07 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 9F6738BF81;\n\tThu, 18 Aug 2016 23:15:07 +0000 (UTC)", "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 358BB1CFF7B\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 18 Aug 2016 23:15:06 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 3108A8A50D\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 18 Aug 2016 23:15:06 +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 Xtptj7xXUg9h for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 18 Aug 2016 23:15:05 +0000 (UTC)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 5FDA58A964\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 18 Aug 2016 23:15:05 +0000 (UTC)", "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga101.jf.intel.com with ESMTP; 18 Aug 2016 16:15:04 -0700", "from terminator23.jf.intel.com ([10.166.46.76])\n\tby orsmga002.jf.intel.com with ESMTP; 18 Aug 2016 16:15:03 -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,542,1464678000\"; d=\"scan'208\";\n\ta=\"1038155792\"", "From": "Amritha Nambiar <amritha.nambiar@intel.com>", "To": "alexander.h.duyck@intel.com, amritha.nambiar@intel.com,\n\tanjali.singhai@intel.com, john.r.fastabend@intel.com,\n\tintel-wired-lan@lists.osuosl.org, sridhar.samudrala@intel.com", "Date": "Thu, 18 Aug 2016 16:01:23 -0700", "Message-ID": "<20160818230123.6522.37801.stgit@terminator23.jf.intel.com>", "User-Agent": "StGit/0.17.1-dirty", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH] [dev-queue]i40e: Add support for\n\tswitchdev API for Switch ID", "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>", "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 is a follow-on patch to Sridhar's patch series for VF Port\nrepresentor support for SR-IOV VFs on i40e.\n\nThis patch adds support for switchdev ops on the VF Port representors\nand the PF uplink, the only operation implemented is the port attribute\nAPI to get the port parent ID or the switch ID. The switch ID is used\nto identify the net_devices attached to the same HW switch.\n\nThe switch ID returned for the VF Port representors and the PF uplink\nis the phys_port_id.\n\n# ip -d a\n102: enp9s0f0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000\n link/ether 68:05:ca:35:77:50 brd ff:ff:ff:ff:ff:ff promiscuity 0 numtxqueues 64 numrxqueues 64 portid 6805ca357750 switchid 6805ca357750\n vf 0 MAC 00:00:00:00:00:00, spoof checking on, link-state auto\n vf 1 MAC 00:00:00:00:00:00, spoof checking on, link-state auto\n103: enp9s0f1: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000\n link/ether 68:05:ca:35:77:51 brd ff:ff:ff:ff:ff:ff promiscuity 0 numtxqueues 64 numrxqueues 64 portid 6805ca357751 switchid 6805ca357751\n104: enp9s0f0-vf0: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000\n link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 numtxqueues 1 numrxqueues 1 switchid 6805ca357750\n105: enp9s0f0-vf1: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000\n link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff promiscuity 0 numtxqueues 1 numrxqueues 1 switchid 6805ca357750\n inet6 fe80::200:ff:fe00:0/64 scope link tentative\n valid_lft forever preferred_lft forever\n\nSigned-off-by: Amritha Nambiar <amritha.nambiar@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e.h | 1 \n drivers/net/ethernet/intel/i40e/i40e_main.c | 17 ++++++\n drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 57 ++++++++++++++++++++\n drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h | 2 +\n 4 files changed, 77 insertions(+)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h\nindex 2f4525f..0c9d9e6 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e.h\n@@ -54,6 +54,7 @@\n #include <linux/net_tstamp.h>\n #include <linux/ptp_clock_kernel.h>\n #include <net/devlink.h>\n+#include <net/switchdev.h>\n \n #include \"i40e_type.h\"\n #include \"i40e_prototype.h\"\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex 3027bb6..b836b6e 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -9088,6 +9088,20 @@ static const struct net_device_ops i40e_netdev_ops = {\n \t.ndo_bridge_setlink\t= i40e_ndo_bridge_setlink,\n };\n \n+static int i40e_sw_attr_get(struct net_device *dev, struct switchdev_attr *attr)\n+{\n+\tstruct i40e_netdev_priv *np = netdev_priv(dev);\n+\tstruct i40e_pf *pf = np->vsi->back;\n+\tint err = 0;\n+\n+\terr = __i40e_sw_attr_get(pf, attr);\n+\treturn err;\n+}\n+\n+static const struct switchdev_ops i40e_switchdev_ops = {\n+\t.switchdev_port_attr_get\t= i40e_sw_attr_get,\n+};\n+\n /**\n * i40e_config_netdev - Setup the netdev flags\n * @vsi: the VSI being configured\n@@ -9185,6 +9199,9 @@ static int i40e_config_netdev(struct i40e_vsi *vsi)\n \tnetdev->netdev_ops = &i40e_netdev_ops;\n \tnetdev->watchdog_timeo = 5 * HZ;\n \ti40e_set_ethtool_ops(netdev);\n+#ifdef CONFIG_NET_SWITCHDEV\n+\tnetdev->switchdev_ops = &i40e_switchdev_ops;\n+#endif\n #ifdef I40E_FCOE\n \ti40e_fcoe_config_netdev(netdev, vsi);\n #endif\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\nindex 4551c84..fe73bae 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n@@ -1019,6 +1019,60 @@ static const struct net_device_ops i40e_vf_netdev_ops = {\n };\n \n /**\n+ * __i40e_sw_attr_get\n+ * @pf: pointer to the PF structure\n+ * @attr: pointer to switchdev_attr structure\n+ *\n+ * Get switchdev port attributes\n+ **/\n+int __i40e_sw_attr_get(struct i40e_pf *pf, struct switchdev_attr *attr)\n+{\n+\tstruct i40e_hw *hw = &pf->hw;\n+\n+\tif (!(pf->flags & I40E_FLAG_SRIOV_ENABLED))\n+\t\treturn -EOPNOTSUPP;\n+\n+\tswitch (attr->id) {\n+\tcase SWITCHDEV_ATTR_ID_PORT_PARENT_ID:\n+\t\tif (!(pf->flags & I40E_FLAG_PORT_ID_VALID))\n+\t\t\treturn -EOPNOTSUPP;\n+\n+\t\tattr->u.ppid.id_len = min_t(int, sizeof(hw->mac.port_addr),\n+\t\t\t\t\t sizeof(attr->u.ppid.id));\n+\t\tmemcpy(&attr->u.ppid.id, hw->mac.port_addr,\n+\t\t attr->u.ppid.id_len);\n+\t\tbreak;\n+\tdefault:\n+\t\treturn -EOPNOTSUPP;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+/**\n+ * i40e_vf_netdev_sw_attr_get\n+ * @dev: target device\n+ * @attr: pointer to switchdev_attr structure\n+ *\n+ * Handler for switchdev API to get port attributes for VF Port Representor\n+ **/\n+static int i40e_vf_netdev_sw_attr_get(struct net_device *dev,\n+\t\t\t\t struct switchdev_attr *attr)\n+{\n+\tstruct i40e_vf_netdev_priv *priv = netdev_priv(dev);\n+\tstruct i40e_vf *vf = priv->vf;\n+\tstruct i40e_pf *pf = vf->pf;\n+\tint err = 0;\n+\n+\terr = __i40e_sw_attr_get(pf, attr);\n+\treturn err;\n+}\n+\n+static const struct switchdev_ops i40e_vf_netdev_switchdev_ops = {\n+\t.switchdev_port_attr_get\t= i40e_vf_netdev_sw_attr_get,\n+};\n+\n+/**\n * i40e_alloc_vf_netdev\n * @vf: pointer to the VF structure\n * @vf_num: VF number\n@@ -1050,6 +1104,9 @@ int i40e_alloc_vf_netdev(struct i40e_vf *vf, u16 vf_num)\n \n \tnetdev->netdev_ops = &i40e_vf_netdev_ops;\n \ti40e_set_vf_netdev_ethtool_ops(netdev);\n+#ifdef CONFIG_NET_SWITCHDEV\n+\tnetdev->switchdev_ops = &i40e_vf_netdev_switchdev_ops;\n+#endif\n \n \tnetif_carrier_off(netdev);\n \tnetif_tx_disable(netdev);\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h\nindex 1d54b95..049ae59 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h\n@@ -156,4 +156,6 @@ void i40e_vc_notify_reset(struct i40e_pf *pf);\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+int __i40e_sw_attr_get(struct i40e_pf *pf, struct switchdev_attr *attr);\n+\n #endif /* _I40E_VIRTCHNL_PF_H_ */\n", "prefixes": [ "dev-queue" ] }