get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 484608,
    "url": "http://patchwork.ozlabs.org/api/patches/484608/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1434405656-10465-5-git-send-email-jacob.e.keller@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": "<1434405656-10465-5-git-send-email-jacob.e.keller@intel.com>",
    "list_archive_url": null,
    "date": "2015-06-15T22:00:55",
    "name": "[5/6] fm10k: update fm10k_slot_warn to use pcie_get_minimum link",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "47a6e7602e3d71c29102e14ec007d068bfc5c518",
    "submitter": {
        "id": 9784,
        "url": "http://patchwork.ozlabs.org/api/people/9784/?format=api",
        "name": "Jacob Keller",
        "email": "jacob.e.keller@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/1434405656-10465-5-git-send-email-jacob.e.keller@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/484608/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/484608/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\tby ozlabs.org (Postfix) with ESMTP id 2ABF41402AB\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 16 Jun 2015 08:01:10 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 6C266A3A87;\n\tMon, 15 Jun 2015 22:01:09 +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 ABRjRqnxsCJn; Mon, 15 Jun 2015 22:01:08 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 028DFA3B2A;\n\tMon, 15 Jun 2015 22:01:08 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 92B221C0E70\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 15 Jun 2015 22:01:06 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 8E542A3A4C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 15 Jun 2015 22:01:06 +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-x7W2LwRYc1 for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 15 Jun 2015 22:01:05 +0000 (UTC)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 5D468A3A6D\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 15 Jun 2015 22:01:05 +0000 (UTC)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga103.fm.intel.com with ESMTP; 15 Jun 2015 15:01:05 -0700",
            "from jekeller-desk.amr.corp.intel.com ([134.134.3.85])\n\tby FMSMGA003.fm.intel.com with ESMTP; 15 Jun 2015 15:01:05 -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.13,621,1427785200\"; d=\"scan'208\";a=\"508766660\"",
        "From": "Jacob Keller <jacob.e.keller@intel.com>",
        "To": "Intel Wired LAN <intel-wired-lan@lists.osuosl.org>",
        "Date": "Mon, 15 Jun 2015 15:00:55 -0700",
        "Message-Id": "<1434405656-10465-5-git-send-email-jacob.e.keller@intel.com>",
        "X-Mailer": "git-send-email 2.4.2",
        "In-Reply-To": "<1434405656-10465-1-git-send-email-jacob.e.keller@intel.com>",
        "References": "<1434405656-10465-1-git-send-email-jacob.e.keller@intel.com>",
        "Subject": "[Intel-wired-lan] [PATCH 5/6] fm10k: update fm10k_slot_warn to use\n\tpcie_get_minimum link",
        "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 is useful in cases where we connect to a slot at Gen3, but the slot\nis behind a bus which only connected at Gen2. This generally only\nhappens when a PCIe switch is in the sequence of devices, and can be\nvery confusing when you see slow performance with no obvious cause.\n\nI am aware this patch has a few lines that break 80 characters, but\nthere does not seem to be a readable way to format them to less than 80\ncharacters. Suggestions welcome.\n\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\n---\n drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 105 +++++++++++++++++++--------\n 1 file changed, 76 insertions(+), 29 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c\nindex 37cd78f3ce24..d8ab6cdca456 100644\n--- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c\n+++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c\n@@ -1703,22 +1703,86 @@ static int fm10k_sw_init(struct fm10k_intfc *interface,\n \n static void fm10k_slot_warn(struct fm10k_intfc *interface)\n {\n-\tstruct device *dev = &interface->pdev->dev;\n+\tenum pcie_link_width width = PCIE_LNK_WIDTH_UNKNOWN;\n+\tenum pci_bus_speed speed = PCI_SPEED_UNKNOWN;\n \tstruct fm10k_hw *hw = &interface->hw;\n+\tint max_gts = 0, expected_gts = 0;\n \n-\tif (hw->mac.ops.is_slot_appropriate(hw))\n+\tif (pcie_get_minimum_link(interface->pdev, &speed, &width) ||\n+\t    speed == PCI_SPEED_UNKNOWN || width == PCIE_LNK_WIDTH_UNKNOWN) {\n+\t\tdev_warn(&interface->pdev->dev,\n+\t\t\t \"Unable to determine PCI Express bandwidth.\\n\");\n \t\treturn;\n+\t}\n \n-\tdev_warn(dev,\n-\t\t \"For optimal performance, a %s %s slot is recommended.\\n\",\n-\t\t (hw->bus_caps.width == fm10k_bus_width_pcie_x1 ? \"x1\" :\n-\t\t  hw->bus_caps.width == fm10k_bus_width_pcie_x4 ? \"x4\" :\n-\t\t  \"x8\"),\n-\t\t (hw->bus_caps.speed == fm10k_bus_speed_2500 ? \"2.5GT/s\" :\n-\t\t  hw->bus_caps.speed == fm10k_bus_speed_5000 ? \"5.0GT/s\" :\n-\t\t  \"8.0GT/s\"));\n-\tdev_warn(dev,\n-\t\t \"A slot with more lanes and/or higher speed is suggested.\\n\");\n+\tswitch (speed) {\n+\tcase PCIE_SPEED_2_5GT:\n+\t\t/* 8b/10b encoding reduces max throughput by 20% */\n+\t\tmax_gts = 2 * width;\n+\t\tbreak;\n+\tcase PCIE_SPEED_5_0GT:\n+\t\t/* 8b/10b encoding reduces max throughput by 20% */\n+\t\tmax_gts = 4 * width;\n+\t\tbreak;\n+\tcase PCIE_SPEED_8_0GT:\n+\t\t/* 128b/130b encoding has less than 2% impact on throughput */\n+\t\tmax_gts = 8 * width;\n+\t\tbreak;\n+\tdefault:\n+\t\tdev_warn(&interface->pdev->dev,\n+\t\t\t \"Unable to determine PCI Express bandwidth.\\n\");\n+\t\treturn;\n+\t}\n+\n+\tdev_info(&interface->pdev->dev,\n+\t\t \"PCI Express bandwidth of %dGT/s available\\n\",\n+\t\t max_gts);\n+\tdev_info(&interface->pdev->dev,\n+\t\t \"(Speed:%s, Width: x%d, Encoding Loss:%s, Payload:%s)\\n\",\n+\t\t (speed == PCIE_SPEED_8_0GT ? \"8.0GT/s\" :\n+\t\t  speed == PCIE_SPEED_5_0GT ? \"5.0GT/s\" :\n+\t\t  speed == PCIE_SPEED_2_5GT ? \"2.5GT/s\" :\n+\t\t  \"Unknown\"),\n+\t\t hw->bus.width,\n+\t\t (speed == PCIE_SPEED_2_5GT ? \"20%\" :\n+\t\t  speed == PCIE_SPEED_5_0GT ? \"20%\" :\n+\t\t  speed == PCIE_SPEED_8_0GT ? \"<2%\" :\n+\t\t  \"Unknown\"),\n+\t\t (hw->bus.payload == fm10k_bus_payload_128 ? \"128B\" :\n+\t\t  hw->bus.payload == fm10k_bus_payload_256 ? \"256B\" :\n+\t\t  hw->bus.payload == fm10k_bus_payload_512 ? \"512B\" :\n+\t\t  \"Unknown\"));\n+\n+\tswitch (hw->bus_caps.speed) {\n+\tcase fm10k_bus_speed_2500:\n+\t\t/* 8b/10b encoding reduces max throughput by 20% */\n+\t\texpected_gts = 2 * hw->bus_caps.width;\n+\t\tbreak;\n+\tcase fm10k_bus_speed_5000:\n+\t\t/* 8b/10b encoding reduces max throughput by 20% */\n+\t\texpected_gts = 4 * hw->bus_caps.width;\n+\t\tbreak;\n+\tcase fm10k_bus_speed_8000:\n+\t\t/* 128b/130b encoding has less than 2% impact on throughput */\n+\t\texpected_gts = 8 * hw->bus_caps.width;\n+\t\tbreak;\n+\tdefault:\n+\t\tdev_warn(&interface->pdev->dev,\n+\t\t\t \"Unable to determine expected PCI Express bandwidth.\\n\");\n+\t\treturn;\n+\t}\n+\n+\tif (max_gts < expected_gts) {\n+\t\tdev_warn(&interface->pdev->dev,\n+\t\t\t \"This device requires %dGT/s of bandwidth for optimal performance.\\n\",\n+\t\t\t expected_gts);\n+\t\tdev_warn(&interface->pdev->dev,\n+\t\t\t \"A %sslot with x%d lanes is suggested.\\n\",\n+\t\t\t (hw->bus_caps.speed == fm10k_bus_speed_2500 ? \"2.5GT/s \" :\n+\t\t\t  hw->bus_caps.speed == fm10k_bus_speed_5000 ? \"5.0GT/s \" :\n+\t\t\t  hw->bus_caps.speed == fm10k_bus_speed_8000 ? \"8.0GT/s \" : \"\"),\n+\t\t\t hw->bus_caps.width);\n+\t}\n }\n \n /**\n@@ -1737,7 +1801,6 @@ static int fm10k_probe(struct pci_dev *pdev,\n {\n \tstruct net_device *netdev;\n \tstruct fm10k_intfc *interface;\n-\tstruct fm10k_hw *hw;\n \tint err;\n \n \terr = pci_enable_device_mem(pdev);\n@@ -1781,7 +1844,6 @@ static int fm10k_probe(struct pci_dev *pdev,\n \n \tinterface->netdev = netdev;\n \tinterface->pdev = pdev;\n-\thw = &interface->hw;\n \n \tinterface->uc_addr = ioremap(pci_resource_start(pdev, 0),\n \t\t\t\t     FM10K_UC_ADDR_SIZE);\n@@ -1823,21 +1885,6 @@ static int fm10k_probe(struct pci_dev *pdev,\n \t/* Register PTP interface */\n \tfm10k_ptp_register(interface);\n \n-\t/* print bus type/speed/width info */\n-\tdev_info(&pdev->dev, \"(PCI Express:%s Width: %s Payload: %s)\\n\",\n-\t\t (hw->bus.speed == fm10k_bus_speed_8000 ? \"8.0GT/s\" :\n-\t\t  hw->bus.speed == fm10k_bus_speed_5000 ? \"5.0GT/s\" :\n-\t\t  hw->bus.speed == fm10k_bus_speed_2500 ? \"2.5GT/s\" :\n-\t\t  \"Unknown\"),\n-\t\t (hw->bus.width == fm10k_bus_width_pcie_x8 ? \"x8\" :\n-\t\t  hw->bus.width == fm10k_bus_width_pcie_x4 ? \"x4\" :\n-\t\t  hw->bus.width == fm10k_bus_width_pcie_x1 ? \"x1\" :\n-\t\t  \"Unknown\"),\n-\t\t (hw->bus.payload == fm10k_bus_payload_128 ? \"128B\" :\n-\t\t  hw->bus.payload == fm10k_bus_payload_256 ? \"256B\" :\n-\t\t  hw->bus.payload == fm10k_bus_payload_512 ? \"512B\" :\n-\t\t  \"Unknown\"));\n-\n \t/* print warning for non-optimal configurations */\n \tfm10k_slot_warn(interface);\n \n",
    "prefixes": [
        "5/6"
    ]
}