get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 100930,
    "url": "http://patches.dpdk.org/api/patches/100930/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20211010000503.28712-8-ivan.malov@oktetlabs.ru/",
    "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": "<20211010000503.28712-8-ivan.malov@oktetlabs.ru>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211010000503.28712-8-ivan.malov@oktetlabs.ru",
    "date": "2021-10-10T00:04:58",
    "name": "[v2,07/12] net/bnxt: support meta flow items to match on traffic source",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "a8e279e71c1eb18714c85a152e9c7c605de3be7c",
    "submitter": {
        "id": 869,
        "url": "http://patches.dpdk.org/api/people/869/?format=api",
        "name": "Ivan Malov",
        "email": "Ivan.Malov@oktetlabs.ru"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20211010000503.28712-8-ivan.malov@oktetlabs.ru/mbox/",
    "series": [
        {
            "id": 19488,
            "url": "http://patches.dpdk.org/api/series/19488/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=19488",
            "date": "2021-10-10T00:04:51",
            "name": "ethdev: rework transfer flow API",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/19488/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/100930/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/100930/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 C88FBA0C41;\n\tSun, 10 Oct 2021 02:06:04 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 51A5C4111F;\n\tSun, 10 Oct 2021 02:05:31 +0200 (CEST)",
            "from shelob.oktetlabs.ru (unknown [91.220.146.113])\n by mails.dpdk.org (Postfix) with ESMTP id 3770E410E1\n for <dev@dpdk.org>; Sun, 10 Oct 2021 02:05:23 +0200 (CEST)",
            "from localhost.localdomain (unknown [5.144.122.166])\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 2EBE87F6D8;\n Sun, 10 Oct 2021 03:05:13 +0300 (MSK)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 2EBE87F6D8",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru;\n s=default; t=1633824313;\n bh=utttDEaZeq32TztOhvSBBeOaoECWKaDVhnOFJ3CtlPY=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References;\n b=KOOlcOl0Sd3/wuOBEIT1PxqHoaupH9mpWqNiX++0s7dSNoVemCB+jl74pEOLiWDCY\n YvAC8lCJkvwMuFeuLHzboAbH/QCNNfARQnUL8nYN2+KtM6dRle6sJoJWzDzKOEcbkL\n DuJ9BHKOCEMPurwyIFCljOEaAw7vV3ahO8DSizC8=",
        "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 03:04:58 +0300",
        "Message-Id": "<20211010000503.28712-8-ivan.malov@oktetlabs.ru>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20211010000503.28712-1-ivan.malov@oktetlabs.ru>",
        "References": "<20211001134716.1608857-1-andrew.rybchenko@oktetlabs.ru>\n <20211010000503.28712-1-ivan.malov@oktetlabs.ru>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v2 07/12] net/bnxt: support meta flow items to\n match on traffic source",
        "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 items PORT_REPRESENTOR and REPRESENTED_PORT\nbased on the existing support for item PORT_ID.\n\nThe use of item PORT_ID depends on the specified direction attribute.\nItems PORT_REPRESENTOR and REPRESENTED_PORT, in turn, define traffic\ndirection themselves. The former matches traffic from the driver's\nvNIC. The latter matches packets from either a v-port (network) or\na VF's vNIC (if the driver's port is a VF representor).\n\nSigned-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>\n---\n drivers/net/bnxt/tf_ulp/ulp_rte_handler_tbl.c | 10 ++-\n drivers/net/bnxt/tf_ulp/ulp_rte_parser.c      | 77 ++++++++++++++-----\n drivers/net/bnxt/tf_ulp/ulp_rte_parser.h      |  6 +-\n 3 files changed, 70 insertions(+), 23 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 9b165c12b5..d28dd2e587 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@@ -266,7 +266,7 @@ struct bnxt_ulp_rte_hdr_info ulp_hdr_info[] = {\n \t},\n \t[RTE_FLOW_ITEM_TYPE_PORT_ID] = {\n \t.hdr_type                = BNXT_ULP_HDR_TYPE_SUPPORTED,\n-\t.proto_hdr_func          = ulp_rte_port_id_hdr_handler\n+\t.proto_hdr_func          = ulp_rte_port_hdr_handler\n \t},\n \t[RTE_FLOW_ITEM_TYPE_RAW] = {\n \t.hdr_type                = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,\n@@ -427,6 +427,14 @@ struct bnxt_ulp_rte_hdr_info ulp_hdr_info[] = {\n \t[RTE_FLOW_ITEM_TYPE_HIGIG2] = {\n \t.hdr_type                = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,\n \t.proto_hdr_func          = NULL\n+\t},\n+\t[RTE_FLOW_ITEM_TYPE_PORT_REPRESENTOR] = {\n+\t.hdr_type                = BNXT_ULP_HDR_TYPE_SUPPORTED,\n+\t.proto_hdr_func          = ulp_rte_port_hdr_handler\n+\t},\n+\t[RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT] = {\n+\t.hdr_type                = BNXT_ULP_HDR_TYPE_SUPPORTED,\n+\t.proto_hdr_func          = ulp_rte_port_hdr_handler\n \t}\n };\n \ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c\nindex 3a9c9bba27..e1ea8932b0 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c\n+++ b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c\n@@ -400,7 +400,8 @@ bnxt_ulp_rte_parser_direction_compute(struct ulp_rte_parser_params *params)\n static int32_t\n ulp_rte_parser_svif_set(struct ulp_rte_parser_params *params,\n \t\t\tuint32_t ifindex,\n-\t\t\tuint16_t mask)\n+\t\t\tuint16_t mask,\n+\t\t\tenum bnxt_ulp_direction_type item_dir)\n {\n \tuint16_t svif;\n \tenum bnxt_ulp_direction_type dir;\n@@ -429,11 +430,14 @@ ulp_rte_parser_svif_set(struct ulp_rte_parser_params *params,\n \tbnxt_ulp_rte_parser_direction_compute(params);\n \n \t/* Get the computed direction */\n-\tdir = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_DIRECTION);\n-\tif (dir == BNXT_ULP_DIR_INGRESS) {\n+\tdir = (item_dir != BNXT_ULP_DIR_INVALID) ? item_dir :\n+\t\tULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_DIRECTION);\n+\tif (dir == BNXT_ULP_DIR_INGRESS &&\n+\t    port_type != BNXT_ULP_INTF_TYPE_VF_REP) {\n \t\tsvif_type = BNXT_ULP_PHY_PORT_SVIF;\n \t} else {\n-\t\tif (port_type == BNXT_ULP_INTF_TYPE_VF_REP)\n+\t\tif (port_type == BNXT_ULP_INTF_TYPE_VF_REP &&\n+\t\t    item_dir != BNXT_ULP_DIR_EGRESS)\n \t\t\tsvif_type = BNXT_ULP_VF_FUNC_SVIF;\n \t\telse\n \t\t\tsvif_type = BNXT_ULP_DRV_FUNC_SVIF;\n@@ -474,7 +478,8 @@ ulp_rte_parser_implicit_match_port_process(struct ulp_rte_parser_params *params)\n \t}\n \n \t/* Update the SVIF details */\n-\trc = ulp_rte_parser_svif_set(params, ifindex, svif_mask);\n+\trc = ulp_rte_parser_svif_set(params, ifindex, svif_mask,\n+\t\t\t\t     BNXT_ULP_DIR_INVALID);\n \treturn rc;\n }\n \n@@ -522,7 +527,8 @@ ulp_rte_pf_hdr_handler(const struct rte_flow_item *item __rte_unused,\n \t}\n \n \t/* Update the SVIF details */\n-\treturn  ulp_rte_parser_svif_set(params, ifindex, svif_mask);\n+\treturn ulp_rte_parser_svif_set(params, ifindex, svif_mask,\n+\t\t\t\t       BNXT_ULP_DIR_INVALID);\n }\n \n /* Function to handle the parsing of RTE Flow item VF Header. */\n@@ -555,39 +561,72 @@ ulp_rte_vf_hdr_handler(const struct rte_flow_item *item,\n \t\treturn rc;\n \t}\n \t/* Update the SVIF details */\n-\treturn ulp_rte_parser_svif_set(params, ifindex, mask);\n+\treturn ulp_rte_parser_svif_set(params, ifindex, mask,\n+\t\t\t\t       BNXT_ULP_DIR_INVALID);\n }\n \n-/* Function to handle the parsing of RTE Flow item port id  Header. */\n+/* Parse items PORT_ID, PORT_REPRESENTOR and REPRESENTED_PORT. */\n int32_t\n-ulp_rte_port_id_hdr_handler(const struct rte_flow_item *item,\n-\t\t\t    struct ulp_rte_parser_params *params)\n+ulp_rte_port_hdr_handler(const struct rte_flow_item *item,\n+\t\t\t struct ulp_rte_parser_params *params)\n {\n-\tconst struct rte_flow_item_port_id *port_spec = item->spec;\n-\tconst struct rte_flow_item_port_id *port_mask = item->mask;\n+\tenum bnxt_ulp_direction_type item_dir;\n+\tuint16_t ethdev_id;\n \tuint16_t mask = 0;\n \tint32_t rc = BNXT_TF_RC_PARSE_ERR;\n \tuint32_t ifindex;\n \n-\tif (!port_spec) {\n-\t\tBNXT_TF_DBG(ERR, \"ParseErr:Port id is not valid\\n\");\n+\tif (!item->spec) {\n+\t\tBNXT_TF_DBG(ERR, \"ParseErr:Port spec is not valid\\n\");\n \t\treturn rc;\n \t}\n-\tif (!port_mask) {\n-\t\tBNXT_TF_DBG(ERR, \"ParseErr:Phy Port mask is not valid\\n\");\n+\tif (!item->mask) {\n+\t\tBNXT_TF_DBG(ERR, \"ParseErr:Port mask is not valid\\n\");\n+\t\treturn rc;\n+\t}\n+\n+\tswitch (item->type) {\n+\tcase RTE_FLOW_ITEM_TYPE_PORT_ID: {\n+\t\tconst struct rte_flow_item_port_id *port_spec = item->spec;\n+\t\tconst struct rte_flow_item_port_id *port_mask = item->mask;\n+\n+\t\titem_dir = BNXT_ULP_DIR_INVALID;\n+\t\tethdev_id = port_spec->id;\n+\t\tmask = port_mask->id;\n+\t\tbreak;\n+\t}\n+\tcase RTE_FLOW_ITEM_TYPE_PORT_REPRESENTOR: {\n+\t\tconst struct rte_flow_item_ethdev *ethdev_spec = item->spec;\n+\t\tconst struct rte_flow_item_ethdev *ethdev_mask = item->mask;\n+\n+\t\titem_dir = BNXT_ULP_DIR_INGRESS;\n+\t\tethdev_id = ethdev_spec->port_id;\n+\t\tmask = ethdev_mask->port_id;\n+\t\tbreak;\n+\t}\n+\tcase RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT: {\n+\t\tconst struct rte_flow_item_ethdev *ethdev_spec = item->spec;\n+\t\tconst struct rte_flow_item_ethdev *ethdev_mask = item->mask;\n+\n+\t\titem_dir = BNXT_ULP_DIR_EGRESS;\n+\t\tethdev_id = ethdev_spec->port_id;\n+\t\tmask = ethdev_mask->port_id;\n+\t\tbreak;\n+\t}\n+\tdefault:\n+\t\tBNXT_TF_DBG(ERR, \"ParseErr:Unexpected item\\n\");\n \t\treturn rc;\n \t}\n-\tmask = port_mask->id;\n \n \t/* perform the conversion from dpdk port to bnxt ifindex */\n \tif (ulp_port_db_dev_port_to_ulp_index(params->ulp_ctx,\n-\t\t\t\t\t      port_spec->id,\n+\t\t\t\t\t      ethdev_id,\n \t\t\t\t\t      &ifindex)) {\n \t\tBNXT_TF_DBG(ERR, \"ParseErr:Portid is not valid\\n\");\n \t\treturn rc;\n \t}\n \t/* Update the SVIF details */\n-\treturn ulp_rte_parser_svif_set(params, ifindex, mask);\n+\treturn ulp_rte_parser_svif_set(params, ifindex, mask, item_dir);\n }\n \n /* Function to handle the parsing of RTE Flow item phy port Header. */\ndiff --git a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.h b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.h\nindex e14f86278a..0acb93946b 100644\n--- a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.h\n+++ b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.h\n@@ -90,10 +90,10 @@ int32_t\n ulp_rte_vf_hdr_handler(const struct rte_flow_item *item,\n \t\t       struct ulp_rte_parser_params *params);\n \n-/* Function to handle the parsing of RTE Flow item port id Header. */\n+/* Parse items PORT_ID, PORT_REPRESENTOR and REPRESENTED_PORT. */\n int32_t\n-ulp_rte_port_id_hdr_handler(const struct rte_flow_item *item,\n-\t\t\t    struct ulp_rte_parser_params *params);\n+ulp_rte_port_hdr_handler(const struct rte_flow_item *item,\n+\t\t\t struct ulp_rte_parser_params *params);\n \n /* Function to handle the parsing of RTE Flow item port Header. */\n int32_t\n",
    "prefixes": [
        "v2",
        "07/12"
    ]
}