get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 4576,
    "url": "http://patches.dpdk.org/api/patches/4576/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1430406219-23901-26-git-send-email-helin.zhang@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1430406219-23901-26-git-send-email-helin.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1430406219-23901-26-git-send-email-helin.zhang@intel.com",
    "date": "2015-04-30T15:03:31",
    "name": "[dpdk-dev,v2,25/33] i40e/base: find partition_id in npar mode, and disable FCOE by default",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "a627dc7c0002cbfa4e51a8af091d2a3ead509c85",
    "submitter": {
        "id": 14,
        "url": "http://patches.dpdk.org/api/people/14/?format=api",
        "name": "Zhang, Helin",
        "email": "helin.zhang@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1430406219-23901-26-git-send-email-helin.zhang@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/4576/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/4576/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 5103BCCAC;\n\tThu, 30 Apr 2015 17:05:19 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id 5A7C1CCAE\n\tfor <dev@dpdk.org>; Thu, 30 Apr 2015 17:05:16 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga103.fm.intel.com with ESMTP; 30 Apr 2015 08:04:44 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby orsmga002.jf.intel.com with ESMTP; 30 Apr 2015 08:04:44 -0700",
            "from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com\n\t[10.239.29.89])\n\tby shvmail01.sh.intel.com with ESMTP id t3UF4eb9029751;\n\tThu, 30 Apr 2015 23:04:40 +0800",
            "from shecgisg004.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid t3UF4aIp024112; Thu, 30 Apr 2015 23:04:38 +0800",
            "(from hzhan75@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t3UF4aHZ024108; \n\tThu, 30 Apr 2015 23:04:36 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.11,677,1422950400\"; d=\"scan'208\";a=\"721666199\"",
        "From": "Helin Zhang <helin.zhang@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Thu, 30 Apr 2015 23:03:31 +0800",
        "Message-Id": "<1430406219-23901-26-git-send-email-helin.zhang@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1430406219-23901-1-git-send-email-helin.zhang@intel.com>",
        "References": "<1429518150-28098-1-git-send-email-helin.zhang@intel.com>\n\t<1430406219-23901-1-git-send-email-helin.zhang@intel.com>",
        "Cc": "monica.kenguva@intel.com, steven.j.murray@intel.com,\n\tshannon.nelson@intel.com",
        "Subject": "[dpdk-dev] [PATCH v2 25/33] i40e/base: find partition_id in npar\n\tmode, and disable FCOE by default",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "In NPAR mode the driver instance might be controlling the base\npartition or one of the other \"fake\" PFs. There are some things\nthat can only be done by the base partition, aka partition_id 1.\nThis code does a bit of work to find how many partitions are there\nin per port and what is the current partition_id. In addition,\nFCOE is disabled by default, as it was pushed out from the firmware.\n\nSigned-off-by: Helin Zhang <helin.zhang@intel.com>\n---\n lib/librte_pmd_i40e/i40e/i40e_common.c | 34 ++++++++++++++++++++++++++++++++++\n lib/librte_pmd_i40e/i40e/i40e_type.h   |  5 +++++\n 2 files changed, 39 insertions(+)",
    "diff": "diff --git a/lib/librte_pmd_i40e/i40e/i40e_common.c b/lib/librte_pmd_i40e/i40e/i40e_common.c\nindex 03980b9..e728e8e 100644\n--- a/lib/librte_pmd_i40e/i40e/i40e_common.c\n+++ b/lib/librte_pmd_i40e/i40e/i40e_common.c\n@@ -2827,6 +2827,7 @@ STATIC void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,\n \t\t\t\t     enum i40e_admin_queue_opc list_type_opc)\n {\n \tstruct i40e_aqc_list_capabilities_element_resp *cap;\n+\tu32 valid_functions, num_functions;\n \tu32 number, logical_id, phys_id;\n \tstruct i40e_hw_capabilities *p;\n \tu32 i = 0;\n@@ -2956,11 +2957,44 @@ STATIC void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,\n \t\t}\n \t}\n \n+#ifdef I40E_FCOE_ENA\n \t/* Software override ensuring FCoE is disabled if npar or mfp\n \t * mode because it is not supported in these modes.\n \t */\n \tif (p->npar_enable || p->mfp_mode_1)\n \t\tp->fcoe = false;\n+#else\n+\t/* Always disable FCoE if compiled without the I40E_FCOE_ENA flag */\n+\tp->fcoe = false;\n+#endif\n+\n+\t/* count the enabled ports (aka the \"not disabled\" ports) */\n+\thw->num_ports = 0;\n+\tfor (i = 0; i < 4; i++) {\n+\t\tu32 port_cfg_reg = I40E_PRTGEN_CNF + (4 * i);\n+\t\tu64 port_cfg = 0;\n+\n+\t\t/* use AQ read to get the physical register offset instead\n+\t\t * of the port relative offset\n+\t\t */\n+\t\ti40e_aq_debug_read_register(hw, port_cfg_reg, &port_cfg, NULL);\n+\t\tif (!(port_cfg & I40E_PRTGEN_CNF_PORT_DIS_MASK))\n+\t\t\thw->num_ports++;\n+\t}\n+\n+\tvalid_functions = p->valid_functions;\n+\tnum_functions = 0;\n+\twhile (valid_functions) {\n+\t\tif (valid_functions & 1)\n+\t\t\tnum_functions++;\n+\t\tvalid_functions >>= 1;\n+\t}\n+\n+\t/* partition id is 1-based, and functions are evenly spread\n+\t * across the ports as partitions\n+\t */\n+\thw->partition_id = (hw->pf_id / hw->num_ports) + 1;\n+\thw->num_partitions = num_functions / hw->num_ports;\n \n \t/* additional HW specific goodies that might\n \t * someday be HW version specific\ndiff --git a/lib/librte_pmd_i40e/i40e/i40e_type.h b/lib/librte_pmd_i40e/i40e/i40e_type.h\nindex e434e7d..5cca7f8 100644\n--- a/lib/librte_pmd_i40e/i40e/i40e_type.h\n+++ b/lib/librte_pmd_i40e/i40e/i40e_type.h\n@@ -537,6 +537,11 @@ struct i40e_hw {\n \tu8  pf_id;\n \tu16 main_vsi_seid;\n \n+\t/* for multi-function MACs */\n+\tu16 partition_id;\n+\tu16 num_partitions;\n+\tu16 num_ports;\n+\n \t/* Closest numa node to the device */\n \tu16 numa_node;\n \n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "25/33"
    ]
}