get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 663830,
    "url": "http://patchwork.ozlabs.org/api/patches/663830/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160829204344.11658.53719.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": "<20160829204344.11658.53719.stgit@terminator23.jf.intel.com>",
    "list_archive_url": null,
    "date": "2016-08-29T20:43:44",
    "name": "[v2,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/20160829204344.11658.53719.stgit@terminator23.jf.intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/663830/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/663830/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 fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\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 3sNP9f0hxxz9s5g\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 30 Aug 2016 06:57:41 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 2B5EF896C5;\n\tMon, 29 Aug 2016 20:57:40 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 3ZDyTQ7c4BF6; Mon, 29 Aug 2016 20:57:39 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 90FF8896AC;\n\tMon, 29 Aug 2016 20:57:39 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 24A711C14F8\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 29 Aug 2016 20:57:39 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 1F61989696\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 29 Aug 2016 20:57:39 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id xIh3U2uZq7FV for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 29 Aug 2016 20:57:38 +0000 (UTC)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 182DF896AC\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 29 Aug 2016 20:57:38 +0000 (UTC)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga103.fm.intel.com with ESMTP; 29 Aug 2016 13:57:37 -0700",
            "from terminator23.jf.intel.com ([10.166.46.76])\n\tby FMSMGA003.fm.intel.com with ESMTP; 29 Aug 2016 13:57:38 -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,252,1470726000\"; d=\"scan'208\";a=\"754778469\"",
        "From": "Amritha Nambiar <amritha.nambiar@intel.com>",
        "To": "sridhar.samudrala@intel.com, intel-wired-lan@lists.osuosl.org,\n\tamritha.nambiar@intel.com",
        "Date": "Mon, 29 Aug 2016 13:43:44 -0700",
        "Message-ID": "<20160829204344.11658.53719.stgit@terminator23.jf.intel.com>",
        "User-Agent": "StGit/0.17.1-dirty",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [PATCH] [v2,\n\tdev-queue]i40e: Add support for switchdev 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 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\nv2: Resubmitting this patch to base on top of v3 of Sridhar's patch\nseries for VF Port representor support for SR-IOV VFs on i40e.\nThere are no changes from the previous version of patch submitted for this.\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 f531f91..22657ea 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 df213b2..68c1253 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -9085,6 +9085,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@@ -9182,6 +9196,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 8f8067c..5eb2069 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n@@ -1027,6 +1027,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@@ -1058,6 +1112,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": [
        "v2",
        "dev-queue"
    ]
}