get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 47544,
    "url": "http://patches.dpdk.org/api/patches/47544/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20181028173440.27808-1-yskoh@mellanox.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": "<20181028173440.27808-1-yskoh@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20181028173440.27808-1-yskoh@mellanox.com",
    "date": "2018-10-28T17:34:50",
    "name": "net/mlx5: fix Direct Verbs getting item and action flags",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "846bac75618ad5cf38401c9b522b5250f10a437e",
    "submitter": {
        "id": 636,
        "url": "http://patches.dpdk.org/api/people/636/?format=api",
        "name": "Yongseok Koh",
        "email": "yskoh@mellanox.com"
    },
    "delegate": {
        "id": 6624,
        "url": "http://patches.dpdk.org/api/users/6624/?format=api",
        "username": "shahafs",
        "first_name": "Shahaf",
        "last_name": "Shuler",
        "email": "shahafs@mellanox.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20181028173440.27808-1-yskoh@mellanox.com/mbox/",
    "series": [
        {
            "id": 2145,
            "url": "http://patches.dpdk.org/api/series/2145/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=2145",
            "date": "2018-10-28T17:34:50",
            "name": "net/mlx5: fix Direct Verbs getting item and action flags",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/2145/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/47544/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/47544/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 0BF1756A3;\n\tSun, 28 Oct 2018 18:34:54 +0100 (CET)",
            "from EUR03-DB5-obe.outbound.protection.outlook.com\n\t(mail-eopbgr40085.outbound.protection.outlook.com [40.107.4.85])\n\tby dpdk.org (Postfix) with ESMTP id 89A875424\n\tfor <dev@dpdk.org>; Sun, 28 Oct 2018 18:34:52 +0100 (CET)",
            "from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by\n\tDB3PR0502MB4057.eurprd05.prod.outlook.com (52.134.67.18) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n\t15.20.1273.21; Sun, 28 Oct 2018 17:34:50 +0000",
            "from DB3PR0502MB3980.eurprd05.prod.outlook.com\n\t([fe80::f8a1:fcab:94f0:97cc]) by\n\tDB3PR0502MB3980.eurprd05.prod.outlook.com\n\t([fe80::f8a1:fcab:94f0:97cc%4]) with mapi id 15.20.1273.027;\n\tSun, 28 Oct 2018 17:34:50 +0000"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com;\n\ts=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n\tbh=QUDmURSvF6Sq6xV3WPi1DnpDkdxMpFCjjENl+2K30hM=;\n\tb=nazfEFoXJlc/i3QNLCM4OmEH1sbMA1Raozw9878MUwgg4itig/jMJq3bEJHqGphu8kmTLIT1p460ZI4LBNiG25ZMvXoR2Tb3JQ3M7kGDSWYnyDxp/9JT0Xl1TNnSJVp9g18KX8uUonAZ2GzCWUSFd9tmKS8+t6RulhoBAwyR0hM=",
        "From": "Yongseok Koh <yskoh@mellanox.com>",
        "To": "Shahaf Shuler <shahafs@mellanox.com>",
        "CC": "\"dev@dpdk.org\" <dev@dpdk.org>, Yongseok Koh <yskoh@mellanox.com>, Ori Kam\n\t<orika@mellanox.com>",
        "Thread-Topic": "[PATCH] net/mlx5: fix Direct Verbs getting item and action\n\tflags",
        "Thread-Index": "AQHUbuSH+I7dIxYbCkyDfM3wP2/ckw==",
        "Date": "Sun, 28 Oct 2018 17:34:50 +0000",
        "Message-ID": "<20181028173440.27808-1-yskoh@mellanox.com>",
        "Accept-Language": "en-US",
        "Content-Language": "en-US",
        "X-MS-Has-Attach": "",
        "X-MS-TNEF-Correlator": "",
        "x-clientproxiedby": "BYAPR08CA0017.namprd08.prod.outlook.com\n\t(2603:10b6:a03:100::30) To DB3PR0502MB3980.eurprd05.prod.outlook.com\n\t(2603:10a6:8:10::27)",
        "authentication-results": "spf=none (sender IP is )\n\tsmtp.mailfrom=yskoh@mellanox.com; ",
        "x-ms-exchange-messagesentrepresentingtype": "1",
        "x-originating-ip": "[209.116.155.178]",
        "x-ms-publictraffictype": "Email",
        "x-microsoft-exchange-diagnostics": "1; DB3PR0502MB4057;\n\t6:eI7K20N71DGWjlC2s/qogG8IdxTcbYhMp7PFj9lasxPBCWaKudX/qqPNfQUZ53PvfPQlyNV5eQ07K5EeYdNa7gqCBmi77Te2KwvA/4/J/t+Px99nQn+8Eo0OH1jSJKZk5BO6xZBBnoMyXaSc8hHvEiIXaEyS/U47A3sQMDXGhiExpEJpQVuShrTGiPW+5lz4qyOHifGPtttqwSAVPpjtpCaDh3Eb0LebHtG15hFvR4FSxGVDOlhVbiQAJebYmmaizdftfYeH7LIh+4yrAuKwmXy2pxgiBW4fdmU8y4iQw/Gm6Kxz3FTMZXo2pwq+2LQdc0cFwQsYHc2OLgcPphXkRS0j2R6J8uMjHifyliUcum3A8QSUshxqv2bSP6c3XFFhPg2S8YG3rsFFpp1nU1mwiR2BLZUr4DK+/X5vbQabIkQJSvIQFmm+llN1gnlgmCxzDVw0Te9TX28XhVX5Fw49dA==;\n\t5:q6X/2nEGn2IA+Rs2wmU2aG1iHvkDheuWW61J7/f10q3U9cjubyZhckkt7TmL0t4Y61Ty4y/5JQ++UBmg+hvAShxkkuH1AsLLBI6aLFxTvDU0MmBXbI2CZ4SdbEiNSgTxMFuOFk8MpQG8V5Ew6g0h3cWMsBn1HwQjZG2nN9nYbQU=;\n\t7:ZAjYflTX/Pdqr0lUJkI8tYywdNhIKsxs1YbOWW2jZ3cPfN3DecASs1rdXKK+iZw5fo5QRmeiuRuCvNOrMiCKaUM872hTf0jQTGO4rM1FDLL9cFAGnp11xJFpzBcSsoD5OdcsBVa0gvrhiV+ROGqNwQ==",
        "x-ms-office365-filtering-correlation-id": "199f024a-7fe0-4ffb-2ff8-08d63cfba9b7",
        "x-ms-office365-filtering-ht": "Tenant",
        "x-microsoft-antispam": "BCL:0; PCL:0;\n\tRULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);\n\tSRVR:DB3PR0502MB4057; ",
        "x-ms-traffictypediagnostic": "DB3PR0502MB4057:",
        "x-microsoft-antispam-prvs": "<DB3PR0502MB40574B54A823BEDCD3DE451BC3F20@DB3PR0502MB4057.eurprd05.prod.outlook.com>",
        "x-exchange-antispam-report-test": "UriScan:;",
        "x-ms-exchange-senderadcheck": "1",
        "x-exchange-antispam-report-cfa-test": "BCL:0; PCL:0;\n\tRULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231382)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991095);\n\tSRVR:DB3PR0502MB4057; BCL:0; PCL:0; RULEID:; SRVR:DB3PR0502MB4057; ",
        "x-forefront-prvs": "0839D067E7",
        "x-forefront-antispam-report": "SFV:NSPM;\n\tSFS:(10009020)(136003)(366004)(39850400004)(376002)(396003)(346002)(51234002)(199004)(189003)(2906002)(1076002)(97736004)(6486002)(6512007)(2900100001)(5250100002)(6436002)(6636002)(86362001)(256004)(36756003)(575784001)(14444005)(5660300001)(68736007)(14454004)(486006)(8676002)(478600001)(2616005)(71190400001)(476003)(71200400001)(66066001)(305945005)(81156014)(8936002)(7736002)(81166006)(6506007)(102836004)(316002)(26005)(1857600001)(37006003)(186003)(386003)(4326008)(6862004)(107886003)(53936002)(25786009)(54906003)(106356001)(105586002)(99286004)(3846002)(6116002)(52116002);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB4057;\n\tH:DB3PR0502MB3980.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; \n\tPTR:InfoNoRecords; A:1; MX:1; ",
        "received-spf": "None (protection.outlook.com: mellanox.com does not designate\n\tpermitted sender hosts)",
        "x-microsoft-antispam-message-info": "W1w+WT05blgeNoHYC/1t/q1CS2ehmSPQF6TbFj7u+SYT1OgPvjy3+5Ajkh40aclwzh5VQRc18KQlvTp4OtZrK6ySO7PM2SRUc4wCnU7nUnExazbBXNoTw7SthDnrGqMnpUU5HuwqhgraRRJ6I29VMVLXCAbHeDFTbQi9kfv7BZKG9kWU1PTx0rXx/uEeD0VnxmZXFaOJj5NY21aYoIvgHukHzDp2mn50N5dRGofZ+cxm4WgiSGjmNOsh7SCdVXpgExdttWhrSWWa8xH4XR+5JU8SiueCkWTo3wzGZAM0w4CCI2paZJGY2rB4AJNoPUZUG9vmUrJhed4/0FJ0zgDaq02wCp+vyLCOKPYRWCfPhXU=",
        "spamdiagnosticoutput": "1:99",
        "spamdiagnosticmetadata": "NSPM",
        "Content-Type": "text/plain; charset=\"iso-8859-1\"",
        "Content-Transfer-Encoding": "quoted-printable",
        "MIME-Version": "1.0",
        "X-OriginatorOrg": "Mellanox.com",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "199f024a-7fe0-4ffb-2ff8-08d63cfba9b7",
        "X-MS-Exchange-CrossTenant-originalarrivaltime": "28 Oct 2018 17:34:50.5139\n\t(UTC)",
        "X-MS-Exchange-CrossTenant-fromentityheader": "Hosted",
        "X-MS-Exchange-CrossTenant-id": "a652971c-7d2e-4d9b-a6a4-d149256f461b",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "DB3PR0502MB4057",
        "Subject": "[dpdk-dev] [PATCH] net/mlx5: fix Direct Verbs getting item and\n\taction flags",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Flow driver has to provide detected item flags and action flags via\nflow_drv_prepare(). DV doesn't return flags at all.\n\nFixes: 865a0c15672c (\"net/mlx5: add Direct Verbs prepare function\")\nCc: orika@mellanox.com\n\nSigned-off-by: Yongseok Koh <yskoh@mellanox.com>\n---\n drivers/net/mlx5/mlx5_flow_dv.c | 115 ++++++++++++++++++++++++++++++++++++----\n 1 file changed, 106 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex 8f729f44f8..67c133c2fb 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -354,6 +354,103 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,\n }\n \n /**\n+ * Extract item flags and action flags.\n+ *\n+ * @param[in] items\n+ *   Pointer to the list of items.\n+ * @param[in] actions\n+ *   Pointer to the list of actions.\n+ * @param[out] item_flags\n+ *   Pointer to bit mask of all items detected.\n+ * @param[out] action_flags\n+ *   Pointer to bit mask of all actions detected.\n+ */\n+static void\n+flow_dv_get_item_action_flags(const struct rte_flow_item items[],\n+\t\t\t      const struct rte_flow_action actions[],\n+\t\t\t      uint64_t *item_flags, uint64_t *action_flags)\n+{\n+\tuint64_t detected_items = 0;\n+\tuint64_t detected_actions = 0;\n+\tint tunnel;\n+\n+\tfor (; items->type != RTE_FLOW_ITEM_TYPE_END; items++) {\n+\t\ttunnel = !!(detected_items & MLX5_FLOW_LAYER_TUNNEL);\n+\t\tswitch (items->type) {\n+\t\tcase RTE_FLOW_ITEM_TYPE_ETH:\n+\t\t\tdetected_items |= tunnel ? MLX5_FLOW_LAYER_INNER_L2 :\n+\t\t\t\t\t\t   MLX5_FLOW_LAYER_OUTER_L2;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_VLAN:\n+\t\t\tdetected_items |= tunnel ? MLX5_FLOW_LAYER_INNER_VLAN :\n+\t\t\t\t\t\t   MLX5_FLOW_LAYER_OUTER_VLAN;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_IPV4:\n+\t\t\tdetected_items |= tunnel ?\n+\t\t\t\t\t  MLX5_FLOW_LAYER_INNER_L3_IPV4 :\n+\t\t\t\t\t  MLX5_FLOW_LAYER_OUTER_L3_IPV4;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_IPV6:\n+\t\t\tdetected_items |= tunnel ?\n+\t\t\t\t\t  MLX5_FLOW_LAYER_INNER_L3_IPV6 :\n+\t\t\t\t\t  MLX5_FLOW_LAYER_OUTER_L3_IPV6;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_TCP:\n+\t\t\tdetected_items |= tunnel ?\n+\t\t\t\t\t  MLX5_FLOW_LAYER_INNER_L4_TCP :\n+\t\t\t\t\t  MLX5_FLOW_LAYER_OUTER_L4_TCP;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_UDP:\n+\t\t\tdetected_items |= tunnel ?\n+\t\t\t\t\t  MLX5_FLOW_LAYER_INNER_L4_UDP :\n+\t\t\t\t\t  MLX5_FLOW_LAYER_OUTER_L4_UDP;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_GRE:\n+\t\tcase RTE_FLOW_ITEM_TYPE_NVGRE:\n+\t\t\tdetected_items |= MLX5_FLOW_LAYER_GRE;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_VXLAN:\n+\t\t\tdetected_items |= MLX5_FLOW_LAYER_VXLAN;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_VXLAN_GPE:\n+\t\t\tdetected_items |= MLX5_FLOW_LAYER_VXLAN_GPE;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_META:\n+\t\t\tdetected_items |= MLX5_FLOW_ITEM_METADATA;\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\tfor (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {\n+\t\tswitch (actions->type) {\n+\t\tcase RTE_FLOW_ACTION_TYPE_FLAG:\n+\t\t\tdetected_actions |= MLX5_FLOW_ACTION_FLAG;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_MARK:\n+\t\t\tdetected_actions |= MLX5_FLOW_ACTION_MARK;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_DROP:\n+\t\t\tdetected_actions |= MLX5_FLOW_ACTION_DROP;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_QUEUE:\n+\t\t\tdetected_actions |= MLX5_FLOW_ACTION_QUEUE;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_RSS:\n+\t\t\tdetected_actions |= MLX5_FLOW_ACTION_RSS;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ACTION_TYPE_COUNT:\n+\t\t\tdetected_actions |= MLX5_FLOW_ACTION_COUNT;\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\t*item_flags = detected_items;\n+\t*action_flags = detected_actions;\n+}\n+\n+/**\n  * Internal preparation function. Allocates the DV flow size,\n  * this size is constant.\n  *\n@@ -376,15 +473,15 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,\n  */\n static struct mlx5_flow *\n flow_dv_prepare(const struct rte_flow_attr *attr __rte_unused,\n-\t\tconst struct rte_flow_item items[] __rte_unused,\n-\t\tconst struct rte_flow_action actions[] __rte_unused,\n-\t\tuint64_t *item_flags __rte_unused,\n-\t\tuint64_t *action_flags __rte_unused,\n+\t\tconst struct rte_flow_item items[],\n+\t\tconst struct rte_flow_action actions[],\n+\t\tuint64_t *item_flags, uint64_t *action_flags,\n \t\tstruct rte_flow_error *error)\n {\n \tuint32_t size = sizeof(struct mlx5_flow);\n \tstruct mlx5_flow *flow;\n \n+\tflow_dv_get_item_action_flags(items, actions, item_flags, action_flags);\n \tflow = rte_calloc(__func__, 1, size, 0);\n \tif (!flow) {\n \t\trte_flow_error_set(error, ENOMEM,\n@@ -1067,7 +1164,7 @@ flow_dv_create_action(const struct rte_flow_action *action,\n \t\tdev_flow->dv.actions[actions_n].tag_value =\n \t\t\tmlx5_flow_mark_set(MLX5_FLOW_MARK_DEFAULT);\n \t\tactions_n++;\n-\t\tflow->actions |= MLX5_FLOW_ACTION_FLAG;\n+\t\tassert(flow->actions & MLX5_FLOW_ACTION_FLAG);\n \t\tbreak;\n \tcase RTE_FLOW_ACTION_TYPE_MARK:\n \t\tdev_flow->dv.actions[actions_n].type = MLX5DV_FLOW_ACTION_TAG;\n@@ -1075,18 +1172,18 @@ flow_dv_create_action(const struct rte_flow_action *action,\n \t\t\tmlx5_flow_mark_set\n \t\t\t(((const struct rte_flow_action_mark *)\n \t\t\t  (action->conf))->id);\n-\t\tflow->actions |= MLX5_FLOW_ACTION_MARK;\n+\t\tassert(flow->actions & MLX5_FLOW_ACTION_MARK);\n \t\tactions_n++;\n \t\tbreak;\n \tcase RTE_FLOW_ACTION_TYPE_DROP:\n \t\tdev_flow->dv.actions[actions_n].type = MLX5DV_FLOW_ACTION_DROP;\n-\t\tflow->actions |= MLX5_FLOW_ACTION_DROP;\n+\t\tassert(flow->actions & MLX5_FLOW_ACTION_DROP);\n \t\tbreak;\n \tcase RTE_FLOW_ACTION_TYPE_QUEUE:\n \t\tqueue = action->conf;\n \t\tflow->rss.queue_num = 1;\n \t\t(*flow->queue)[0] = queue->index;\n-\t\tflow->actions |= MLX5_FLOW_ACTION_QUEUE;\n+\t\tassert(flow->actions & MLX5_FLOW_ACTION_QUEUE);\n \t\tbreak;\n \tcase RTE_FLOW_ACTION_TYPE_RSS:\n \t\trss = action->conf;\n@@ -1098,7 +1195,7 @@ flow_dv_create_action(const struct rte_flow_action *action,\n \t\tflow->rss.types = rss->types;\n \t\tflow->rss.level = rss->level;\n \t\t/* Added to array only in apply since we need the QP */\n-\t\tflow->actions |= MLX5_FLOW_ACTION_RSS;\n+\t\tassert(flow->actions & MLX5_FLOW_ACTION_RSS);\n \t\tbreak;\n \tdefault:\n \t\tbreak;\n",
    "prefixes": []
}