get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 819411,
    "url": "http://patchwork.ozlabs.org/api/patches/819411/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20170928044132.30940-4-saeedm@mellanox.com/",
    "project": {
        "id": 7,
        "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api",
        "name": "Linux network development",
        "link_name": "netdev",
        "list_id": "netdev.vger.kernel.org",
        "list_email": "netdev@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170928044132.30940-4-saeedm@mellanox.com>",
    "list_archive_url": null,
    "date": "2017-09-28T04:41:24",
    "name": "[net,03/11] net/mlx5: Check device capability for maximum flow counters",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "09b359e31a66d7473430eeed9075b6110baa6fd5",
    "submitter": {
        "id": 65299,
        "url": "http://patchwork.ozlabs.org/api/people/65299/?format=api",
        "name": "Saeed Mahameed",
        "email": "saeedm@mellanox.com"
    },
    "delegate": {
        "id": 34,
        "url": "http://patchwork.ozlabs.org/api/users/34/?format=api",
        "username": "davem",
        "first_name": "David",
        "last_name": "Miller",
        "email": "davem@davemloft.net"
    },
    "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20170928044132.30940-4-saeedm@mellanox.com/mbox/",
    "series": [
        {
            "id": 5488,
            "url": "http://patchwork.ozlabs.org/api/series/5488/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=5488",
            "date": "2017-09-28T04:41:23",
            "name": "Mellanox, mlx5 fixes 2017-09-28",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/5488/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/819411/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/819411/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<netdev-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming@ozlabs.org",
        "Delivered-To": "patchwork-incoming@ozlabs.org",
        "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y2hrZ431dz9t3x\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 28 Sep 2017 14:42:54 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752067AbdI1Emx (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tThu, 28 Sep 2017 00:42:53 -0400",
            "from mail-il-dmz.mellanox.com ([193.47.165.129]:54364 \"EHLO\n\tmellanox.co.il\" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org\n\twith ESMTP id S1751042AbdI1EmF (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Thu, 28 Sep 2017 00:42:05 -0400",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n\tsaeedm@mellanox.com)\n\twith ESMTPS (AES256-SHA encrypted); 28 Sep 2017 06:42:01 +0200",
            "from sws.mtl.labs.mlnx (reg-l-vrt-045-015.mtl.labs.mlnx\n\t[10.135.45.15])\n\tby labmailer.mlnx (8.13.8/8.13.8) with ESMTP id v8S4g1j7011096;\n\tThu, 28 Sep 2017 07:42:01 +0300"
        ],
        "From": "Saeed Mahameed <saeedm@mellanox.com>",
        "To": "\"David S. Miller\" <davem@davemloft.net>",
        "Cc": "netdev@vger.kernel.org, Raed Salem <raeds@mellanox.com>,\n\tSaeed Mahameed <saeedm@mellanox.com>",
        "Subject": "[net 03/11] net/mlx5: Check device capability for maximum flow\n\tcounters",
        "Date": "Thu, 28 Sep 2017 07:41:24 +0300",
        "Message-Id": "<20170928044132.30940-4-saeedm@mellanox.com>",
        "X-Mailer": "git-send-email 2.13.0",
        "In-Reply-To": "<20170928044132.30940-1-saeedm@mellanox.com>",
        "References": "<20170928044132.30940-1-saeedm@mellanox.com>",
        "Sender": "netdev-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "From: Raed Salem <raeds@mellanox.com>\n\nAdded check for the maximal number of flow counters attached\nto rule (FTE).\n\nFixes: bd5251dbf156b ('net/mlx5_core: Introduce flow steering destination of type counter')\nSigned-off-by: Raed Salem <raeds@mellanox.com>\nReviewed-by: Maor Gottlieb <maorg@mellanox.com>\nSigned-off-by: Saeed Mahameed <saeedm@mellanox.com>\n---\n drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c  |  8 ++++++++\n drivers/net/ethernet/mellanox/mlx5/core/fs_core.h | 11 +++++++++++\n include/linux/mlx5/mlx5_ifc.h                     |  3 ++-\n 3 files changed, 21 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c\nindex e0d0efd903bc..36ecc2b2e187 100644\n--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c\n+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c\n@@ -293,6 +293,9 @@ static int mlx5_cmd_set_fte(struct mlx5_core_dev *dev,\n \t}\n \n \tif (fte->action & MLX5_FLOW_CONTEXT_ACTION_COUNT) {\n+\t\tint max_list_size = BIT(MLX5_CAP_FLOWTABLE_TYPE(dev,\n+\t\t\t\t\tlog_max_flow_counter,\n+\t\t\t\t\tft->type));\n \t\tint list_size = 0;\n \n \t\tlist_for_each_entry(dst, &fte->node.children, node.list) {\n@@ -305,12 +308,17 @@ static int mlx5_cmd_set_fte(struct mlx5_core_dev *dev,\n \t\t\tin_dests += MLX5_ST_SZ_BYTES(dest_format_struct);\n \t\t\tlist_size++;\n \t\t}\n+\t\tif (list_size > max_list_size) {\n+\t\t\terr = -EINVAL;\n+\t\t\tgoto err_out;\n+\t\t}\n \n \t\tMLX5_SET(flow_context, in_flow_context, flow_counter_list_size,\n \t\t\t list_size);\n \t}\n \n \terr = mlx5_cmd_exec(dev, in, inlen, out, sizeof(out));\n+err_out:\n \tkvfree(in);\n \treturn err;\n }\ndiff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h\nindex 5509a752f98e..48dd78975062 100644\n--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h\n+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h\n@@ -52,6 +52,7 @@ enum fs_flow_table_type {\n \tFS_FT_FDB             = 0X4,\n \tFS_FT_SNIFFER_RX\t= 0X5,\n \tFS_FT_SNIFFER_TX\t= 0X6,\n+\tFS_FT_MAX_TYPE = FS_FT_SNIFFER_TX,\n };\n \n enum fs_flow_table_op_mod {\n@@ -260,4 +261,14 @@ void mlx5_cleanup_fs(struct mlx5_core_dev *dev);\n #define fs_for_each_dst(pos, fte)\t\t\t\\\n \tfs_list_for_each_entry(pos, &(fte)->node.children)\n \n+#define MLX5_CAP_FLOWTABLE_TYPE(mdev, cap, type) (\t\t\\\n+\t(type == FS_FT_NIC_RX) ? MLX5_CAP_FLOWTABLE_NIC_RX(mdev, cap) :\t\t\\\n+\t(type == FS_FT_ESW_EGRESS_ACL) ? MLX5_CAP_ESW_EGRESS_ACL(mdev, cap) :\t\t\\\n+\t(type == FS_FT_ESW_INGRESS_ACL) ? MLX5_CAP_ESW_INGRESS_ACL(mdev, cap) :\t\t\\\n+\t(type == FS_FT_FDB) ? MLX5_CAP_ESW_FLOWTABLE_FDB(mdev, cap) :\t\t\\\n+\t(type == FS_FT_SNIFFER_RX) ? MLX5_CAP_FLOWTABLE_SNIFFER_RX(mdev, cap) :\t\t\\\n+\t(type == FS_FT_SNIFFER_TX) ? MLX5_CAP_FLOWTABLE_SNIFFER_TX(mdev, cap) :\t\t\\\n+\t(BUILD_BUG_ON_ZERO(FS_FT_SNIFFER_TX != FS_FT_MAX_TYPE))\\\n+\t)\n+\n #endif\ndiff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h\nindex a528b35a022e..69772347f866 100644\n--- a/include/linux/mlx5/mlx5_ifc.h\n+++ b/include/linux/mlx5/mlx5_ifc.h\n@@ -327,7 +327,8 @@ struct mlx5_ifc_flow_table_prop_layout_bits {\n \tu8         reserved_at_80[0x18];\n \tu8         log_max_destination[0x8];\n \n-\tu8         reserved_at_a0[0x18];\n+\tu8         log_max_flow_counter[0x8];\n+\tu8         reserved_at_a8[0x10];\n \tu8         log_max_flow[0x8];\n \n \tu8         reserved_at_c0[0x40];\n",
    "prefixes": [
        "net",
        "03/11"
    ]
}