From: Itamar Gozlan <igozlan@nvidia.com>
To: <igozlan@nvidia.com>, <erezsh@nvidia.com>, <hamdani@nvidia.com>,
<kliteyn@nvidia.com>, <viacheslavo@nvidia.com>,
<thomas@monjalon.net>, <suanmingm@nvidia.com>,
Dariusz Sosnowski <dsosnowski@nvidia.com>,
Ori Kam <orika@nvidia.com>, Matan Azrad <matan@nvidia.com>,
Alex Vesker <valex@nvidia.com>
Cc: <dev@dpdk.org>
Subject: [v2 01/10] net/mlx5/hws: skip RTE item when inserting rules by index
Date: Sun, 18 Feb 2024 07:11:15 +0200 [thread overview]
Message-ID: <20240218051125.717011-1-igozlan@nvidia.com> (raw)
In-Reply-To: <20240213095038.451299-9-igozlan@nvidia.com>
The location of indexed rules is determined by the index, not the item
hash. A matcher test is added to prevent access to non-existent items.
This avoids unnecessary processing and potential segmentation faults.
Fixes: 405242c ("net/mlx5/hws: add rule object")
Signed-off-by: Itamar Gozlan <igozlan@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
drivers/net/mlx5/hws/mlx5dr_rule.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/mlx5/hws/mlx5dr_rule.c b/drivers/net/mlx5/hws/mlx5dr_rule.c
index fa19303b91..e39137a6ee 100644
--- a/drivers/net/mlx5/hws/mlx5dr_rule.c
+++ b/drivers/net/mlx5/hws/mlx5dr_rule.c
@@ -23,6 +23,9 @@ static void mlx5dr_rule_skip(struct mlx5dr_matcher *matcher,
*skip_rx = false;
*skip_tx = false;
+ if (unlikely(mlx5dr_matcher_is_insert_by_idx(matcher)))
+ return;
+
if (mt->item_flags & MLX5_FLOW_ITEM_REPRESENTED_PORT) {
v = items[mt->vport_item_id].spec;
vport = flow_hw_conv_port_id(v->port_id);
--
2.39.3
next prev parent reply other threads:[~2024-02-18 5:11 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-13 9:50 [PATCH 1/9] " Itamar Gozlan
2024-02-13 9:50 ` [PATCH 2/9] net/mlx5/hws: add check for not supported fields in VXLAN Itamar Gozlan
2024-02-13 9:50 ` [PATCH 3/9] net/mlx5/hws: add support for resizable matchers Itamar Gozlan
2024-02-13 9:50 ` [PATCH 4/9] net/mlx5/hws: reordering the STE fields to improve hash Itamar Gozlan
2024-02-13 9:50 ` [PATCH 5/9] net/mlx5/hws: check the rule status on rule update Itamar Gozlan
2024-02-13 9:50 ` [PATCH 6/9] net/mlx5/hws: fix VLAN item handling on non relaxed mode Itamar Gozlan
2024-02-13 9:50 ` [PATCH 7/9] net/mlx5/hws: extend action template creation API Itamar Gozlan
2024-02-13 9:50 ` [PATCH 8/9] net/mlx5/hws: add missing actions STE limitation Itamar Gozlan
2024-02-13 9:50 ` [PATCH 9/9] net/mlx5/hws: support push_esp flag for insert header action Itamar Gozlan
2024-02-18 5:11 ` Itamar Gozlan [this message]
2024-02-18 5:11 ` [v2 02/10] net/mlx5/hws: add check for not supported fields in VXLAN Itamar Gozlan
2024-02-18 5:11 ` [v2 03/10] net/mlx5/hws: add support for resizable matchers Itamar Gozlan
2024-02-18 5:11 ` [v2 04/10] net/mlx5/hws: reordering the STE fields to improve hash Itamar Gozlan
2024-02-18 5:11 ` [v2 05/10] net/mlx5/hws: check the rule status on rule update Itamar Gozlan
2024-02-18 5:11 ` [v2 06/10] net/mlx5/hws: fix VLAN item handling on non relaxed mode Itamar Gozlan
2024-02-18 5:11 ` [v2 07/10] net/mlx5/hws: extend action template creation API Itamar Gozlan
2024-02-18 5:11 ` [v2 08/10] net/mlx5/hws: add missing actions STE limitation Itamar Gozlan
2024-02-18 5:11 ` [v2 09/10] net/mlx5/hws: support push_esp flag for insert header action Itamar Gozlan
2024-02-18 5:11 ` [v2 10/10] net/mlx5/hws: typo fix parm to param Itamar Gozlan
2024-02-26 10:16 ` [v2 01/10] net/mlx5/hws: skip RTE item when inserting rules by index Raslan Darawsheh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240218051125.717011-1-igozlan@nvidia.com \
--to=igozlan@nvidia.com \
--cc=dev@dpdk.org \
--cc=dsosnowski@nvidia.com \
--cc=erezsh@nvidia.com \
--cc=hamdani@nvidia.com \
--cc=kliteyn@nvidia.com \
--cc=matan@nvidia.com \
--cc=orika@nvidia.com \
--cc=suanmingm@nvidia.com \
--cc=thomas@monjalon.net \
--cc=valex@nvidia.com \
--cc=viacheslavo@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).