From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C8C84A0550 for ; Sat, 26 Nov 2022 17:03:39 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B85D040A84; Sat, 26 Nov 2022 17:03:39 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2068.outbound.protection.outlook.com [40.107.94.68]) by mails.dpdk.org (Postfix) with ESMTP id A1B0140150 for ; Sat, 26 Nov 2022 17:03:38 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AZmZcirZvvAZy9/W/U0BiskuXSoq1qGDb9OfaqAat9jH3YEdsvyxDgg/Moy+AlY9DGJxdgeDn3R2aGxFS85ppzgZQjxhFIozVolSVJx0IOjs0U6SvWBorvOtaVN1DHXRLEAbM2rRqaLn2W0IKdYi02gulJT8KIVTtpn2LDohaFN0/uNhzzFrczsvRSFnk+9+uYA7hr8Hjjsj0msVgfcuOrPvKT+1BHtb3oFJzFmAqvePVZTecZp8uEHgtIJAQxoeRgdW85d36RZdPiemQEg0FSn9LPX/UofyVUzXPvMcpE1XEfiCIY/OGhxwYFpiUJvINZPt/ked1/CyazKJaLHV5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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; bh=LpqFSjAapqUuBjCi512t8cmX/vai2MX00nlyCK5nAjA=; b=CAjkhoA5kuUheHTnE3YcF8aslackfCChsCyyl+8wL9rshdhZ4bVlEqjlx2pjq8OaSzM796683ksap60RlHU+c9YHPluQQcPIhYNI2YdygfHD6VeOJsh+4dcWQRUkYfrF+YdUtMBhKwlBoJQ6yAPrGTNUgk/OgQItgeXNrCgi1rboo3sD/e5JKkSCc0t9bj1Mv+68f5g9PF563/OA/wHEdRR4sTJQlRY651CwOQIMTxrfnluxR5Xi/KbaJuU63+pJsjzGl8cBC8KV4bAgAiuxXDjmoY3KmHd3pcbYVS4z1FzVEf3KOxIIYyOfrSJw9SV1jnrQdKQsj66IscKLrKfYag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LpqFSjAapqUuBjCi512t8cmX/vai2MX00nlyCK5nAjA=; b=GIUr7R6HsJh1fK7F0TNYqm8y9pywccSQ91l7malBYWN9Vk2HgJAM8RpMApSW1JyJ3OiaO+S8p/2YEaDVtLbQKgRMYEXtQgr8inqhkFGlQmllQStxVh+lRTshp2vaLBP8cIwRBpTfwtVYTY0+RCEcVdvTfO6rIm+1ydLIhIM1H7KbwVrbuWoxleHyqX7aag6WLc5hWmaIbOTwNzSZ466cRWP7clhLt4bkdwlQQKnCwNb7YsPIakjT4Yb+GBERVSNkrR1waZPnaSxFfOACU8dUf2FEij0zMxNzwxPnsVX5bBjjkoXVH/53PMj3t7MzDDS9UsuPsr9L/Cvw4x3fmSZFag== Received: from DS7PR03CA0309.namprd03.prod.outlook.com (2603:10b6:8:2b::7) by SJ1PR12MB6171.namprd12.prod.outlook.com (2603:10b6:a03:45a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.21; Sat, 26 Nov 2022 16:03:34 +0000 Received: from DM6NAM11FT094.eop-nam11.prod.protection.outlook.com (2603:10b6:8:2b:cafe::7f) by DS7PR03CA0309.outlook.office365.com (2603:10b6:8:2b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.22 via Frontend Transport; Sat, 26 Nov 2022 16:03:34 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DM6NAM11FT094.mail.protection.outlook.com (10.13.172.195) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.18 via Frontend Transport; Sat, 26 Nov 2022 16:03:33 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Sat, 26 Nov 2022 08:03:20 -0800 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Sat, 26 Nov 2022 08:03:18 -0800 From: Jiawei Wang To: , , Matan Azrad CC: , Subject: [PATCH 21.11 1/2] net/mlx5: fix source port checking in sample flow rule Date: Sat, 26 Nov 2022 18:02:51 +0200 Message-ID: <20221126160252.48521-2-jiaweiw@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20221126160252.48521-1-jiaweiw@nvidia.com> References: <20221126160252.48521-1-jiaweiw@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT094:EE_|SJ1PR12MB6171:EE_ X-MS-Office365-Filtering-Correlation-Id: c73707ab-353d-4f10-ee9d-08dacfc7c556 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: REwdXbryrj1QckfGiM9zLdO71gwppo4iw4OqWGt9WK6Xt7xsUTcZngnQifkgGPClmQfPdat/mnqy/a+XhOXFsUdF5VFb7lnjTdqjzrxdCOs5+LYejyJIsew2U9obCYAl3Dw9KN7sAT0qrW4pAY4wcFdECxLxRqt7hg/rNKMv1XGcgFUs/n1JySKPDwoiSDJF8/MqCRqKctAjGafuwtUwqksIuj/aK30mimjkwYjmw/BGcui/HDBh+xnlUCiQCHDDAHbD5r4aMuUkTE83Cf943+4X3BRspvrZTQDO1tYnyZM1yugHgjA79ggWGtBN+DpIOfeT3JmqERxtmOEIJKKC0MgzLEievTx0njJ6j9TA7H70mqnhW6xGTvU+FrgWQ5GLHgMlYnIzdNv3YksoNrPPlD5eAyNajO1iE1FinGEeGJGbwKlVg3J61cHhy7kMiCOtOgsZ8ilA54do3vvSqcg83HkjqapQGauBFAlH5UXRoeA3XJrDBIdNQ1bYV4EyA9xSYjvTCbKCIm8cT31dMpU/d4+uZ2CDzQu2nSuH25DXgYLajeh/RT7kinUIpbBF5MCGW8thGm1OTawXD/Am8wm2dhu4Ww7CV8Yp1tyK99nxI6h+DomA2cqVxVXtIBOkRP9NRsFNr9b1GGZyajLb7d3rx2oNK6XCKwMzm88gHKGftHyr5iITZBM0JgL1I+HlwTqQzHLtwi8MCZK9i2yoxKYiVA== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230022)(4636009)(346002)(376002)(396003)(136003)(39860400002)(84040400005)(451199015)(40470700004)(46966006)(36840700001)(7636003)(356005)(55016003)(40480700001)(86362001)(40460700003)(36756003)(7696005)(110136005)(6666004)(107886003)(54906003)(8936002)(478600001)(30864003)(5660300002)(6636002)(2616005)(41300700001)(316002)(4326008)(70586007)(2906002)(8676002)(70206006)(36860700001)(82310400005)(6286002)(82740400003)(26005)(186003)(1076003)(16526019)(83380400001)(426003)(336012)(47076005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Nov 2022 16:03:33.7597 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c73707ab-353d-4f10-ee9d-08dacfc7c556 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT094.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6171 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org [ upstream commit e9de8f33ca89876071fc3b0997a53c8268bfb593 ] The metadata register C value was lost in FDB egress while doing the flow sampler on ConnectX-5. The FDB direction checking was decided by the source port in the flow creation. If there's additional port item was added in the flow match, then the actual source port was changed. This patch adds the checking for the port id item: RTE_FLOW_ITEM_TYPE_PORT_ID, then updates FDB egress checking and the source vport metadata from the port item, also updates the PUSH VLAN, POP VLAN and flow sampler action validation. Fixes: 8db2867c7996 ("net/mlx5: fix port matching in sample flow rule") Fixes: 255b8f86eb6e ("net/mlx5: fix E-Switch egress mirror flow validation") Signed-off-by: Jiawei Wang --- drivers/net/mlx5/mlx5_flow.c | 36 +++++++++++++++----- drivers/net/mlx5/mlx5_flow.h | 20 +++++++++++ drivers/net/mlx5/mlx5_flow_dv.c | 59 +++++++++++++++++++++------------ 3 files changed, 84 insertions(+), 31 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index df3a132ee4..36abc21639 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -5526,7 +5526,8 @@ flow_check_match_action(const struct rte_flow_action actions[], ratio = sample->ratio; sub_type = ((const struct rte_flow_action *) (sample->actions))->type; - if (ratio == 1 && attr->transfer) + if (ratio == 1 && attr->transfer && + sub_type != RTE_FLOW_ACTION_TYPE_END) fdb_mirror = 1; break; case RTE_FLOW_ACTION_TYPE_SET_MAC_SRC: @@ -5698,9 +5699,11 @@ flow_sample_split_prep(struct rte_eth_dev *dev, break; case RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN: case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID: - push_vlan_idx = action_idx; - if (push_vlan_idx < sample_action_pos) + if (action_idx < sample_action_pos && + push_vlan_idx == -1) { set_tag_idx = action_idx; + push_vlan_idx = action_idx; + } break; default: break; @@ -5763,17 +5766,18 @@ flow_sample_split_prep(struct rte_eth_dev *dev, .data = tag_id, }; /* Prepare the suffix subflow items. */ + tag_spec = (void *)(sfx_items + SAMPLE_SUFFIX_ITEM); + tag_spec->data = tag_id; + tag_spec->id = set_tag->id; + tag_mask = tag_spec + 1; + tag_mask->data = UINT32_MAX; for (; items->type != RTE_FLOW_ITEM_TYPE_END; items++) { if (items->type == RTE_FLOW_ITEM_TYPE_PORT_ID) { memcpy(sfx_items, items, sizeof(*sfx_items)); sfx_items++; + break; } } - tag_spec = (void *)(sfx_items + SAMPLE_SUFFIX_ITEM); - tag_spec->data = tag_id; - tag_spec->id = set_tag->id; - tag_mask = tag_spec + 1; - tag_mask->data = UINT32_MAX; sfx_items[0] = (struct rte_flow_item){ .type = (enum rte_flow_item_type) MLX5_RTE_FLOW_ITEM_TYPE_TAG, @@ -6351,6 +6355,8 @@ flow_create_split_sample(struct rte_eth_dev *dev, uint16_t jump_table = 0; const uint32_t next_ft_step = 1; int ret = 0; + struct mlx5_priv *item_port_priv = NULL; + const struct rte_flow_item *item; if (priv->sampler_en) actions_n = flow_check_match_action(actions, attr, @@ -6370,8 +6376,20 @@ flow_create_split_sample(struct rte_eth_dev *dev, RTE_FLOW_ERROR_TYPE_ACTION, NULL, "no memory to split " "sample flow"); + for (item = items; item->type != RTE_FLOW_ITEM_TYPE_END; item++) { + if (item->type == RTE_FLOW_ITEM_TYPE_PORT_ID) { + const struct rte_flow_item_port_id *spec; + + spec = (const struct rte_flow_item_port_id *)item->spec; + if (spec) + item_port_priv = + mlx5_port_to_eswitch_info(spec->id, true); + break; + } + } /* The representor_id is UINT16_MAX for uplink. */ - fdb_tx = (attr->transfer && priv->representor_id != UINT16_MAX); + fdb_tx = (attr->transfer && + flow_source_vport_representor(priv, item_port_priv)); /* * When reg_c_preserve is set, metadata registers Cx preserve * their value even through packet duplication. diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h index 7b5fde4823..b8ffedddf7 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h @@ -1111,6 +1111,7 @@ struct mlx5_flow_workspace { uint32_t skip_matcher_reg:1; /* Indicates if need to skip matcher register in translate. */ uint32_t mark:1; /* Indicates if flow contains mark action. */ + uint32_t vport_meta_tag; /* Used for vport index match. */ }; struct mlx5_flow_split_info { @@ -1467,6 +1468,25 @@ mlx5_translate_tunnel_etypes(uint64_t pattern_flags) return 0; } +/** + * Indicates whether flow source vport is representor port. + * + * @param[in] priv + * Pointer to device private context structure. + * @param[in] act_priv + * Pointer to actual device private context structure if have. + * + * @return + * True when the flow source vport is representor port, false otherwise. + */ +static inline bool +flow_source_vport_representor(struct mlx5_priv *priv, struct mlx5_priv *act_priv) +{ + MLX5_ASSERT(priv); + return (!act_priv ? (priv->representor_id != UINT16_MAX) : + (act_priv->representor_id != UINT16_MAX)); +} + int mlx5_flow_group_to_table(struct rte_eth_dev *dev, const struct mlx5_flow_tunnel *tunnel, uint32_t group, uint32_t *table, diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 4603736c28..7dfae06aae 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -2145,6 +2145,7 @@ flow_dv_validate_item_port_id(struct rte_eth_dev *dev, const struct rte_flow_item *item, const struct rte_flow_attr *attr, uint64_t item_flags, + struct mlx5_priv **act_priv, struct rte_flow_error *error) { const struct rte_flow_item_port_id *spec = item->spec; @@ -2203,6 +2204,7 @@ flow_dv_validate_item_port_id(struct rte_eth_dev *dev, RTE_FLOW_ERROR_TYPE_ITEM_SPEC, spec, "cannot match on a port from a" " different E-Switch"); + *act_priv = esw_priv; return 0; } @@ -2722,30 +2724,12 @@ flow_dv_validate_action_pop_vlan(struct rte_eth_dev *dev, struct rte_flow_error *error) { const struct mlx5_priv *priv = dev->data->dev_private; - struct mlx5_dev_ctx_shared *sh = priv->sh; - bool direction_error = false; if (!priv->sh->pop_vlan_action) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, "pop vlan action is not supported"); - /* Pop VLAN is not supported in egress except for CX6 FDB mode. */ - if (attr->transfer) { - bool fdb_tx = priv->representor_id != UINT16_MAX; - bool is_cx5 = sh->steering_format_version == - MLX5_STEERING_LOGIC_FORMAT_CONNECTX_5; - - if (fdb_tx && is_cx5) - direction_error = true; - } else if (attr->egress) { - direction_error = true; - } - if (direction_error) - return rte_flow_error_set(error, ENOTSUP, - RTE_FLOW_ERROR_TYPE_ATTR_EGRESS, - NULL, - "pop vlan action not supported for egress"); if (action_flags & MLX5_FLOW_VLAN_ACTIONS) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION, action, @@ -5568,6 +5552,7 @@ flow_dv_validate_action_sample(uint64_t *action_flags, const struct rte_flow_action_rss **sample_rss, const struct rte_flow_action_count **count, int *fdb_mirror_limit, + struct mlx5_priv *act_priv, struct rte_flow_error *error) { struct mlx5_priv *priv = dev->data->dev_private; @@ -5755,7 +5740,7 @@ flow_dv_validate_action_sample(uint64_t *action_flags, "E-Switch must has a dest " "port for mirroring"); if (!priv->config.hca_attr.reg_c_preserve && - priv->representor_id != UINT16_MAX) + flow_source_vport_representor(priv, act_priv)) *fdb_mirror_limit = 1; } /* Continue validation for Xcap actions.*/ @@ -6913,6 +6898,7 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, uint32_t tag_id = 0; const struct rte_flow_action_age *non_shared_age = NULL; const struct rte_flow_action_count *count = NULL; + struct mlx5_priv *act_priv = NULL; if (items == NULL) return -1; @@ -6954,7 +6940,7 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, break; case RTE_FLOW_ITEM_TYPE_PORT_ID: ret = flow_dv_validate_item_port_id - (dev, items, attr, item_flags, error); + (dev, items, attr, item_flags, &act_priv, error); if (ret < 0) return ret; last_item = MLX5_FLOW_ITEM_PORT_ID; @@ -7817,6 +7803,7 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, rss, &sample_rss, &sample_count, &fdb_mirror_limit, + act_priv, error); if (ret < 0) return ret; @@ -7987,7 +7974,7 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, bool direction_error = false; if (attr->transfer) { - bool fdb_tx = priv->representor_id != UINT16_MAX; + bool fdb_tx = flow_source_vport_representor(priv, act_priv); bool is_cx5 = sh->steering_format_version == MLX5_STEERING_LOGIC_FORMAT_CONNECTX_5; @@ -8019,6 +8006,27 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, "multiple VLAN actions"); } } + /* Pop VLAN is not supported in egress except for NICs newer than CX5. */ + if (action_flags & MLX5_FLOW_ACTION_OF_POP_VLAN) { + struct mlx5_dev_ctx_shared *sh = priv->sh; + bool direction_error = false; + + if (attr->transfer) { + bool fdb_tx = flow_source_vport_representor(priv, act_priv); + bool is_cx5 = sh->steering_format_version == + MLX5_STEERING_LOGIC_FORMAT_CONNECTX_5; + + if (fdb_tx && is_cx5) + direction_error = true; + } else if (attr->egress) { + direction_error = true; + } + if (direction_error) + return rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_ATTR_EGRESS, + NULL, + "pop vlan action not supported for egress"); + } if (action_flags & MLX5_FLOW_ACTION_METER_WITH_TERMINATED_POLICY) { if ((action_flags & (MLX5_FLOW_FATE_ACTIONS & ~MLX5_FLOW_ACTION_METER_WITH_TERMINATED_POLICY)) && @@ -8137,6 +8145,7 @@ flow_dv_prepare(struct rte_eth_dev *dev, wks->skip_matcher_reg = 0; wks->policy = NULL; wks->final_policy = NULL; + wks->vport_meta_tag = 0; /* In case of corrupting the memory. */ if (wks->flow_idx >= MLX5_NUM_MAX_DEV_FLOWS) { rte_flow_error_set(error, ENOSPC, @@ -9761,9 +9770,11 @@ flow_dv_translate_item_port_id(struct rte_eth_dev *dev, void *matcher, { const struct rte_flow_item_port_id *pid_m = item ? item->mask : NULL; const struct rte_flow_item_port_id *pid_v = item ? item->spec : NULL; + struct mlx5_flow_workspace *wks = mlx5_flow_get_thread_workspace(); struct mlx5_priv *priv; uint16_t mask, id; + MLX5_ASSERT(wks); if (pid_v && pid_v->id == MLX5_PORT_ESW_MGR) { flow_dv_translate_item_source_vport(matcher, key, mlx5_flow_get_esw_manager_vport_id(dev), 0xffff); @@ -9780,6 +9791,7 @@ flow_dv_translate_item_port_id(struct rte_eth_dev *dev, void *matcher, * register. */ if (priv->vport_meta_mask) { + wks->vport_meta_tag = priv->vport_meta_tag; /* * Provide the hint for SW steering library * to insert the flow into ingress domain and @@ -11827,6 +11839,9 @@ flow_dv_translate_action_sample(struct rte_eth_dev *dev, uint32_t action_in[MLX5_ST_SZ_DW(set_action_in)]; uint64_t set_action; } action_ctx = { .set_action = 0 }; + uint32_t vport_meta_tag = wks->vport_meta_tag ? + wks->vport_meta_tag : + priv->vport_meta_tag; res->ft_type = MLX5DV_FLOW_TABLE_TYPE_FDB; MLX5_SET(set_action_in, action_ctx.action_in, action_type, @@ -11834,7 +11849,7 @@ flow_dv_translate_action_sample(struct rte_eth_dev *dev, MLX5_SET(set_action_in, action_ctx.action_in, field, MLX5_MODI_META_REG_C_0); MLX5_SET(set_action_in, action_ctx.action_in, data, - priv->vport_meta_tag); + vport_meta_tag); res->set_action = action_ctx.set_action; } else if (attr->ingress) { res->ft_type = MLX5DV_FLOW_TABLE_TYPE_NIC_RX; -- 2.18.1