get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 100945,
    "url": "https://patches.dpdk.org/api/patches/100945/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20211010143930.4985-9-ivan.malov@oktetlabs.ru/",
    "project": {
        "id": 1,
        "url": "https://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": "<20211010143930.4985-9-ivan.malov@oktetlabs.ru>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211010143930.4985-9-ivan.malov@oktetlabs.ru",
    "date": "2021-10-10T14:39:26",
    "name": "[v3,08/12] net/bnxt: support meta flow actions to overrule destinations",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "2b6690c524907c675d35be058d8cd628f54e24dd",
    "submitter": {
        "id": 869,
        "url": "https://patches.dpdk.org/api/people/869/?format=api",
        "name": "Ivan Malov",
        "email": "Ivan.Malov@oktetlabs.ru"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20211010143930.4985-9-ivan.malov@oktetlabs.ru/mbox/",
    "series": [
        {
            "id": 19490,
            "url": "https://patches.dpdk.org/api/series/19490/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=19490",
            "date": "2021-10-10T14:39:18",
            "name": "ethdev: rework transfer flow API",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/19490/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/100945/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/100945/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 08A90A0C43;\n\tSun, 10 Oct 2021 16:40:53 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id D44CA4113A;\n\tSun, 10 Oct 2021 16:40:16 +0200 (CEST)",
            "from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113])\n by mails.dpdk.org (Postfix) with ESMTP id 3054340E5A\n for <dev@dpdk.org>; Sun, 10 Oct 2021 16:40:01 +0200 (CEST)",
            "from localhost.localdomain (unknown [5.144.123.197])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by shelob.oktetlabs.ru (Postfix) with ESMTPSA id EC6517F6DA;\n Sun, 10 Oct 2021 17:40:00 +0300 (MSK)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru EC6517F6DA",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru;\n s=default; t=1633876801;\n bh=eo5deMUxw1m00kMsWSIRqs0aa4kK5OOwSV1Zuz1H4Tk=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References;\n b=c0a+8I8LnjFJ9ANUMPKcDPgc+jLvzy6QIYhUJhxlIIuLztPUJDKE1IhV7utqDN5Np\n xLUlCA268IzbOLRVR6UGJFyREcKU1TIadIGjgVNqTypo8u9AkWLzYsSN94zs+Z25cW\n JgmEDKHIpBSUKg50uSmrjCvAhAlBfIYOoybWtGcg=",
        "From": "Ivan Malov <ivan.malov@oktetlabs.ru>",
        "To": "dev@dpdk.org",
        "Cc": "Thomas Monjalon <thomas@monjalon.net>, Ori Kam <orika@nvidia.com>,\n Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,\n Ajit Khaparde <ajit.khaparde@broadcom.com>,\n Somnath Kotur <somnath.kotur@broadcom.com>",
        "Date": "Sun, 10 Oct 2021 17:39:26 +0300",
        "Message-Id": "<20211010143930.4985-9-ivan.malov@oktetlabs.ru>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20211010143930.4985-1-ivan.malov@oktetlabs.ru>",
        "References": "<20211001134716.1608857-1-andrew.rybchenko@oktetlabs.ru>\n <20211010143930.4985-1-ivan.malov@oktetlabs.ru>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v3 08/12] net/bnxt: support meta flow actions to\n overrule destinations",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <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 <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>\n\nAdd support for actions PORT_REPRESENTOR and REPRESENTED_PORT\nbased on the existing support for action PORT_ID.\n\nSigned-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>\n---\n drivers/net/bnxt/tf_ulp/ulp_rte_handler_tbl.c | 12 ++-\n drivers/net/bnxt/tf_ulp/ulp_rte_parser.c      | 84 ++++++++++++++-----\n drivers/net/bnxt/tf_ulp/ulp_rte_parser.h      |  6 +-\n 3 files changed, 77 insertions(+), 25 deletions(-)",
    "diff": "diff --git a/drivers/net/bnxt/tf_ulp/ulp_rte_handler_tbl.c b/drivers/net/bnxt/tf_ulp/ulp_rte_handler_tbl.c\nindex d28dd2e587..e9337ecd2c 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_rte_handler_tbl.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_rte_handler_tbl.c\n@@ -67,7 +67,7 @@ struct bnxt_ulp_rte_act_info ulp_act_info[] = {\n \t},\n \t[RTE_FLOW_ACTION_TYPE_PORT_ID] = {\n \t.act_type                = BNXT_ULP_ACT_TYPE_SUPPORTED,\n-\t.proto_act_func          = ulp_rte_port_id_act_handler\n+\t.proto_act_func          = ulp_rte_port_act_handler\n \t},\n \t[RTE_FLOW_ACTION_TYPE_METER] = {\n \t.act_type                = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,\n@@ -212,7 +212,15 @@ struct bnxt_ulp_rte_act_info ulp_act_info[] = {\n \t[RTE_FLOW_ACTION_TYPE_SAMPLE] = {\n \t.act_type                = BNXT_ULP_ACT_TYPE_SUPPORTED,\n \t.proto_act_func          = ulp_rte_sample_act_handler\n-\t}\n+\t},\n+\t[RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR] = {\n+\t.act_type                = BNXT_ULP_ACT_TYPE_SUPPORTED,\n+\t.proto_act_func          = ulp_rte_port_act_handler\n+\t},\n+\t[RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT] = {\n+\t.act_type                = BNXT_ULP_ACT_TYPE_SUPPORTED,\n+\t.proto_act_func          = ulp_rte_port_act_handler\n+\t},\n };\n \n struct bnxt_ulp_rte_act_info ulp_vendor_act_info[] = {\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c\nindex e1ea8932b0..f0e218d8ec 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c\n@@ -496,10 +496,11 @@ ulp_rte_parser_implicit_act_port_process(struct ulp_rte_parser_params *params)\n \t\treturn BNXT_TF_RC_SUCCESS;\n \t}\n \tport_id.id = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_INCOMING_IF);\n+\taction_item.type = RTE_FLOW_ACTION_TYPE_PORT_ID;\n \taction_item.conf = &port_id;\n \n \t/* Update the action port based on incoming port */\n-\tulp_rte_port_id_act_handler(&action_item, params);\n+\tulp_rte_port_act_handler(&action_item, params);\n \n \t/* Reset the action port set bit */\n \tULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_ACT_PORT_IS_SET, 0);\n@@ -2168,7 +2169,8 @@ ulp_rte_count_act_handler(const struct rte_flow_action *action_item,\n /* Function to handle the parsing of action ports. */\n static int32_t\n ulp_rte_parser_act_port_set(struct ulp_rte_parser_params *param,\n-\t\t\t    uint32_t ifindex)\n+\t\t\t    uint32_t ifindex,\n+\t\t\t    enum bnxt_ulp_direction_type act_dir)\n {\n \tenum bnxt_ulp_direction_type dir;\n \tuint16_t pid_s;\n@@ -2178,8 +2180,13 @@ ulp_rte_parser_act_port_set(struct ulp_rte_parser_params *param,\n \tuint32_t vnic_type;\n \n \t/* Get the direction */\n-\tdir = ULP_COMP_FLD_IDX_RD(param, BNXT_ULP_CF_IDX_DIRECTION);\n-\tif (dir == BNXT_ULP_DIR_EGRESS) {\n+\t/* If action implicitly specifies direction, use the specification. */\n+\tdir = (act_dir == BNXT_ULP_DIR_INVALID) ?\n+\t\tULP_COMP_FLD_IDX_RD(param, BNXT_ULP_CF_IDX_DIRECTION) :\n+\t\tact_dir;\n+\tport_type = ULP_COMP_FLD_IDX_RD(param, BNXT_ULP_CF_IDX_ACT_PORT_TYPE);\n+\tif (dir == BNXT_ULP_DIR_EGRESS &&\n+\t    port_type != BNXT_ULP_INTF_TYPE_VF_REP) {\n \t\t/* For egress direction, fill vport */\n \t\tif (ulp_port_db_vport_get(param->ulp_ctx, ifindex, &pid_s))\n \t\t\treturn BNXT_TF_RC_ERROR;\n@@ -2190,9 +2197,17 @@ ulp_rte_parser_act_port_set(struct ulp_rte_parser_params *param,\n \t\t       &pid, BNXT_ULP_ACT_PROP_SZ_VPORT);\n \t} else {\n \t\t/* For ingress direction, fill vnic */\n-\t\tport_type = ULP_COMP_FLD_IDX_RD(param,\n-\t\t\t\t\t\tBNXT_ULP_CF_IDX_ACT_PORT_TYPE);\n-\t\tif (port_type == BNXT_ULP_INTF_TYPE_VF_REP)\n+\t\t/*\n+\t\t * Action\t\tDestination\n+\t\t * ------------------------------------\n+\t\t * PORT_REPRESENTOR\tDriver Function\n+\t\t * ------------------------------------\n+\t\t * REPRESENTED_PORT\tVF\n+\t\t * ------------------------------------\n+\t\t * PORT_ID\t\tVF\n+\t\t */\n+\t\tif (act_dir != BNXT_ULP_DIR_INGRESS &&\n+\t\t    port_type == BNXT_ULP_INTF_TYPE_VF_REP)\n \t\t\tvnic_type = BNXT_ULP_VF_FUNC_VNIC;\n \t\telse\n \t\t\tvnic_type = BNXT_ULP_DRV_FUNC_VNIC;\n@@ -2239,7 +2254,8 @@ ulp_rte_pf_act_handler(const struct rte_flow_action *action_item __rte_unused,\n \t}\n \t/* Update the action properties */\n \tULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_ACT_PORT_TYPE, intf_type);\n-\treturn ulp_rte_parser_act_port_set(params, ifindex);\n+\treturn ulp_rte_parser_act_port_set(params, ifindex,\n+\t\t\t\t\t   BNXT_ULP_DIR_INVALID);\n }\n \n /* Function to handle the parsing of RTE Flow action VF. */\n@@ -2290,31 +2306,59 @@ ulp_rte_vf_act_handler(const struct rte_flow_action *action_item,\n \n \t/* Update the action properties */\n \tULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_ACT_PORT_TYPE, intf_type);\n-\treturn ulp_rte_parser_act_port_set(params, ifindex);\n+\treturn ulp_rte_parser_act_port_set(params, ifindex,\n+\t\t\t\t\t   BNXT_ULP_DIR_INVALID);\n }\n \n-/* Function to handle the parsing of RTE Flow action port_id. */\n+/* Parse actions PORT_ID, PORT_REPRESENTOR and REPRESENTED_PORT. */\n int32_t\n-ulp_rte_port_id_act_handler(const struct rte_flow_action *act_item,\n-\t\t\t    struct ulp_rte_parser_params *param)\n+ulp_rte_port_act_handler(const struct rte_flow_action *act_item,\n+\t\t\t struct ulp_rte_parser_params *param)\n {\n-\tconst struct rte_flow_action_port_id *port_id = act_item->conf;\n+\tuint32_t ethdev_id;\n \tuint32_t ifindex;\n \tenum bnxt_ulp_intf_type intf_type;\n+\tenum bnxt_ulp_direction_type act_dir;\n \n-\tif (!port_id) {\n+\tif (!act_item->conf) {\n \t\tBNXT_TF_DBG(ERR,\n \t\t\t    \"ParseErr: Invalid Argument\\n\");\n \t\treturn BNXT_TF_RC_PARSE_ERR;\n \t}\n-\tif (port_id->original) {\n-\t\tBNXT_TF_DBG(ERR,\n-\t\t\t    \"ParseErr:Portid Original not supported\\n\");\n-\t\treturn BNXT_TF_RC_PARSE_ERR;\n+\tswitch (act_item->type) {\n+\tcase RTE_FLOW_ACTION_TYPE_PORT_ID: {\n+\t\tconst struct rte_flow_action_port_id *port_id = act_item->conf;\n+\n+\t\tif (port_id->original) {\n+\t\t\tBNXT_TF_DBG(ERR,\n+\t\t\t\t    \"ParseErr:Portid Original not supported\\n\");\n+\t\t\treturn BNXT_TF_RC_PARSE_ERR;\n+\t\t}\n+\t\tethdev_id = port_id->id;\n+\t\tact_dir = BNXT_ULP_DIR_INVALID;\n+\t\tbreak;\n+\t}\n+\tcase RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR: {\n+\t\tconst struct rte_flow_action_ethdev *ethdev = act_item->conf;\n+\n+\t\tethdev_id = ethdev->port_id;\n+\t\tact_dir = BNXT_ULP_DIR_INGRESS;\n+\t\tbreak;\n+\t}\n+\tcase RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT: {\n+\t\tconst struct rte_flow_action_ethdev *ethdev = act_item->conf;\n+\n+\t\tethdev_id = ethdev->port_id;\n+\t\tact_dir = BNXT_ULP_DIR_EGRESS;\n+\t\tbreak;\n+\t}\n+\tdefault:\n+\t\tBNXT_TF_DBG(ERR, \"Unknown port action\\n\");\n+\t\treturn BNXT_TF_RC_ERROR;\n \t}\n \n \t/* Get the port db ifindex */\n-\tif (ulp_port_db_dev_port_to_ulp_index(param->ulp_ctx, port_id->id,\n+\tif (ulp_port_db_dev_port_to_ulp_index(param->ulp_ctx, ethdev_id,\n \t\t\t\t\t      &ifindex)) {\n \t\tBNXT_TF_DBG(ERR, \"Invalid port id\\n\");\n \t\treturn BNXT_TF_RC_ERROR;\n@@ -2329,7 +2373,7 @@ ulp_rte_port_id_act_handler(const struct rte_flow_action *act_item,\n \n \t/* Set the action port */\n \tULP_COMP_FLD_IDX_WR(param, BNXT_ULP_CF_IDX_ACT_PORT_TYPE, intf_type);\n-\treturn ulp_rte_parser_act_port_set(param, ifindex);\n+\treturn ulp_rte_parser_act_port_set(param, ifindex, act_dir);\n }\n \n /* Function to handle the parsing of RTE Flow action phy_port. */\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.h b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.h\nindex 0acb93946b..e4225d00f8 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.h\n+++ b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.h\n@@ -204,10 +204,10 @@ int32_t\n ulp_rte_vf_act_handler(const struct rte_flow_action *action_item,\n \t\t       struct ulp_rte_parser_params *params);\n \n-/* Function to handle the parsing of RTE Flow action port_id. */\n+/* Parse actions PORT_ID, PORT_REPRESENTOR and REPRESENTED_PORT. */\n int32_t\n-ulp_rte_port_id_act_handler(const struct rte_flow_action *act_item,\n-\t\t\t    struct ulp_rte_parser_params *params);\n+ulp_rte_port_act_handler(const struct rte_flow_action *act_item,\n+\t\t\t struct ulp_rte_parser_params *params);\n \n /* Function to handle the parsing of RTE Flow action phy_port. */\n int32_t\n",
    "prefixes": [
        "v3",
        "08/12"
    ]
}