get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 132733,
    "url": "http://patches.dpdk.org/api/patches/132733/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20231017080928.30454-14-getelson@nvidia.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": "<20231017080928.30454-14-getelson@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20231017080928.30454-14-getelson@nvidia.com",
    "date": "2023-10-17T08:09:25",
    "name": "[v3,13/16] net/mlx5: fix RTE action location tracking in a template",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "6af6ebf85b81a9815b16ebdb7619d09f89b8465e",
    "submitter": {
        "id": 1882,
        "url": "http://patches.dpdk.org/api/people/1882/?format=api",
        "name": "Gregory Etelson",
        "email": "getelson@nvidia.com"
    },
    "delegate": {
        "id": 3268,
        "url": "http://patches.dpdk.org/api/users/3268/?format=api",
        "username": "rasland",
        "first_name": "Raslan",
        "last_name": "Darawsheh",
        "email": "rasland@nvidia.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20231017080928.30454-14-getelson@nvidia.com/mbox/",
    "series": [
        {
            "id": 29872,
            "url": "http://patches.dpdk.org/api/series/29872/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=29872",
            "date": "2023-10-17T08:09:12",
            "name": "net/mlx5: support indirect actions list",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/29872/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/132733/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/132733/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 435A24318A;\n\tTue, 17 Oct 2023 10:11:45 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id DF1F642DD7;\n\tTue, 17 Oct 2023 10:10:46 +0200 (CEST)",
            "from NAM02-DM3-obe.outbound.protection.outlook.com\n (mail-dm3nam02on2067.outbound.protection.outlook.com [40.107.95.67])\n by mails.dpdk.org (Postfix) with ESMTP id 9410542D99\n for <dev@dpdk.org>; Tue, 17 Oct 2023 10:10:44 +0200 (CEST)",
            "from CY5PR19CA0036.namprd19.prod.outlook.com (2603:10b6:930:1a::27)\n by MW3PR12MB4363.namprd12.prod.outlook.com (2603:10b6:303:56::14)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.36; Tue, 17 Oct\n 2023 08:10:41 +0000",
            "from CY4PEPF0000E9DB.namprd05.prod.outlook.com\n (2603:10b6:930:1a:cafe::f2) by CY5PR19CA0036.outlook.office365.com\n (2603:10b6:930:1a::27) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.36 via Frontend\n Transport; Tue, 17 Oct 2023 08:10:41 +0000",
            "from mail.nvidia.com (216.228.117.160) by\n CY4PEPF0000E9DB.mail.protection.outlook.com (10.167.241.81) with Microsoft\n SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.20.6838.22 via Frontend Transport; Tue, 17 Oct 2023 08:10:41 +0000",
            "from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com\n (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 17 Oct\n 2023 01:10:29 -0700",
            "from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com\n (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 17 Oct\n 2023 01:10:25 -0700"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=i/05TrCbth+02cz4WOv6xTVC8u7g9ZMXt9eDbXgKPIXk3+9pjVKFm1V5ApLFqlWeiotszzCUM0A8pBOteGci8UYePHmTcTkSuH7luVbSH7jsp0jEGvTkpos/GK12d2sxRt7noE/0V9zlsw636Qlqu4ydoYdqXZiJ2PLsQd23ES4/sDFwxKFJ4LtWNFt46nUOrVlHVT1jUU4rRpTi9ThLzJengoVhjxYj9vEUwAVPFKWJoP6z85vTxzL8p1knr3iHsAlqJ9msbrkbVUe/KyIidL5yPUbGQHk+RqTHkSxpYsZWHUqFjBOK8HaPUNvWItnKUnz/0sY09kRmz1FdK/xG1g==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector9901;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=Vmb1qhxRiPcHT+alGWAxjrhR7fOp2EqnR0jYj6SEYp0=;\n b=j73/XPdalQihM7YEtQgWbPQhfRPTxp9dgOQSUd0ftKEf0Wxm0p4Db3aAZTnZWaBw+f0uoupQVERFaeLhpaO6MevWiQ6oqT7TuNzAIla4sTzl4E8HS0d8eVgyMmrfkltMn8PwKUQkFJvpTxn9IDe3d5b6/FZw4zWuZE9s8gQ2bXdpcPOcYjKudoQ7frE/IoSzZvbOrR1MZAEN2fCmEz3UPaOpNnG2FeGhi+5XmHlGjt6vrQvR65ShZlJ3FeQ0IKusKUzuONgKUwM8CkFh4m6to2lf01mbxOXvDJk7+ck9euFedTfcHSOi7/Y69P2mFdp09HDvckB2+o84NPsoW5dLGA==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 216.228.117.160) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com;\n dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com;\n dkim=none (message not signed); arc=none",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;\n s=selector2;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=Vmb1qhxRiPcHT+alGWAxjrhR7fOp2EqnR0jYj6SEYp0=;\n b=oumgBgOnWRBZGLEFrOa2N6qswYpLAByfS0k+3UjogYQ60pkzbB4g3UNFoLLOYzUNJbwDCQ69BnyiClO1sTUH+r4kmA8Afe7/FiYrPi0/lFzP/e5ObG6QAmJL5uJUXVKruA8r6BsVIDyiH1lx4LG/LiBj1a8Fckbj42XU8ybOl+NSoQZ/vuKx6apl7Wm2W/3vlOH41gx0UyGxEZgysUanjEC1PHxt+j66U3OvNj8gimR/qaUSEFXC1fIyNnlwZIjfvDYzxr6W5XXlu2ByjL2YkajBjivR/9qGOZqd9d6GwUv6uLPvmmGZJj2ZCKH4hQ8DdMEm3JV9PDSoYliYq4r6fg==",
        "X-MS-Exchange-Authentication-Results": "spf=pass (sender IP is 216.228.117.160)\n smtp.mailfrom=nvidia.com;\n dkim=none (message not signed)\n header.d=none;dmarc=pass action=none header.from=nvidia.com;",
        "Received-SPF": "Pass (protection.outlook.com: domain of nvidia.com designates\n 216.228.117.160 as permitted sender) receiver=protection.outlook.com;\n client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C",
        "From": "Gregory Etelson <getelson@nvidia.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<getelson@nvidia.com>, =?utf-8?b?wqA=?= <mkashani@nvidia.com>,\n <rasland@nvidia.com>, Suanming Mou <suanmingm@nvidia.com>,\n Matan Azrad <matan@nvidia.com>,\n Viacheslav Ovsiienko <viacheslavo@nvidia.com>, Ori Kam <orika@nvidia.com>,\n Bing Zhao <bingz@nvidia.com>",
        "Subject": "[PATCH v3 13/16] net/mlx5: fix RTE action location tracking in a\n template",
        "Date": "Tue, 17 Oct 2023 11:09:25 +0300",
        "Message-ID": "<20231017080928.30454-14-getelson@nvidia.com>",
        "X-Mailer": "git-send-email 2.39.2",
        "In-Reply-To": "<20231017080928.30454-1-getelson@nvidia.com>",
        "References": "<20230927191046.405282-1-getelson@nvidia.com>\n <20231017080928.30454-1-getelson@nvidia.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.126.230.35]",
        "X-ClientProxiedBy": "rnnvmail203.nvidia.com (10.129.68.9) To\n rnnvmail201.nvidia.com (10.129.68.8)",
        "X-EOPAttributedMessage": "0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-TrafficTypeDiagnostic": "CY4PEPF0000E9DB:EE_|MW3PR12MB4363:EE_",
        "X-MS-Office365-Filtering-Correlation-Id": "98dc8278-5a39-4f4c-18e6-08dbcee88e3c",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;",
        "X-Microsoft-Antispam-Message-Info": "\n LcMAbIhz6wX0+AEmYv5+nYF+uJSCz9wdHmFVSr7o5otxT/A6Ik2EHHZ1gH9BU9za4Tf6VyBJqfu/Y05eqrVytI0CRn7Qa0UUIssQXmcjvdbLP7Opp8Yl6O8rs568ux+QfEVAxz7SDhCi8K5jn8imEbvv4LgcWQSfjRzyKf7GiH9eB90pHUzvQzOWa3/pVzacP7RdP4Y8K2wKQs9Tno2YtwENCA2vsuPz8VHe2GuMSxVOkPL8W3UxgldzBkHbWFuAOqp05Wc9eqp6yfWDjUiW13WVMnxVZjv6gliLCp/kz4JXniv04deTzMrrb+lvlCgh3p2+zeN/dGHG+AXTtJmdBP9JKmj+PqZBw8YL+liHl6Zf/4NAnJSCeOyQDSXjU90srGbU69PHNxX0Xl0VQWX5xRKjsLllZ6OEi6Vq+zRFK3vZS1hAwaNsBKhMEnTtUcnozyVU/B4BRI+SCGldHuNhzMecb+EHHlXPxPfvn4hyLT98WXJQVnhAF1RpkVlPEdfdyp454vAhr9paf7SMvDcekFNakH58HCK8lzhV2sFK7/98Oa8FbY13McMbRx4VMQQUeJzHjilSY9U9G/RtN4lqUqiqs7zrcbTGiuNzWo8+BR2dHr96Sn1s34TANaEjqO7e5AmjHq+sA5Md/szxT+0JMt3RrIDlKkcYvWzLiay/nVoJMsoeGMaC0G57n14HC29dSEBmKr1n46RAfcKLa54Vym70KZogupnQZntFbQXshoQ4yLzS7ry4TRAyxBdpspFh",
        "X-Forefront-Antispam-Report": "CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1;\n SRV:;\n IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE;\n SFS:(13230031)(4636009)(376002)(136003)(39860400002)(396003)(346002)(230922051799003)(186009)(82310400011)(64100799003)(1800799009)(451199024)(46966006)(36840700001)(40470700004)(36756003)(40480700001)(55016003)(40460700003)(316002)(54906003)(6916009)(70586007)(70206006)(86362001)(82740400003)(7636003)(356005)(36860700001)(83380400001)(426003)(336012)(107886003)(26005)(6286002)(2616005)(1076003)(8936002)(16526019)(7696005)(2906002)(30864003)(478600001)(41300700001)(47076005)(5660300002)(8676002)(4326008);\n DIR:OUT; SFP:1101;",
        "X-OriginatorOrg": "Nvidia.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "17 Oct 2023 08:10:41.6001 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 98dc8278-5a39-4f4c-18e6-08dbcee88e3c",
        "X-MS-Exchange-CrossTenant-Id": "43083d15-7273-40c1-b7db-39efd9ccc17a",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "\n TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160];\n Helo=[mail.nvidia.com]",
        "X-MS-Exchange-CrossTenant-AuthSource": "\n CY4PEPF0000E9DB.namprd05.prod.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "MW3PR12MB4363",
        "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"
    },
    "content": "PMD can implicitly add flow actions to application actions template.\nIf PMD added actions to a template is must track location of the\noriginal application actions in modified template.\n\nThe patch adds tracking ability for the orignal acton in a template.\n\nFixes: ddb68e4 (\"net/mlx5: add extended metadata mode for HWS\")\nSigned-off-by: Gregory Etelson <getelson@nvidia.com>\nAcked-by: Suanming Mou <suanmingm@nvidia.com>\n---\n drivers/net/mlx5/mlx5_flow.h    |  2 +-\n drivers/net/mlx5/mlx5_flow_hw.c | 90 ++++++++++++++++-----------------\n 2 files changed, 45 insertions(+), 47 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h\nindex a31120cd78..19b26ad333 100644\n--- a/drivers/net/mlx5/mlx5_flow.h\n+++ b/drivers/net/mlx5/mlx5_flow.h\n@@ -1332,10 +1332,10 @@ struct rte_flow_actions_template {\n \tuint16_t dr_actions_num; /* Amount of DR rules actions. */\n \tuint16_t actions_num; /* Amount of flow actions */\n \tuint16_t *dr_off; /* DR action offset for given rte action offset. */\n+\tuint16_t *src_off; /* RTE action displacement from app. template */\n \tuint16_t reformat_off; /* Offset of DR reformat action. */\n \tuint16_t mhdr_off; /* Offset of DR modify header action. */\n \tuint32_t refcnt; /* Reference counter. */\n-\tuint16_t rx_cpy_pos; /* Action position of Rx metadata to be copied. */\n \tuint8_t flex_item; /* flex item index. */\n };\n \ndiff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c\nindex 53641ae2d5..213b0d5ae8 100644\n--- a/drivers/net/mlx5/mlx5_flow_hw.c\n+++ b/drivers/net/mlx5/mlx5_flow_hw.c\n@@ -1015,11 +1015,11 @@ flow_hw_modify_field_init(struct mlx5_hw_modify_header_action *mhdr,\n static __rte_always_inline int\n flow_hw_modify_field_compile(struct rte_eth_dev *dev,\n \t\t\t     const struct rte_flow_attr *attr,\n-\t\t\t     const struct rte_flow_action *action_start, /* Start of AT actions. */\n \t\t\t     const struct rte_flow_action *action, /* Current action from AT. */\n \t\t\t     const struct rte_flow_action *action_mask, /* Current mask from AT. */\n \t\t\t     struct mlx5_hw_actions *acts,\n \t\t\t     struct mlx5_hw_modify_header_action *mhdr,\n+\t\t\t     uint16_t src_pos,\n \t\t\t     struct rte_flow_error *error)\n {\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n@@ -1122,7 +1122,7 @@ flow_hw_modify_field_compile(struct rte_eth_dev *dev,\n \tif (shared)\n \t\treturn 0;\n \tret = __flow_hw_act_data_hdr_modify_append(priv, acts, RTE_FLOW_ACTION_TYPE_MODIFY_FIELD,\n-\t\t\t\t\t\t   action - action_start, mhdr->pos,\n+\t\t\t\t\t\t   src_pos, mhdr->pos,\n \t\t\t\t\t\t   cmds_start, cmds_end, shared,\n \t\t\t\t\t\t   field, dcopy, mask);\n \tif (ret)\n@@ -1181,11 +1181,10 @@ flow_hw_validate_compiled_modify_field(struct rte_eth_dev *dev,\n static int\n flow_hw_represented_port_compile(struct rte_eth_dev *dev,\n \t\t\t\t const struct rte_flow_attr *attr,\n-\t\t\t\t const struct rte_flow_action *action_start,\n \t\t\t\t const struct rte_flow_action *action,\n \t\t\t\t const struct rte_flow_action *action_mask,\n \t\t\t\t struct mlx5_hw_actions *acts,\n-\t\t\t\t uint16_t action_dst,\n+\t\t\t\t uint16_t action_src, uint16_t action_dst,\n \t\t\t\t struct rte_flow_error *error)\n {\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n@@ -1241,7 +1240,7 @@ flow_hw_represented_port_compile(struct rte_eth_dev *dev,\n \t} else {\n \t\tret = __flow_hw_act_data_general_append\n \t\t\t\t(priv, acts, action->type,\n-\t\t\t\t action - action_start, action_dst);\n+\t\t\t\t action_src, action_dst);\n \t\tif (ret)\n \t\t\treturn rte_flow_error_set\n \t\t\t\t\t(error, ENOMEM,\n@@ -1493,7 +1492,6 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev,\n \tconst struct rte_flow_template_table_attr *table_attr = &cfg->attr;\n \tconst struct rte_flow_attr *attr = &table_attr->flow_attr;\n \tstruct rte_flow_action *actions = at->actions;\n-\tstruct rte_flow_action *action_start = actions;\n \tstruct rte_flow_action *masks = at->masks;\n \tenum mlx5dr_action_type refmt_type = MLX5DR_ACTION_TYP_LAST;\n \tconst struct rte_flow_action_raw_encap *raw_encap_data;\n@@ -1506,7 +1504,6 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev,\n \tuint32_t type;\n \tbool reformat_used = false;\n \tunsigned int of_vlan_offset;\n-\tuint16_t dr_pos;\n \tuint16_t jump_pos;\n \tuint32_t ct_idx;\n \tint ret, err;\n@@ -1521,7 +1518,10 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev,\n \telse\n \t\ttype = MLX5DR_TABLE_TYPE_NIC_RX;\n \tfor (; !actions_end; actions++, masks++) {\n-\t\tdr_pos = at->dr_off[actions - at->actions];\n+\t\tuint64_t pos = actions - at->actions;\n+\t\tuint16_t src_pos = pos - at->src_off[pos];\n+\t\tuint16_t dr_pos = at->dr_off[pos];\n+\n \t\tswitch ((int)actions->type) {\n \t\tcase RTE_FLOW_ACTION_TYPE_INDIRECT_LIST:\n \t\t\tif (!attr->group) {\n@@ -1529,9 +1529,7 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev,\n \t\t\t\tgoto err;\n \t\t\t}\n \t\t\tret = table_template_translate_indirect_list\n-\t\t\t\t(dev, actions, masks, acts,\n-\t\t\t\t actions - action_start,\n-\t\t\t\t dr_pos);\n+\t\t\t\t(dev, actions, masks, acts, src_pos, dr_pos);\n \t\t\tif (ret)\n \t\t\t\tgoto err;\n \t\t\tbreak;\n@@ -1542,11 +1540,11 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev,\n \t\t\t}\n \t\t\tif (actions->conf && masks->conf) {\n \t\t\t\tif (flow_hw_shared_action_translate\n-\t\t\t\t(dev, actions, acts, actions - action_start, dr_pos))\n+\t\t\t\t(dev, actions, acts, src_pos, dr_pos))\n \t\t\t\t\tgoto err;\n \t\t\t} else if (__flow_hw_act_data_general_append\n \t\t\t\t\t(priv, acts, RTE_FLOW_ACTION_TYPE_INDIRECT,\n-\t\t\t\t\t actions - action_start, dr_pos)){\n+\t\t\t\t\t src_pos, dr_pos)){\n \t\t\t\tgoto err;\n \t\t\t}\n \t\t\tbreak;\n@@ -1566,7 +1564,8 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev,\n \t\t\t\t\t(((const struct rte_flow_action_mark *)\n \t\t\t\t\t(actions->conf))->id);\n \t\t\telse if (__flow_hw_act_data_general_append(priv, acts,\n-\t\t\t\t\t\t\t\t   actions->type, actions - action_start, dr_pos))\n+\t\t\t\t\t\t\t\t   actions->type,\n+\t\t\t\t\t\t\t\t   src_pos, dr_pos))\n \t\t\t\tgoto err;\n \t\t\tacts->rule_acts[dr_pos].action =\n \t\t\t\tpriv->hw_tag[!!attr->group];\n@@ -1581,7 +1580,7 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev,\n \t\t\t\t\tvlan_hdr_to_be32(actions);\n \t\t\telse if (__flow_hw_act_data_general_append\n \t\t\t\t\t(priv, acts, actions->type,\n-\t\t\t\t\t actions - action_start, dr_pos))\n+\t\t\t\t\t src_pos, dr_pos))\n \t\t\t\tgoto err;\n \t\t\tof_vlan_offset = is_of_vlan_pcp_present(actions) ?\n \t\t\t\t\tMLX5_HW_VLAN_PUSH_PCP_IDX :\n@@ -1609,7 +1608,7 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev,\n \t\t\t\t\t\t\t\t acts->jump->root_action;\n \t\t\t} else if (__flow_hw_act_data_general_append\n \t\t\t\t\t(priv, acts, actions->type,\n-\t\t\t\t\t actions - action_start, dr_pos)){\n+\t\t\t\t\t src_pos, dr_pos)){\n \t\t\t\tgoto err;\n \t\t\t}\n \t\t\tbreak;\n@@ -1627,7 +1626,7 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev,\n \t\t\t\t\tacts->tir->action;\n \t\t\t} else if (__flow_hw_act_data_general_append\n \t\t\t\t\t(priv, acts, actions->type,\n-\t\t\t\t\t actions - action_start, dr_pos)) {\n+\t\t\t\t\t src_pos, dr_pos)) {\n \t\t\t\tgoto err;\n \t\t\t}\n \t\t\tbreak;\n@@ -1643,7 +1642,7 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev,\n \t\t\t\t\tacts->tir->action;\n \t\t\t} else if (__flow_hw_act_data_general_append\n \t\t\t\t\t(priv, acts, actions->type,\n-\t\t\t\t\t actions - action_start, dr_pos)) {\n+\t\t\t\t\t src_pos, dr_pos)) {\n \t\t\t\tgoto err;\n \t\t\t}\n \t\t\tbreak;\n@@ -1655,7 +1654,7 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev,\n \t\t\t\tenc_item_m = ((const struct rte_flow_action_vxlan_encap *)\n \t\t\t\t\t     masks->conf)->definition;\n \t\t\treformat_used = true;\n-\t\t\treformat_src = actions - action_start;\n+\t\t\treformat_src = src_pos;\n \t\t\trefmt_type = MLX5DR_ACTION_TYP_REFORMAT_L2_TO_TNL_L2;\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_NVGRE_ENCAP:\n@@ -1666,7 +1665,7 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev,\n \t\t\t\tenc_item_m = ((const struct rte_flow_action_nvgre_encap *)\n \t\t\t\t\t     masks->conf)->definition;\n \t\t\treformat_used = true;\n-\t\t\treformat_src = actions - action_start;\n+\t\t\treformat_src = src_pos;\n \t\t\trefmt_type = MLX5DR_ACTION_TYP_REFORMAT_L2_TO_TNL_L2;\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_VXLAN_DECAP:\n@@ -1696,7 +1695,7 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev,\n \t\t\t\trefmt_type =\n \t\t\t\tMLX5DR_ACTION_TYP_REFORMAT_L2_TO_TNL_L2;\n \t\t\t}\n-\t\t\treformat_src = actions - action_start;\n+\t\t\treformat_src = src_pos;\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_RAW_DECAP:\n \t\t\treformat_used = true;\n@@ -1718,26 +1717,16 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev,\n \t\t\tacts->rule_acts[dr_pos].action = priv->hw_send_to_kernel[table_type];\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_MODIFY_FIELD:\n-\t\t\terr = flow_hw_modify_field_compile(dev, attr, action_start,\n-\t\t\t\t\t\t\t   actions, masks, acts, &mhdr,\n-\t\t\t\t\t\t\t   error);\n+\t\t\terr = flow_hw_modify_field_compile(dev, attr, actions,\n+\t\t\t\t\t\t\t   masks, acts, &mhdr,\n+\t\t\t\t\t\t\t   src_pos, error);\n \t\t\tif (err)\n \t\t\t\tgoto err;\n-\t\t\t/*\n-\t\t\t * Adjust the action source position for the following.\n-\t\t\t * ... / MODIFY_FIELD: rx_cpy_pos / (QUEUE|RSS) / ...\n-\t\t\t * The next action will be Q/RSS, there will not be\n-\t\t\t * another adjustment and the real source position of\n-\t\t\t * the following actions will be decreased by 1.\n-\t\t\t * No change of the total actions in the new template.\n-\t\t\t */\n-\t\t\tif ((actions - action_start) == at->rx_cpy_pos)\n-\t\t\t\taction_start += 1;\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT:\n \t\t\tif (flow_hw_represented_port_compile\n-\t\t\t\t\t(dev, attr, action_start, actions,\n-\t\t\t\t\t masks, acts, dr_pos, error))\n+\t\t\t\t\t(dev, attr, actions,\n+\t\t\t\t\t masks, acts, src_pos, dr_pos, error))\n \t\t\t\tgoto err;\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_METER:\n@@ -1756,7 +1745,7 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev,\n \t\t\t\t\tgoto err;\n \t\t\t} else if (__flow_hw_act_data_general_append(priv, acts,\n \t\t\t\t\t\t\t\t     actions->type,\n-\t\t\t\t\t\t\tactions - action_start,\n+\t\t\t\t\t\t\t\t     src_pos,\n \t\t\t\t\t\t\t\t     dr_pos))\n \t\t\t\tgoto err;\n \t\t\tbreak;\n@@ -1772,7 +1761,7 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev,\n \t\t\t}\n \t\t\tif (__flow_hw_act_data_general_append(priv, acts,\n \t\t\t\t\t\t\t      actions->type,\n-\t\t\t\t\t\t\t actions - action_start,\n+\t\t\t\t\t\t\t      src_pos,\n \t\t\t\t\t\t\t      dr_pos))\n \t\t\t\tgoto err;\n \t\t\tbreak;\n@@ -1802,7 +1791,7 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev,\n \t\t\t\t\tgoto err;\n \t\t\t} else if (__flow_hw_act_data_general_append\n \t\t\t\t\t(priv, acts, actions->type,\n-\t\t\t\t\t actions - action_start, dr_pos)) {\n+\t\t\t\t\t src_pos, dr_pos)) {\n \t\t\t\tgoto err;\n \t\t\t}\n \t\t\tbreak;\n@@ -1815,7 +1804,7 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev,\n \t\t\t\t\tgoto err;\n \t\t\t} else if (__flow_hw_act_data_general_append\n \t\t\t\t\t(priv, acts, actions->type,\n-\t\t\t\t\t actions - action_start, dr_pos)) {\n+\t\t\t\t\t src_pos, dr_pos)) {\n \t\t\t\tgoto err;\n \t\t\t}\n \t\t\tbreak;\n@@ -1832,7 +1821,7 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev,\n \t\t\t\t\tgoto err;\n \t\t\t} else if (__flow_hw_act_data_general_append(priv, acts,\n \t\t\t\t\t\t\t\t     actions->type,\n-\t\t\t\t\t\t\tactions - action_start,\n+\t\t\t\t\t\t\t\t     src_pos,\n \t\t\t\t\t\t\t\t     dr_pos))\n \t\t\t\tgoto err;\n \t\t\tbreak;\n@@ -1916,7 +1905,7 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev,\n \t\tif (shared_rfmt)\n \t\t\tacts->rule_acts[at->reformat_off].reformat.offset = 0;\n \t\telse if (__flow_hw_act_data_encap_append(priv, acts,\n-\t\t\t\t (action_start + reformat_src)->type,\n+\t\t\t\t (at->actions + reformat_src)->type,\n \t\t\t\t reformat_src, at->reformat_off, data_size))\n \t\t\tgoto err;\n \t\tacts->encap_decap->shared = shared_rfmt;\n@@ -4273,8 +4262,11 @@ flow_hw_validate_action_raw_encap(struct rte_eth_dev *dev __rte_unused,\n  * The PMD handles the sequence as a single encap or decap reformat action,\n  * depending on the raw_encap configuration.\n  *\n- * The function assumes that the sequence location in actions template list\n- * complies with relative HWS actions order for the required reformat.\n+ * The function assumes that the raw_decap / raw_encap location\n+ * in actions template list complies with relative HWS actions order:\n+ * for the required reformat configuration:\n+ * ENCAP configuration must appear before [JUMP|DROP|PORT]\n+ * DECAP configuration must appear at the template head.\n  */\n static uint64_t\n mlx5_decap_encap_reformat_type(const struct rte_flow_action *actions,\n@@ -4352,7 +4344,7 @@ flow_hw_template_expand_modify_field(struct rte_flow_action actions[],\n \t\t\t\ti++;\n \t\t\t\tgoto insert;\n \t\t\t}\n-\t\t\tif (flags & MLX5_FLOW_ACTION_DECAP)\n+\t\t\tif (actions[i - 1].type == RTE_FLOW_ACTION_TYPE_RAW_DECAP)\n \t\t\t\ti--;\n \t\t\tbreak;\n \t\tdefault:\n@@ -5131,6 +5123,7 @@ flow_hw_actions_template_create(struct rte_eth_dev *dev,\n \tstruct rte_flow_action mf_actions[MLX5_HW_MAX_ACTS];\n \tstruct rte_flow_action mf_masks[MLX5_HW_MAX_ACTS];\n \tuint32_t expand_mf_num = 0;\n+\tuint16_t src_off[MLX5_HW_MAX_ACTS] = {0, };\n \n \tif (mlx5_flow_hw_actions_validate(dev, attr, actions, masks,\n \t\t\t\t\t  &action_flags, error))\n@@ -5209,6 +5202,8 @@ flow_hw_actions_template_create(struct rte_eth_dev *dev,\n \t\t\t\t\t\t\t   act_num,\n \t\t\t\t\t\t\t   expand_mf_num);\n \t\tact_num += expand_mf_num;\n+\t\tfor (i = pos + expand_mf_num; i < act_num; i++)\n+\t\t\tsrc_off[i] += expand_mf_num;\n \t\taction_flags |= MLX5_FLOW_ACTION_MODIFY_FIELD;\n \t}\n \tact_len = rte_flow_conv(RTE_FLOW_CONV_OP_ACTIONS, NULL, 0, ra, error);\n@@ -5220,6 +5215,7 @@ flow_hw_actions_template_create(struct rte_eth_dev *dev,\n \t\treturn NULL;\n \tlen += RTE_ALIGN(mask_len, 16);\n \tlen += RTE_ALIGN(act_num * sizeof(*at->dr_off), 16);\n+\tlen += RTE_ALIGN(act_num * sizeof(*at->src_off), 16);\n \tat = mlx5_malloc(MLX5_MEM_ZERO, len + sizeof(*at),\n \t\t\t RTE_CACHE_LINE_SIZE, rte_socket_id());\n \tif (!at) {\n@@ -5244,12 +5240,14 @@ flow_hw_actions_template_create(struct rte_eth_dev *dev,\n \t\tgoto error;\n \t/* DR actions offsets in the third part. */\n \tat->dr_off = (uint16_t *)((uint8_t *)at->masks + mask_len);\n+\tat->src_off = RTE_PTR_ADD(at->dr_off,\n+\t\t\t\t  RTE_ALIGN(act_num * sizeof(*at->dr_off), 16));\n+\tmemcpy(at->src_off, src_off, act_num * sizeof(at->src_off[0]));\n \tat->actions_num = act_num;\n \tfor (i = 0; i < at->actions_num; ++i)\n \t\tat->dr_off[i] = UINT16_MAX;\n \tat->reformat_off = UINT16_MAX;\n \tat->mhdr_off = UINT16_MAX;\n-\tat->rx_cpy_pos = pos;\n \tfor (i = 0; actions->type != RTE_FLOW_ACTION_TYPE_END;\n \t     actions++, masks++, i++) {\n \t\tconst struct rte_flow_action_modify_field *info;\n",
    "prefixes": [
        "v3",
        "13/16"
    ]
}