get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 706307,
    "url": "http://patchwork.ozlabs.org/api/patches/706307/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1481854712-29454-2-git-send-email-donald.c.skidmore@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": "<1481854712-29454-2-git-send-email-donald.c.skidmore@intel.com>",
    "list_archive_url": null,
    "date": "2016-12-16T02:18:32",
    "name": "[2/2] ixgbe: Add PF support for VF promiscuous mode",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "c24e480404bf0555cc4e885d4b4d678b2c6ea48c",
    "submitter": {
        "id": 4487,
        "url": "http://patchwork.ozlabs.org/api/people/4487/?format=api",
        "name": "Skidmore, Donald C",
        "email": "donald.c.skidmore@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/1481854712-29454-2-git-send-email-donald.c.skidmore@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/706307/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/706307/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 3tfsvr6DDFz9snm\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 16 Dec 2016 12:21:12 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 5FDFD831E8;\n\tFri, 16 Dec 2016 01:21:11 +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 MW5nQ9wNFuPS; Fri, 16 Dec 2016 01:21:10 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 720C2831F4;\n\tFri, 16 Dec 2016 01:21:10 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 1D9FD1C0621\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 16 Dec 2016 01:21:09 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 140C02A180\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 16 Dec 2016 01:21:09 +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 l12iGowWrzYE for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 16 Dec 2016 01:21:08 +0000 (UTC)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby silver.osuosl.org (Postfix) with ESMTPS id F395D2A179\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 16 Dec 2016 01:21:07 +0000 (UTC)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga105.fm.intel.com with ESMTP; 15 Dec 2016 17:21:07 -0800",
            "from dcskidmo-m40.jf.intel.com ([134.134.3.124])\n\tby orsmga001.jf.intel.com with ESMTP; 15 Dec 2016 17:21:07 -0800"
        ],
        "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.33,355,1477983600\"; d=\"scan'208\";\n\ta=\"1072616249\"",
        "From": "Donald C Skidmore <donald.c.skidmore@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Thu, 15 Dec 2016 21:18:32 -0500",
        "Message-Id": "<1481854712-29454-2-git-send-email-donald.c.skidmore@intel.com>",
        "X-Mailer": "git-send-email 2.4.3",
        "In-Reply-To": "<1481854712-29454-1-git-send-email-donald.c.skidmore@intel.com>",
        "References": "<1481854712-29454-1-git-send-email-donald.c.skidmore@intel.com>",
        "Subject": "[Intel-wired-lan] [PATCH 2/2] ixgbe: Add PF support for VF\n\tpromiscuous mode",
        "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 extends the xcast mailbox message to include support for\nunicast promiscuous mode.  To allow a VF to enter this mode the PF\nmust be in promiscuous mode.\n\nA later patch will add the support needed in the VF driver (ixgbevf)\n\nSigned-off-by: Don Skidmore <donald.c.skidmore@intel.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe.h       |  1 +\n drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h   |  1 +\n drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 47 ++++++++++++++++++++++----\n drivers/net/ethernet/intel/ixgbe/ixgbe_type.h  |  2 ++\n 4 files changed, 45 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h\nindex 0b1bcb1..9c6ccfc 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h\n@@ -159,6 +159,7 @@ enum ixgbevf_xcast_modes {\n \tIXGBEVF_XCAST_MODE_NONE = 0,\n \tIXGBEVF_XCAST_MODE_MULTI,\n \tIXGBEVF_XCAST_MODE_ALLMULTI,\n+\tIXGBEVF_XCAST_MODE_PROMISC,\n };\n \n struct vf_macvlans {\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h\nindex 01c2667..811cb4f 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h\n@@ -74,6 +74,7 @@ enum ixgbe_pfvf_api_rev {\n \tixgbe_mbox_api_20,\t/* API version 2.0, solaris Phase1 VF driver */\n \tixgbe_mbox_api_11,\t/* API version 1.1, linux/freebsd VF driver */\n \tixgbe_mbox_api_12,\t/* API version 1.2, linux/freebsd VF driver */\n+\tixgbe_mbox_api_13,\t/* API version 1.3, linux/freebsd VF driver */\n \t/* This value should always be last */\n \tixgbe_mbox_api_unknown,\t/* indicates that API version is not known */\n };\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c\nindex dd1187c..044cb44 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c\n@@ -512,6 +512,7 @@ static s32 ixgbe_set_vf_lpe(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf)\n \t\tswitch (adapter->vfinfo[vf].vf_api) {\n \t\tcase ixgbe_mbox_api_11:\n \t\tcase ixgbe_mbox_api_12:\n+\t\tcase ixgbe_mbox_api_13:\n \t\t\t/*\n \t\t\t * Version 1.1 supports jumbo frames on VFs if PF has\n \t\t\t * jumbo frames enabled which means legacy VFs are\n@@ -979,6 +980,7 @@ static int ixgbe_negotiate_vf_api(struct ixgbe_adapter *adapter,\n \tcase ixgbe_mbox_api_10:\n \tcase ixgbe_mbox_api_11:\n \tcase ixgbe_mbox_api_12:\n+\tcase ixgbe_mbox_api_13:\n \t\tadapter->vfinfo[vf].vf_api = api;\n \t\treturn 0;\n \tdefault:\n@@ -1003,6 +1005,7 @@ static int ixgbe_get_vf_queues(struct ixgbe_adapter *adapter,\n \tcase ixgbe_mbox_api_20:\n \tcase ixgbe_mbox_api_11:\n \tcase ixgbe_mbox_api_12:\n+\tcase ixgbe_mbox_api_13:\n \t\tbreak;\n \tdefault:\n \t\treturn -1;\n@@ -1042,8 +1045,13 @@ static int ixgbe_get_vf_reta(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf)\n \t\treturn -EPERM;\n \n \t/* verify the PF is supporting the correct API */\n-\tif (adapter->vfinfo[vf].vf_api != ixgbe_mbox_api_12)\n+\tswitch (adapter->vfinfo[vf].vf_api) {\n+\tcase ixgbe_mbox_api_13:\n+\tcase ixgbe_mbox_api_12:\n+\t\tbreak;\n+\tdefault:\n \t\treturn -EOPNOTSUPP;\n+\t}\n \n \t/* This mailbox command is supported (required) only for 82599 and x540\n \t * VFs which support up to 4 RSS queues. Therefore we will compress the\n@@ -1069,8 +1077,13 @@ static int ixgbe_get_vf_rss_key(struct ixgbe_adapter *adapter,\n \t\treturn -EPERM;\n \n \t/* verify the PF is supporting the correct API */\n-\tif (adapter->vfinfo[vf].vf_api != ixgbe_mbox_api_12)\n+\tswitch (adapter->vfinfo[vf].vf_api) {\n+\tcase ixgbe_mbox_api_13:\n+\tcase ixgbe_mbox_api_12:\n+\t\tbreak;\n+\tdefault:\n \t\treturn -EOPNOTSUPP;\n+\t}\n \n \tmemcpy(rss_key, adapter->rss_key, sizeof(adapter->rss_key));\n \n@@ -1082,11 +1095,16 @@ static int ixgbe_update_vf_xcast_mode(struct ixgbe_adapter *adapter,\n {\n \tstruct ixgbe_hw *hw = &adapter->hw;\n \tint xcast_mode = msgbuf[1];\n-\tu32 vmolr, disable, enable;\n+\tu32 vmolr, fctrl, disable, enable;\n \n \t/* verify the PF is supporting the correct APIs */\n \tswitch (adapter->vfinfo[vf].vf_api) {\n \tcase ixgbe_mbox_api_12:\n+\t\t/* promisc introduced in 1.3 version */\n+\t\tif (xcast_mode == IXGBEVF_XCAST_MODE_PROMISC)\n+\t\t\treturn -EOPNOTSUPP;\n+\t\t/* Fall threw */\n+\tcase ixgbe_mbox_api_13:\n \t\tbreak;\n \tdefault:\n \t\treturn -EOPNOTSUPP;\n@@ -1102,17 +1120,34 @@ static int ixgbe_update_vf_xcast_mode(struct ixgbe_adapter *adapter,\n \n \tswitch (xcast_mode) {\n \tcase IXGBEVF_XCAST_MODE_NONE:\n-\t\tdisable = IXGBE_VMOLR_BAM | IXGBE_VMOLR_ROMPE | IXGBE_VMOLR_MPE;\n+\t\tdisable = IXGBE_VMOLR_BAM | IXGBE_VMOLR_ROMPE |\n+\t\t\t  IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE | IXGBE_VMOLR_VPE;\n \t\tenable = 0;\n \t\tbreak;\n \tcase IXGBEVF_XCAST_MODE_MULTI:\n-\t\tdisable = IXGBE_VMOLR_MPE;\n+\t\tdisable = IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE | IXGBE_VMOLR_VPE;\n \t\tenable = IXGBE_VMOLR_BAM | IXGBE_VMOLR_ROMPE;\n \t\tbreak;\n \tcase IXGBEVF_XCAST_MODE_ALLMULTI:\n-\t\tdisable = 0;\n+\t\tdisable = IXGBE_VMOLR_UPE | IXGBE_VMOLR_VPE;\n \t\tenable = IXGBE_VMOLR_BAM | IXGBE_VMOLR_ROMPE | IXGBE_VMOLR_MPE;\n \t\tbreak;\n+\tcase IXGBEVF_XCAST_MODE_PROMISC:\n+\t\tif (hw->mac.type <= ixgbe_mac_82599EB)\n+\t\t\treturn -EOPNOTSUPP;\n+\n+\t\tfctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL);\n+\t\tif (!(fctrl & IXGBE_FCTRL_UPE)) {\n+\t\t\t/* VF promisc requires PF in promisc */\n+\t\t\te_warn(drv,\n+\t\t\t       \"Enabling VF promisc requires PF in promisc\\n\");\n+\t\t\treturn -EPERM;\n+\t\t}\n+\n+\t\tdisable = 0;\n+\t\tenable = IXGBE_VMOLR_BAM | IXGBE_VMOLR_ROMPE |\n+\t\t\t IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE | IXGBE_VMOLR_VPE;\n+\t\tbreak;\n \tdefault:\n \t\treturn -EOPNOTSUPP;\n \t}\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h\nindex 4200f74..c0f6b95 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h\n@@ -1501,6 +1501,8 @@ enum {\n #define IXGBE_VT_CTL_POOL_MASK  (0x3F << IXGBE_VT_CTL_POOL_SHIFT)\n \n /* VMOLR bitmasks */\n+#define IXGBE_VMOLR_UPE\t\t0x00400000 /* unicast promiscuous */\n+#define IXGBE_VMOLR_VPE\t\t0x00800000 /* VLAN promiscuous */\n #define IXGBE_VMOLR_AUPE        0x01000000 /* accept untagged packets */\n #define IXGBE_VMOLR_ROMPE       0x02000000 /* accept packets in MTA tbl */\n #define IXGBE_VMOLR_ROPE        0x04000000 /* accept packets in UC tbl */\n",
    "prefixes": [
        "2/2"
    ]
}