get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 465198,
    "url": "http://patchwork.ozlabs.org/api/patches/465198/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1430161042-28494-13-git-send-email-catherine.sullivan@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": "<1430161042-28494-13-git-send-email-catherine.sullivan@intel.com>",
    "list_archive_url": null,
    "date": "2015-04-27T18:57:19",
    "name": "[net-next,S5,12/15] i40e/i40evf: Add support for pre-allocated pages for PD",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "578c9234e8caaf545181cf3037be1381c233dd55",
    "submitter": {
        "id": 13931,
        "url": "http://patchwork.ozlabs.org/api/people/13931/?format=api",
        "name": "Catherine Sullivan",
        "email": "catherine.sullivan@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/1430161042-28494-13-git-send-email-catherine.sullivan@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/465198/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/465198/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 (fraxinus.osuosl.org [140.211.166.137])\n\tby ozlabs.org (Postfix) with ESMTP id C5DAD14012C\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 28 Apr 2015 04:54:59 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 00EBEA12BC;\n\tMon, 27 Apr 2015 18:54:59 +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 xdPyRIZAVRPK; Mon, 27 Apr 2015 18:54:58 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 3C822A129E;\n\tMon, 27 Apr 2015 18:54:58 +0000 (UTC)",
            "from whitealder.osuosl.org (whitealder.osuosl.org\n\t[140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id B096F1C21C0\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 27 Apr 2015 18:54:55 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id AC7F48B8E6\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 27 Apr 2015 18:54:55 +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 AfVneGFp2rdJ for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 27 Apr 2015 18:54:55 +0000 (UTC)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 157B08B8CC\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 27 Apr 2015 18:54:55 +0000 (UTC)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga102.fm.intel.com with ESMTP; 27 Apr 2015 11:54:54 -0700",
            "from catheri1-tigger.jf.intel.com ([134.134.176.92])\n\tby FMSMGA003.fm.intel.com with ESMTP; 27 Apr 2015 11:54:54 -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.11,658,1422950400\"; d=\"scan'208\";a=\"486315539\"",
        "From": "Catherine Sullivan <catherine.sullivan@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Mon, 27 Apr 2015 14:57:19 -0400",
        "Message-Id": "<1430161042-28494-13-git-send-email-catherine.sullivan@intel.com>",
        "X-Mailer": "git-send-email 1.9.3",
        "In-Reply-To": "<1430161042-28494-1-git-send-email-catherine.sullivan@intel.com>",
        "References": "<1430161042-28494-1-git-send-email-catherine.sullivan@intel.com>",
        "Cc": "Faisal Latif <faisal.latif@intel.com>",
        "Subject": "[Intel-wired-lan] [net-next S5 12/15] i40e/i40evf: Add support for\n\tpre-allocated pages for PD",
        "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": "From: Faisal Latif <faisal.latif@intel.com>\n\nThe i40e_add_pd_table_entry() routine is being modified to handle both\ncases where a backing page is passed and where backing page is allocated\nin i40e_add_pd_table_entry().\n\nFor PBLE resource management, it is more efficient for it to manage its\nbacking pages. For VF, PBLE backing page addresses will be send to PF\ndriver for PBLE resource.\n\nThe i40e_remove_pd_bp() is also modified to not free pre-allocated pages and\nfree only ones which were allocated in i40e_add_pd_table_entry().\n\nSigned-off-by: Faisal Latif <faisal.latif@intel.com>\nChange-ID: Ie673f0403f22979e9406f5a94048dceb91bcf9a8\n---\n drivers/net/ethernet/intel/i40e/i40e_hmc.c     | 30 +++++++++++++++++---------\n drivers/net/ethernet/intel/i40e/i40e_hmc.h     |  4 +++-\n drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c |  2 +-\n drivers/net/ethernet/intel/i40evf/i40e_hmc.h   |  4 +++-\n 4 files changed, 27 insertions(+), 13 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_hmc.c b/drivers/net/ethernet/intel/i40e/i40e_hmc.c\nindex 9b987cc..b89856a 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_hmc.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_hmc.c\n@@ -116,6 +116,7 @@ exit:\n  * @hw: pointer to our HW structure\n  * @hmc_info: pointer to the HMC configuration information structure\n  * @pd_index: which page descriptor index to manipulate\n+ * @rsrc_pg: if not NULL, use preallocated page instead of allocating new one.\n  *\n  * This function:\n  *\t1. Initializes the pd entry\n@@ -129,12 +130,14 @@ exit:\n  **/\n i40e_status i40e_add_pd_table_entry(struct i40e_hw *hw,\n \t\t\t\t\t      struct i40e_hmc_info *hmc_info,\n-\t\t\t\t\t      u32 pd_index)\n+\t\t\t\t\t      u32 pd_index,\n+\t\t\t\t\t      struct i40e_dma_mem *rsrc_pg)\n {\n \ti40e_status ret_code = 0;\n \tstruct i40e_hmc_pd_table *pd_table;\n \tstruct i40e_hmc_pd_entry *pd_entry;\n \tstruct i40e_dma_mem mem;\n+\tstruct i40e_dma_mem *page = &mem;\n \tu32 sd_idx, rel_pd_idx;\n \tu64 *pd_addr;\n \tu64 page_desc;\n@@ -155,18 +158,24 @@ i40e_status i40e_add_pd_table_entry(struct i40e_hw *hw,\n \tpd_table = &hmc_info->sd_table.sd_entry[sd_idx].u.pd_table;\n \tpd_entry = &pd_table->pd_entry[rel_pd_idx];\n \tif (!pd_entry->valid) {\n-\t\t/* allocate a 4K backing page */\n-\t\tret_code = i40e_allocate_dma_mem(hw, &mem, i40e_mem_bp,\n-\t\t\t\t\t\t I40E_HMC_PAGED_BP_SIZE,\n-\t\t\t\t\t\t I40E_HMC_PD_BP_BUF_ALIGNMENT);\n-\t\tif (ret_code)\n-\t\t\tgoto exit;\n+\t\tif (rsrc_pg) {\n+\t\t\tpd_entry->rsrc_pg = true;\n+\t\t\tpage = rsrc_pg;\n+\t\t} else {\n+\t\t\t/* allocate a 4K backing page */\n+\t\t\tret_code = i40e_allocate_dma_mem(hw, page, i40e_mem_bp,\n+\t\t\t\t\t\tI40E_HMC_PAGED_BP_SIZE,\n+\t\t\t\t\t\tI40E_HMC_PD_BP_BUF_ALIGNMENT);\n+\t\t\tif (ret_code)\n+\t\t\t\tgoto exit;\n+\t\t\tpd_entry->rsrc_pg = false;\n+\t\t}\n \n-\t\tpd_entry->bp.addr = mem;\n+\t\tpd_entry->bp.addr = *page;\n \t\tpd_entry->bp.sd_pd_index = pd_index;\n \t\tpd_entry->bp.entry_type = I40E_SD_TYPE_PAGED;\n \t\t/* Set page address and valid bit */\n-\t\tpage_desc = mem.pa | 0x1;\n+\t\tpage_desc = page->pa | 0x1;\n \n \t\tpd_addr = (u64 *)pd_table->pd_page_addr.va;\n \t\tpd_addr += rel_pd_idx;\n@@ -240,7 +249,8 @@ i40e_status i40e_remove_pd_bp(struct i40e_hw *hw,\n \tI40E_INVALIDATE_PF_HMC_PD(hw, sd_idx, idx);\n \n \t/* free memory here */\n-\tret_code = i40e_free_dma_mem(hw, &(pd_entry->bp.addr));\n+\tif (!pd_entry->rsrc_pg)\n+\t\tret_code = i40e_free_dma_mem(hw, &pd_entry->bp.addr);\n \tif (ret_code)\n \t\tgoto exit;\n \tif (!pd_table->ref_cnt)\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_hmc.h b/drivers/net/ethernet/intel/i40e/i40e_hmc.h\nindex 732a026..386416b 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_hmc.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e_hmc.h\n@@ -62,6 +62,7 @@ struct i40e_hmc_bp {\n struct i40e_hmc_pd_entry {\n \tstruct i40e_hmc_bp bp;\n \tu32 sd_index;\n+\tbool rsrc_pg;\n \tbool valid;\n };\n \n@@ -218,7 +219,8 @@ i40e_status i40e_add_sd_table_entry(struct i40e_hw *hw,\n \n i40e_status i40e_add_pd_table_entry(struct i40e_hw *hw,\n \t\t\t\t\t      struct i40e_hmc_info *hmc_info,\n-\t\t\t\t\t      u32 pd_index);\n+\t\t\t\t\t      u32 pd_index,\n+\t\t\t\t\t      struct i40e_dma_mem *rsrc_pg);\n i40e_status i40e_remove_pd_bp(struct i40e_hw *hw,\n \t\t\t\t\tstruct i40e_hmc_info *hmc_info,\n \t\t\t\t\tu32 idx);\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c b/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c\nindex 0079ad7..d399eaf 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c\n@@ -387,7 +387,7 @@ static i40e_status i40e_create_lan_hmc_object(struct i40e_hw *hw,\n \t\t\t\t/* update the pd table entry */\n \t\t\t\tret_code = i40e_add_pd_table_entry(hw,\n \t\t\t\t\t\t\t\tinfo->hmc_info,\n-\t\t\t\t\t\t\t\ti);\n+\t\t\t\t\t\t\t\ti, NULL);\n \t\t\t\tif (ret_code) {\n \t\t\t\t\tpd_error = true;\n \t\t\t\t\tbreak;\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40e_hmc.h b/drivers/net/ethernet/intel/i40evf/i40e_hmc.h\nindex 931c880..adc6f71 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40e_hmc.h\n+++ b/drivers/net/ethernet/intel/i40evf/i40e_hmc.h\n@@ -62,6 +62,7 @@ struct i40e_hmc_bp {\n struct i40e_hmc_pd_entry {\n \tstruct i40e_hmc_bp bp;\n \tu32 sd_index;\n+\tbool rsrc_pg;\n \tbool valid;\n };\n \n@@ -218,7 +219,8 @@ i40e_status i40e_add_sd_table_entry(struct i40e_hw *hw,\n \n i40e_status i40e_add_pd_table_entry(struct i40e_hw *hw,\n \t\t\t\t\t      struct i40e_hmc_info *hmc_info,\n-\t\t\t\t\t      u32 pd_index);\n+\t\t\t\t\t      u32 pd_index,\n+\t\t\t\t\t      struct i40e_dma_mem *rsrc_pg);\n i40e_status i40e_remove_pd_bp(struct i40e_hw *hw,\n \t\t\t\t\tstruct i40e_hmc_info *hmc_info,\n \t\t\t\t\tu32 idx);\n",
    "prefixes": [
        "net-next",
        "S5",
        "12/15"
    ]
}