get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 862203,
    "url": "http://patchwork.ozlabs.org/api/patches/862203/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180117105339.9336-1-vinschen@redhat.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": "<20180117105339.9336-1-vinschen@redhat.com>",
    "list_archive_url": null,
    "date": "2018-01-17T10:53:39",
    "name": "igb: add VF trust infrastructure",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "1858686a9e263be07a2fc892ae0bbd1b6628624b",
    "submitter": {
        "id": 7921,
        "url": "http://patchwork.ozlabs.org/api/people/7921/?format=api",
        "name": "Corinna Vinschen",
        "email": "vinschen@redhat.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/20180117105339.9336-1-vinschen@redhat.com/mbox/",
    "series": [
        {
            "id": 23853,
            "url": "http://patchwork.ozlabs.org/api/series/23853/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=23853",
            "date": "2018-01-17T10:53:39",
            "name": "igb: add VF trust infrastructure",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/23853/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/862203/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/862203/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@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"
        ],
        "Authentication-Results": "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.133; helo=hemlock.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
        "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 3zM4150NmRz9sDB\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 17 Jan 2018 22:02:15 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 46A9B8966C;\n\tWed, 17 Jan 2018 11:02:13 +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 R7QsDzwFu7Ih; Wed, 17 Jan 2018 11:02:11 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 444648961F;\n\tWed, 17 Jan 2018 11:02:11 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 174531CF007\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 17 Jan 2018 11:02:10 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 132B888544\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 17 Jan 2018 11:02:10 +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 A-7-AC1KsDvd for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 17 Jan 2018 11:02:08 +0000 (UTC)",
            "from drew.franken.de (mail-n.franken.de [193.175.24.27])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id EA4B48853B\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 17 Jan 2018 11:02:07 +0000 (UTC)",
            "from aqua.hirmke.de (aquarius.franken.de [193.175.24.89])\n\t(Authenticated sender: aquarius)\n\tby mail-n.franken.de (Postfix) with ESMTPSA id C3EBD721E282E;\n\tWed, 17 Jan 2018 11:53:39 +0100 (CET)",
            "from calimero.vinschen.de (calimero.vinschen.de [192.168.129.6])\n\tby aqua.hirmke.de (Postfix) with ESMTP id 838145E03AD;\n\tWed, 17 Jan 2018 11:53:39 +0100 (CET)",
            "by calimero.vinschen.de (Postfix, from userid 500)\n\tid 77A80A8095C; Wed, 17 Jan 2018 11:53:39 +0100 (CET)"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "delayed 00:08:23 by SQLgrey-1.7.6",
        "From": "Corinna Vinschen <vinschen@redhat.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Wed, 17 Jan 2018 11:53:39 +0100",
        "Message-Id": "<20180117105339.9336-1-vinschen@redhat.com>",
        "X-Mailer": "git-send-email 2.14.3",
        "Subject": "[Intel-wired-lan] [PATCH] igb: add VF trust infrastructure",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.24",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "Cc": "netdev@vger.kernel.org",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "* Add a per-VF value to know if a VF is trusted, by default don't\n  trust VFs.\n\n* Implement netdev op to trust VFs (igb_ndo_set_vf_trust) and add\n  trust status to ndo_get_vf_config output.\n\n* Allow a trusted VF to change MAC and MAC filters even if MAC\n  has been administratively set.\n\nSigned-off-by: Corinna Vinschen <vinschen@redhat.com>\n---\n drivers/net/ethernet/intel/igb/igb.h      |  1 +\n drivers/net/ethernet/intel/igb/igb_main.c | 30 +++++++++++++++++++++++++++---\n 2 files changed, 28 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/igb/igb.h b/drivers/net/ethernet/intel/igb/igb.h\nindex 1c6b8d9176a8..55d6f17d5799 100644\n--- a/drivers/net/ethernet/intel/igb/igb.h\n+++ b/drivers/net/ethernet/intel/igb/igb.h\n@@ -109,6 +109,7 @@ struct vf_data_storage {\n \tu16 pf_qos;\n \tu16 tx_rate;\n \tbool spoofchk_enabled;\n+\tbool trusted;\n };\n \n /* Number of unicast MAC filters reserved for the PF in the RAR registers */\ndiff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c\nindex 749fb1f720b4..5cbec6cf2b2a 100644\n--- a/drivers/net/ethernet/intel/igb/igb_main.c\n+++ b/drivers/net/ethernet/intel/igb/igb_main.c\n@@ -190,6 +190,8 @@ static int igb_ndo_set_vf_vlan(struct net_device *netdev,\n static int igb_ndo_set_vf_bw(struct net_device *, int, int, int);\n static int igb_ndo_set_vf_spoofchk(struct net_device *netdev, int vf,\n \t\t\t\t   bool setting);\n+static int igb_ndo_set_vf_trust(struct net_device *netdev, int vf,\n+\t\t\t\tbool setting);\n static int igb_ndo_get_vf_config(struct net_device *netdev, int vf,\n \t\t\t\t struct ifla_vf_info *ivi);\n static void igb_check_vf_rate_limit(struct igb_adapter *);\n@@ -2527,6 +2529,7 @@ static const struct net_device_ops igb_netdev_ops = {\n \t.ndo_set_vf_vlan\t= igb_ndo_set_vf_vlan,\n \t.ndo_set_vf_rate\t= igb_ndo_set_vf_bw,\n \t.ndo_set_vf_spoofchk\t= igb_ndo_set_vf_spoofchk,\n+\t.ndo_set_vf_trust\t= igb_ndo_set_vf_trust,\n \t.ndo_get_vf_config\t= igb_ndo_get_vf_config,\n #ifdef CONFIG_NET_POLL_CONTROLLER\n \t.ndo_poll_controller\t= igb_netpoll,\n@@ -6383,6 +6386,9 @@ static int igb_vf_configure(struct igb_adapter *adapter, int vf)\n \t/* By default spoof check is enabled for all VFs */\n \tadapter->vf_data[vf].spoofchk_enabled = true;\n \n+\t/* By default VFs are not trusted */\n+\tadapter->vf_data[vf].trusted = false;\n+\n \treturn 0;\n }\n \n@@ -6940,13 +6946,13 @@ static int igb_set_vf_mac_filter(struct igb_adapter *adapter, const int vf,\n \t\t}\n \t\tbreak;\n \tcase E1000_VF_MAC_FILTER_ADD:\n-\t\tif (vf_data->flags & IGB_VF_FLAG_PF_SET_MAC) {\n+\t\tif ((vf_data->flags & IGB_VF_FLAG_PF_SET_MAC) &&\n+\t\t    !vf_data->trusted) {\n \t\t\tdev_warn(&pdev->dev,\n \t\t\t\t \"VF %d requested MAC filter but is administratively denied\\n\",\n \t\t\t\t vf);\n \t\t\treturn -EINVAL;\n \t\t}\n-\n \t\tif (!is_valid_ether_addr(addr)) {\n \t\t\tdev_warn(&pdev->dev,\n \t\t\t\t \"VF %d attempted to set invalid MAC filter\\n\",\n@@ -6998,7 +7004,8 @@ static int igb_set_vf_mac_addr(struct igb_adapter *adapter, u32 *msg, int vf)\n \tint ret = 0;\n \n \tif (!info) {\n-\t\tif (vf_data->flags & IGB_VF_FLAG_PF_SET_MAC) {\n+\t\tif ((vf_data->flags & IGB_VF_FLAG_PF_SET_MAC) &&\n+\t\t    !vf_data->trusted) {\n \t\t\tdev_warn(&pdev->dev,\n \t\t\t\t \"VF %d attempted to override administratively set MAC address\\nReload the VF driver to resume operations\\n\",\n \t\t\t\t vf);\n@@ -8934,6 +8941,22 @@ static int igb_ndo_set_vf_spoofchk(struct net_device *netdev, int vf,\n \treturn 0;\n }\n \n+static int igb_ndo_set_vf_trust(struct net_device *netdev, int vf, bool setting)\n+{\n+\tstruct igb_adapter *adapter = netdev_priv(netdev);\n+\n+\tif (vf >= adapter->vfs_allocated_count)\n+\t\treturn -EINVAL;\n+\tif (adapter->vf_data[vf].trusted == setting)\n+\t\treturn 0;\n+\n+\tadapter->vf_data[vf].trusted = setting;\n+\n+\tdev_info(&adapter->pdev->dev, \"VF %u is %strusted\\n\",\n+\t\t vf, setting ? \"\" : \"not \");\n+\treturn 0;\n+}\n+\n static int igb_ndo_get_vf_config(struct net_device *netdev,\n \t\t\t\t int vf, struct ifla_vf_info *ivi)\n {\n@@ -8947,6 +8970,7 @@ static int igb_ndo_get_vf_config(struct net_device *netdev,\n \tivi->vlan = adapter->vf_data[vf].pf_vlan;\n \tivi->qos = adapter->vf_data[vf].pf_qos;\n \tivi->spoofchk = adapter->vf_data[vf].spoofchk_enabled;\n+\tivi->trusted = adapter->vf_data[vf].trusted;\n \treturn 0;\n }\n \n",
    "prefixes": []
}