get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 717934,
    "url": "http://patchwork.ozlabs.org/api/patches/717934/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170120221145.7616.93906.stgit@localhost6.localdomain6/",
    "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": "<20170120221145.7616.93906.stgit@localhost6.localdomain6>",
    "list_archive_url": null,
    "date": "2017-01-20T22:11:45",
    "name": "[1/3] ixgbe: move num_vfs_macvlans allocation into separate function",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "b7cc54d111be514ac90aa8555b3647f8a1cf7a5e",
    "submitter": {
        "id": 1670,
        "url": "http://patchwork.ozlabs.org/api/people/1670/?format=api",
        "name": "Tantilov, Emil S",
        "email": "emil.s.tantilov@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/20170120221145.7616.93906.stgit@localhost6.localdomain6/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/717934/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/717934/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 3v4w9s3Rhkz9t1P\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 21 Jan 2017 09:19:45 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 099AC86A51;\n\tFri, 20 Jan 2017 22:19:44 +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 s0nf7nwdmb0N; Fri, 20 Jan 2017 22:19:42 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 63FFD86A50;\n\tFri, 20 Jan 2017 22:19:42 +0000 (UTC)",
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 56E561BFEC6\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 20 Jan 2017 22:19:41 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 505F185BEC\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 20 Jan 2017 22:19:41 +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 B8AkTOSKWtde for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 20 Jan 2017 22:19:40 +0000 (UTC)",
            "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 2EE9685B7C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 20 Jan 2017 22:19:40 +0000 (UTC)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby orsmga104.jf.intel.com with ESMTP; 20 Jan 2017 14:19:39 -0800",
            "from estantil-desk3.jf.intel.com (HELO localhost6.localdomain6)\n\t([134.134.3.64])\n\tby FMSMGA003.fm.intel.com with ESMTP; 20 Jan 2017 14:19:39 -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,260,1477983600\"; d=\"scan'208\";a=\"811431393\"",
        "From": "Emil Tantilov <emil.s.tantilov@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Fri, 20 Jan 2017 14:11:45 -0800",
        "Message-ID": "<20170120221145.7616.93906.stgit@localhost6.localdomain6>",
        "User-Agent": "StGit/0.17.1-17-ge4e0",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [PATCH 1/3] ixgbe: move num_vfs_macvlans\n\tallocation into separate function",
        "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": "Move the code allocating memory for list of MAC addresses that\nthe VFs can use for MACVLAN into its own function.\n\nSigned-off-by: Emil Tantilov <emil.s.tantilov@intel.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c |   48 +++++++++++++++---------\n 1 file changed, 29 insertions(+), 19 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c\nindex 39e109d..d10b25f 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c\n@@ -46,42 +46,50 @@\n #include \"ixgbe_sriov.h\"\n \n #ifdef CONFIG_PCI_IOV\n-static int __ixgbe_enable_sriov(struct ixgbe_adapter *adapter)\n+static inline void ixgbe_alloc_vf_macvlans(struct ixgbe_adapter *adapter)\n {\n \tstruct ixgbe_hw *hw = &adapter->hw;\n-\tint num_vf_macvlans, i;\n \tstruct vf_macvlans *mv_list;\n-\n-\tadapter->flags |= IXGBE_FLAG_SRIOV_ENABLED;\n-\te_info(probe, \"SR-IOV enabled with %d VFs\\n\", adapter->num_vfs);\n-\n-\t/* Enable VMDq flag so device will be set in VM mode */\n-\tadapter->flags |= IXGBE_FLAG_VMDQ_ENABLED;\n-\tif (!adapter->ring_feature[RING_F_VMDQ].limit)\n-\t\tadapter->ring_feature[RING_F_VMDQ].limit = 1;\n-\tadapter->ring_feature[RING_F_VMDQ].offset = adapter->num_vfs;\n+\tint num_vf_macvlans, i;\n \n \tnum_vf_macvlans = hw->mac.num_rar_entries -\n-\t(IXGBE_MAX_PF_MACVLANS + 1 + adapter->num_vfs);\n+\t\t\t  (IXGBE_MAX_PF_MACVLANS + 1 + adapter->num_vfs);\n+\tif (!num_vf_macvlans)\n+\t\treturn;\n \n-\tadapter->mv_list = mv_list = kcalloc(num_vf_macvlans,\n-\t\t\t\t\t     sizeof(struct vf_macvlans),\n-\t\t\t\t\t     GFP_KERNEL);\n+\tmv_list = kcalloc(num_vf_macvlans, sizeof(struct vf_macvlans),\n+\t\t\t  GFP_KERNEL);\n \tif (mv_list) {\n \t\t/* Initialize list of VF macvlans */\n \t\tINIT_LIST_HEAD(&adapter->vf_mvs.l);\n \t\tfor (i = 0; i < num_vf_macvlans; i++) {\n-\t\t\tmv_list->vf = -1;\n-\t\t\tmv_list->free = true;\n-\t\t\tlist_add(&mv_list->l, &adapter->vf_mvs.l);\n-\t\t\tmv_list++;\n+\t\t\tmv_list[i].vf = -1;\n+\t\t\tmv_list[i].free = true;\n+\t\t\tlist_add(&mv_list[i].l, &adapter->vf_mvs.l);\n \t\t}\n+\t\tadapter->mv_list = mv_list;\n \t}\n+}\n+\n+static int __ixgbe_enable_sriov(struct ixgbe_adapter *adapter)\n+{\n+\tstruct ixgbe_hw *hw = &adapter->hw;\n+\n+\tadapter->flags |= IXGBE_FLAG_SRIOV_ENABLED;\n+\te_info(probe, \"SR-IOV enabled with %d VFs\\n\", adapter->num_vfs);\n+\n+\t/* Enable VMDq flag so device will be set in VM mode */\n+\tadapter->flags |= IXGBE_FLAG_VMDQ_ENABLED;\n+\tif (!adapter->ring_feature[RING_F_VMDQ].limit)\n+\t\tadapter->ring_feature[RING_F_VMDQ].limit = 1;\n+\tadapter->ring_feature[RING_F_VMDQ].offset = adapter->num_vfs;\n \n \t/* Initialize default switching mode VEB */\n \tIXGBE_WRITE_REG(hw, IXGBE_PFDTXGSWC, IXGBE_PFDTXGSWC_VT_LBEN);\n \tadapter->bridge_mode = BRIDGE_MODE_VEB;\n \n+\tixgbe_alloc_vf_macvlans(adapter);\n+\n \t/* If call to enable VFs succeeded then allocate memory\n \t * for per VF control structures.\n \t */\n@@ -89,6 +97,8 @@ static int __ixgbe_enable_sriov(struct ixgbe_adapter *adapter)\n \t\tkcalloc(adapter->num_vfs,\n \t\t\tsizeof(struct vf_data_storage), GFP_KERNEL);\n \tif (adapter->vfinfo) {\n+\t\tint i;\n+\n \t\t/* limit trafffic classes based on VFs enabled */\n \t\tif ((adapter->hw.mac.type == ixgbe_mac_82599EB) &&\n \t\t    (adapter->num_vfs < 16)) {\n",
    "prefixes": [
        "1/3"
    ]
}