get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 708545,
    "url": "http://patchwork.ozlabs.org/api/patches/708545/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20161223180814.6949.16530.stgit@ukketine.jf.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": "<20161223180814.6949.16530.stgit@ukketine.jf.intel.com>",
    "list_archive_url": null,
    "date": "2016-12-23T18:08:14",
    "name": "ixgbe: Avoid Tx hang by not allowing more than the number of VFs supported.",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "bae3d69d65840aa2800b4c23686b267b06133011",
    "submitter": {
        "id": 67830,
        "url": "http://patchwork.ozlabs.org/api/people/67830/?format=api",
        "name": "Usha Ketineni",
        "email": "usha.k.ketineni@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/20161223180814.6949.16530.stgit@ukketine.jf.intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/708545/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/708545/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 3tln3K2j7bz9s65\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 24 Dec 2016 11:59:40 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 4AF7583ECF;\n\tSat, 24 Dec 2016 00:59:38 +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 BqnX-UUgCILG; Sat, 24 Dec 2016 00:59:36 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 91C2F83E92;\n\tSat, 24 Dec 2016 00:59:36 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id C99571C01A4\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tSat, 24 Dec 2016 00:59:34 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id C1CBF2E0C9\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tSat, 24 Dec 2016 00:59:34 +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 IWaXs13XO2Ce for <intel-wired-lan@lists.osuosl.org>;\n\tSat, 24 Dec 2016 00:59:33 +0000 (UTC)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby silver.osuosl.org (Postfix) with ESMTPS id B17B02DFFA\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tSat, 24 Dec 2016 00:59:33 +0000 (UTC)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby orsmga101.jf.intel.com with ESMTP; 23 Dec 2016 16:59:33 -0800",
            "from ukketine.jf.intel.com ([134.134.173.52])\n\tby fmsmga002.fm.intel.com with ESMTP; 23 Dec 2016 16:59:32 -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,396,1477983600\"; d=\"scan'208\";\n\ta=\"1103634258\"",
        "From": "Usha Ketineni <usha.k.ketineni@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Fri, 23 Dec 2016 10:08:14 -0800",
        "Message-ID": "<20161223180814.6949.16530.stgit@ukketine.jf.intel.com>",
        "User-Agent": "StGit/0.17.1-dirty",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [PATCH] ixgbe: Avoid Tx hang by not allowing more\n\tthan the number of VFs supported.",
        "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": "When DCB is enabled, add checks to ensure creation of number of VF's is\nvalid based on the traffic classes configured by the device.\n\nSigned-off-by: Usha Ketineni <usha.k.ketineni@intel.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c |   26 +++++++++++++++++++++---\n drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h |    3 +++\n 2 files changed, 26 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c\nindex 7e5d985..fa603bd 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c\n@@ -298,6 +298,7 @@ static int ixgbe_pci_sriov_enable(struct pci_dev *dev, int num_vfs)\n #ifdef CONFIG_PCI_IOV\n \tstruct ixgbe_adapter *adapter = pci_get_drvdata(dev);\n \tint err = 0;\n+\tu8 num_tc;\n \tint i;\n \tint pre_existing_vfs = pci_num_vf(dev);\n \n@@ -310,16 +311,35 @@ static int ixgbe_pci_sriov_enable(struct pci_dev *dev, int num_vfs)\n \t\treturn err;\n \n \t/* While the SR-IOV capability structure reports total VFs to be 64,\n-\t * we have to limit the actual number allocated based on two factors.\n+\t * we limit the actual number allocated as below based on two factors.\n+\t *    Num_TCs\tMAX_VFs\n+\t *\t1\t  63\n+\t *\t<=4\t  31\n+\t *\t>4\t  15\n \t * First, we reserve some transmit/receive resources for the PF.\n \t * Second, VMDQ also uses the same pools that SR-IOV does. We need to\n \t * account for this, so that we don't accidentally allocate more VFs\n \t * than we have available pools. The PCI bus driver already checks for\n \t * other values out of range.\n \t */\n-\tif ((num_vfs + adapter->num_rx_pools) > IXGBE_MAX_VF_FUNCTIONS)\n-\t\treturn -EPERM;\n+\tnum_tc = netdev_get_num_tc(adapter->netdev);\n \n+\tif (num_tc > 4) {\n+\t\tif ((num_vfs + adapter->num_rx_pools) > IXGBE_MAX_VFS_8TC) {\n+\t\t\te_dev_err(\"Currently the device is configured with %d TCs, Creating more than %d VFs is not allowed\\n\", num_tc, IXGBE_MAX_VFS_8TC);\n+\t\t\treturn -EPERM;\n+\t\t}\n+\t} else if ((num_tc > 1) && (num_tc <= 4)) {\n+\t\tif ((num_vfs + adapter->num_rx_pools) > IXGBE_MAX_VFS_4TC) {\n+\t\t\te_dev_err(\"Currently the device is configured with %d TCs, Creating more than %d VFs is not allowed\\n\", num_tc, IXGBE_MAX_VFS_4TC);\n+\t\t\treturn -EPERM;\n+\t\t}\n+\t} else {\n+\t\tif ((num_vfs + adapter->num_rx_pools) > IXGBE_MAX_VFS_1TC) {\n+\t\t\te_dev_err(\"Currently the device is configured with %d TCs, Creating more than %d VFs is not allowed\\n\", num_tc, IXGBE_MAX_VFS_1TC);\n+\t\t\treturn -EPERM;\n+\t\t}\n+\t}\n \tadapter->num_vfs = num_vfs;\n \n \terr = __ixgbe_enable_sriov(adapter);\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h\nindex 0c7977d..9bf2b13 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h\n@@ -33,6 +33,9 @@\n  *  63 (IXGBE_MAX_VF_FUNCTIONS - 1)\n  */\n #define IXGBE_MAX_VFS_DRV_LIMIT  (IXGBE_MAX_VF_FUNCTIONS - 1)\n+#define IXGBE_MAX_VFS_1TC\t\t IXGBE_MAX_VF_FUNCTIONS\n+#define IXGBE_MAX_VFS_4TC\t\t 32\n+#define IXGBE_MAX_VFS_8TC\t\t 16\n \n #ifdef CONFIG_PCI_IOV\n void ixgbe_restore_vf_multicasts(struct ixgbe_adapter *adapter);\n",
    "prefixes": []
}