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 3CD154569C for ; Wed, 24 Jul 2024 13:34:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3712642F01; Wed, 24 Jul 2024 13:34:03 +0200 (CEST) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by mails.dpdk.org (Postfix) with ESMTP id 1B55642F01 for ; Wed, 24 Jul 2024 13:34:02 +0200 (CEST) Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4266f535e82so48630455e9.1 for ; Wed, 24 Jul 2024 04:34:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721820842; x=1722425642; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NWK6AU4GDNVxm6wSV8a/Vy2SJHMsxhKyIBmzclbWg/U=; b=h2g0PdLAaTjrW4fuFvUL/yBJzUQf5iryLOQVlyeECy4y+KuGw/Tu/VomTCR1TIFzpw 67hJyiM+8xnMGM/zn2NxtJ2pjZKXgt7YujDZD2Bkac2wT86YjnzGDIZIo8FlDRu6ntqD yx3lObqxXf2qEQcYMMj1aZiewLsYPSQa9tNk3HfETtSlVqrQyVeetGDNfEWE9GoCr30Q mBCESqkjzomJDv5X/4iNx/6+G1yF7FjuuIaysIVhdPKadh4TAufn/tmY5uwtZgk1C+u9 PGcOPqxToOehVrEbsSO60sytCYYV1BsFUMvQkHBO3J5AmMWmWbODF8lM7ESX7Gk6yjQZ l5MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721820842; x=1722425642; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NWK6AU4GDNVxm6wSV8a/Vy2SJHMsxhKyIBmzclbWg/U=; b=uc69YSPtk6+nmz0kKQq2dxLkkqWv7pBybjlg2EmMuUt1n2nZD59zwUhI5umE750u9t x+jsTBUZnH001KkXE6ehI+wPP9d/0M+pX+mkS2gvw/PaZ7Ms+DTLkAH3VNba4UKW3Bmj CHiXzQuzVtgeIi1ypH8DmICIy0kxYNFMvuLjTAzVDTV597EUJuZbYc7df1Y/m+QwNgo3 rPfEPJwS4z62GZM5i9BDK8UOpKOtNhLQ2FO6C0KzVdvrzZf2Gvzh6pTnT+0NGjSlMsLk L7+ClScqc4hw1Lhp2kM0B4hINi6RLxM0ggASLGIon0kvgq/qFXp8dJz+ZBoeQ7DprWmA XhNw== X-Forwarded-Encrypted: i=1; AJvYcCU0/IHWsqhHVYLUInQDlIqKo97wzczBpG6MyxFSo6GNMcseQ+aNS24IlmnFCmrTw9uTnCTKiQfEoeAaqYjuIRc= X-Gm-Message-State: AOJu0Yyx0WuebPG3+0KO1tlZwSQGAukNpOgqRDvStb14N5kb3x2j9sR8 or9qSFolrM9Tk49faM7E1fpbLwUnUNPFh/pNQuPQ2vPXMeZ1DyKdW5M/UWgS X-Google-Smtp-Source: AGHT+IGcyJTNako0+MS6J0r5qeJ6kEyDynkP6fVhbHMxStnd50kZLfxZ4vPonbhIuH6myUdRLZ1+uQ== X-Received: by 2002:adf:e7ce:0:b0:368:5bb4:169b with SMTP id ffacd0b85a97d-369bae238e6mr8835316f8f.4.1721820841558; Wed, 24 Jul 2024 04:34:01 -0700 (PDT) Received: from localhost ([137.220.120.171]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-368786847e6sm14124845f8f.18.2024.07.24.04.34.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jul 2024 04:34:01 -0700 (PDT) From: luca.boccassi@gmail.com To: Alex Vesker Cc: Matan Azrad , dpdk stable Subject: patch 'net/mlx5/hws: fix port ID on root item convert' has been queued to stable release 22.11.6 Date: Wed, 24 Jul 2024 12:32:52 +0100 Message-Id: <20240724113318.616754-14-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240724113318.616754-1-luca.boccassi@gmail.com> References: <20240715152704.2229503-86-luca.boccassi@gmail.com> <20240724113318.616754-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Hi, FYI, your patch has been queued to stable release 22.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/26/24. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/fdf5a81ff78917f9d3ffb713a1fb7deedb92dfdb Thanks. Luca Boccassi --- >From fdf5a81ff78917f9d3ffb713a1fb7deedb92dfdb Mon Sep 17 00:00:00 2001 From: Alex Vesker Date: Tue, 9 Jul 2024 15:31:00 +0300 Subject: [PATCH] net/mlx5/hws: fix port ID on root item convert [ upstream commit befb138bdd924956375745cb1ae8fe3fd029902f ] When calling item convert function we need to pass the port_id in the attributes. This value should be passed not only for cases that match on PORT related items, to resolve we will always pass it. Fixes: 572fe9ef2f46 ("net/mlx5/hws: fix port ID for root table") Signed-off-by: Alex Vesker Acked-by: Matan Azrad --- drivers/net/mlx5/hws/mlx5dr_matcher.c | 20 +++++--------------- drivers/net/mlx5/hws/mlx5dr_rule.c | 21 +++++---------------- 2 files changed, 10 insertions(+), 31 deletions(-) diff --git a/drivers/net/mlx5/hws/mlx5dr_matcher.c b/drivers/net/mlx5/hws/mlx5dr_matcher.c index c54bf88e78..e89ebb657a 100644 --- a/drivers/net/mlx5/hws/mlx5dr_matcher.c +++ b/drivers/net/mlx5/hws/mlx5dr_matcher.c @@ -711,7 +711,6 @@ static int mlx5dr_matcher_init_root(struct mlx5dr_matcher *matcher) struct mlx5dv_flow_match_parameters *mask; struct mlx5_flow_attr flow_attr = {0}; struct rte_flow_error rte_error; - struct rte_flow_item *item; uint8_t match_criteria; int ret; @@ -740,20 +739,11 @@ static int mlx5dr_matcher_init_root(struct mlx5dr_matcher *matcher) return rte_errno; } - /* We need the port id in case of matching representor */ - item = matcher->mt[0]->items; - while (item->type != RTE_FLOW_ITEM_TYPE_END) { - if (item->type == RTE_FLOW_ITEM_TYPE_PORT_REPRESENTOR || - item->type == RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT) { - ret = flow_hw_get_port_id_from_ctx(ctx, &flow_attr.port_id); - if (ret) { - DR_LOG(ERR, "Failed to get port id for dev %s", - ctx->ibv_ctx->device->name); - rte_errno = EINVAL; - return rte_errno; - } - } - ++item; + ret = flow_hw_get_port_id_from_ctx(ctx, &flow_attr.port_id); + if (ret) { + DR_LOG(ERR, "Failed to get port id for dev %s", ctx->ibv_ctx->device->name); + rte_errno = EINVAL; + return rte_errno; } mask = simple_calloc(1, MLX5_ST_SZ_BYTES(fte_match_param) + diff --git a/drivers/net/mlx5/hws/mlx5dr_rule.c b/drivers/net/mlx5/hws/mlx5dr_rule.c index 885a2bcefe..00b6c49b88 100644 --- a/drivers/net/mlx5/hws/mlx5dr_rule.c +++ b/drivers/net/mlx5/hws/mlx5dr_rule.c @@ -382,26 +382,15 @@ static int mlx5dr_rule_create_root(struct mlx5dr_rule *rule, struct mlx5dv_flow_match_parameters *value; struct mlx5_flow_attr flow_attr = {0}; struct mlx5dv_flow_action_attr *attr; - const struct rte_flow_item *cur_item; struct rte_flow_error error; uint8_t match_criteria; int ret; - /* We need the port id in case of matching representor */ - cur_item = items; - while (cur_item->type != RTE_FLOW_ITEM_TYPE_END) { - if (cur_item->type == RTE_FLOW_ITEM_TYPE_PORT_REPRESENTOR || - cur_item->type == RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT) { - ret = flow_hw_get_port_id_from_ctx(rule->matcher->tbl->ctx, - &flow_attr.port_id); - if (ret) { - DR_LOG(ERR, "Failed to get port id for dev %s", - rule->matcher->tbl->ctx->ibv_ctx->device->name); - rte_errno = EINVAL; - return rte_errno; - } - } - ++cur_item; + ret = flow_hw_get_port_id_from_ctx(ctx, &flow_attr.port_id); + if (ret) { + DR_LOG(ERR, "Failed to get port id for dev %s", ctx->ibv_ctx->device->name); + rte_errno = EINVAL; + return rte_errno; } attr = simple_calloc(num_actions, sizeof(*attr)); -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-07-24 12:29:21.873226978 +0100 +++ 0014-net-mlx5-hws-fix-port-ID-on-root-item-convert.patch 2024-07-24 12:29:20.719025084 +0100 @@ -1 +1 @@ -From befb138bdd924956375745cb1ae8fe3fd029902f Mon Sep 17 00:00:00 2001 +From fdf5a81ff78917f9d3ffb713a1fb7deedb92dfdb Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit befb138bdd924956375745cb1ae8fe3fd029902f ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org @@ -17,2 +18,2 @@ - drivers/net/mlx5/hws/mlx5dr_rule.c | 22 ++++++---------------- - 2 files changed, 11 insertions(+), 31 deletions(-) + drivers/net/mlx5/hws/mlx5dr_rule.c | 21 +++++---------------- + 2 files changed, 10 insertions(+), 31 deletions(-) @@ -21 +22 @@ -index 6a939eb031..dfa2cd435c 100644 +index c54bf88e78..e89ebb657a 100644 @@ -24 +25 @@ -@@ -1231,7 +1231,6 @@ static int mlx5dr_matcher_init_root(struct mlx5dr_matcher *matcher) +@@ -711,7 +711,6 @@ static int mlx5dr_matcher_init_root(struct mlx5dr_matcher *matcher) @@ -32 +33 @@ -@@ -1260,20 +1259,11 @@ static int mlx5dr_matcher_init_root(struct mlx5dr_matcher *matcher) +@@ -740,20 +739,11 @@ static int mlx5dr_matcher_init_root(struct mlx5dr_matcher *matcher) @@ -37 +38 @@ -- item = matcher->mt[0].items; +- item = matcher->mt[0]->items; @@ -59 +60 @@ -index 06d8e66f63..1edb7eac74 100644 +index 885a2bcefe..00b6c49b88 100644 @@ -62,5 +63 @@ -@@ -694,29 +694,19 @@ int mlx5dr_rule_create_root_no_comp(struct mlx5dr_rule *rule, - struct mlx5dr_rule_action rule_actions[]) - { - struct mlx5dv_flow_matcher *dv_matcher = rule->matcher->dv_matcher; -+ struct mlx5dr_context *ctx = rule->matcher->tbl->ctx; +@@ -382,26 +382,15 @@ static int mlx5dr_rule_create_root(struct mlx5dr_rule *rule,