get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1041534,
    "url": "http://patchwork.ozlabs.org/api/patches/1041534/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190213185115.25877-11-anirudh.venkataramanan@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": "<20190213185115.25877-11-anirudh.venkataramanan@intel.com>",
    "list_archive_url": null,
    "date": "2019-02-13T18:51:10",
    "name": "[S14,10/15] ice: add and use new ice_for_each_traffic_class() macro",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "0ad7201c7676bfa35bf6e0755f9e85902d837bac",
    "submitter": {
        "id": 73601,
        "url": "http://patchwork.ozlabs.org/api/people/73601/?format=api",
        "name": "Anirudh Venkataramanan",
        "email": "anirudh.venkataramanan@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/20190213185115.25877-11-anirudh.venkataramanan@intel.com/mbox/",
    "series": [
        {
            "id": 91786,
            "url": "http://patchwork.ozlabs.org/api/series/91786/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=91786",
            "date": "2019-02-13T18:51:02",
            "name": "Implementation updates for ice",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/91786/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1041534/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1041534/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@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"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.137; helo=fraxinus.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com"
        ],
        "Received": [
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 4407wY2mKVz9sMx\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Feb 2019 05:54:05 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id B263384EA7;\n\tWed, 13 Feb 2019 18:54:03 +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 D3ylUfE5rY-R; Wed, 13 Feb 2019 18:54:01 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 608008523B;\n\tWed, 13 Feb 2019 18:54:01 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 4BE2D1BF999\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Feb 2019 18:51:33 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 7A646227FA\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Feb 2019 18:51:21 +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 kpbUAYRudpUU for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Feb 2019 18:51:18 +0000 (UTC)",
            "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n\tby silver.osuosl.org (Postfix) with ESMTPS id BF98B22170\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 13 Feb 2019 18:51:17 +0000 (UTC)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t13 Feb 2019 10:51:17 -0800",
            "from shasta.jf.intel.com ([10.166.241.11])\n\tby orsmga001.jf.intel.com with ESMTP; 13 Feb 2019 10:51:16 -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-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.58,366,1544515200\"; d=\"scan'208\";a=\"138354242\"",
        "From": "Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Wed, 13 Feb 2019 10:51:10 -0800",
        "Message-Id": "<20190213185115.25877-11-anirudh.venkataramanan@intel.com>",
        "X-Mailer": "git-send-email 2.14.5",
        "In-Reply-To": "<20190213185115.25877-1-anirudh.venkataramanan@intel.com>",
        "References": "<20190213185115.25877-1-anirudh.venkataramanan@intel.com>",
        "Subject": "[Intel-wired-lan] [PATCH S14 10/15] ice: add and use new\n\tice_for_each_traffic_class() macro",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@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@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "From: Bruce Allan <bruce.w.allan@intel.com>\n\nThere are numerous for() loops iterating over each of the max traffic\nclasses.  Use a simple iterator macro instead to make the code cleaner.\n\nSigned-off-by: Bruce Allan <bruce.w.allan@intel.com>\nSigned-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice_common.c | 2 +-\n drivers/net/ethernet/intel/ice/ice_lib.c    | 4 ++--\n drivers/net/ethernet/intel/ice/ice_sched.c  | 2 +-\n drivers/net/ethernet/intel/ice/ice_type.h   | 3 +++\n 4 files changed, 7 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c\nindex be67d07b75cb..ca9a8c52a8d6 100644\n--- a/drivers/net/ethernet/intel/ice/ice_common.c\n+++ b/drivers/net/ethernet/intel/ice/ice_common.c\n@@ -2949,7 +2949,7 @@ ice_cfg_vsi_qs(struct ice_port_info *pi, u16 vsi_handle, u8 tc_bitmap,\n \n \tmutex_lock(&pi->sched_lock);\n \n-\tfor (i = 0; i < ICE_MAX_TRAFFIC_CLASS; i++) {\n+\tice_for_each_traffic_class(i) {\n \t\t/* configuration is possible only if TC node is present */\n \t\tif (!ice_sched_get_tc_node(pi, i))\n \t\t\tcontinue;\ndiff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c\nindex 914e59272a91..f0c87c40fd9d 100644\n--- a/drivers/net/ethernet/intel/ice/ice_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_lib.c\n@@ -868,7 +868,7 @@ static void ice_vsi_setup_q_map(struct ice_vsi *vsi, struct ice_vsi_ctx *ctxt)\n \t/* find the (rounded up) power-of-2 of qcount */\n \tpow = order_base_2(qcount_rx);\n \n-\tfor (i = 0; i < ICE_MAX_TRAFFIC_CLASS; i++) {\n+\tice_for_each_traffic_class(i) {\n \t\tif (!(vsi->tc_cfg.ena_tc & BIT(i))) {\n \t\t\t/* TC is not enabled */\n \t\t\tvsi->tc_cfg.tc_info[i].qoffset = 0;\n@@ -1715,7 +1715,7 @@ ice_vsi_cfg_txqs(struct ice_vsi *vsi, struct ice_ring **rings, int offset)\n \tnum_q_grps = 1;\n \n \t/* set up and configure the Tx queues for each enabled TC */\n-\tfor (tc = 0; tc < ICE_MAX_TRAFFIC_CLASS; tc++) {\n+\tice_for_each_traffic_class(tc) {\n \t\tif (!(vsi->tc_cfg.ena_tc & BIT(tc)))\n \t\t\tbreak;\n \ndiff --git a/drivers/net/ethernet/intel/ice/ice_sched.c b/drivers/net/ethernet/intel/ice/ice_sched.c\nindex efbebf7a050f..e0218f4c8f0b 100644\n--- a/drivers/net/ethernet/intel/ice/ice_sched.c\n+++ b/drivers/net/ethernet/intel/ice/ice_sched.c\n@@ -1606,7 +1606,7 @@ ice_sched_rm_vsi_cfg(struct ice_port_info *pi, u16 vsi_handle, u8 owner)\n \tif (!vsi_ctx)\n \t\tgoto exit_sched_rm_vsi_cfg;\n \n-\tfor (i = 0; i < ICE_MAX_TRAFFIC_CLASS; i++) {\n+\tice_for_each_traffic_class(i) {\n \t\tstruct ice_sched_node *vsi_node, *tc_node;\n \t\tu8 j = 0;\n \ndiff --git a/drivers/net/ethernet/intel/ice/ice_type.h b/drivers/net/ethernet/intel/ice/ice_type.h\nindex 584f260f2e4f..3a4e67484487 100644\n--- a/drivers/net/ethernet/intel/ice/ice_type.h\n+++ b/drivers/net/ethernet/intel/ice/ice_type.h\n@@ -210,6 +210,9 @@ struct ice_nvm_info {\n #define ICE_MAX_TRAFFIC_CLASS 8\n #define ICE_TXSCHED_MAX_BRANCHES ICE_MAX_TRAFFIC_CLASS\n \n+#define ice_for_each_traffic_class(_i)\t\\\n+\tfor ((_i) = 0; (_i) < ICE_MAX_TRAFFIC_CLASS; (_i)++)\n+\n struct ice_sched_node {\n \tstruct ice_sched_node *parent;\n \tstruct ice_sched_node *sibling; /* next sibling in the same layer */\n",
    "prefixes": [
        "S14",
        "10/15"
    ]
}