From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, Yevgeny Kliteynik <kliteyn@nvidia.com>,
Alex Vesker <valex@nvidia.com>,
Saeed Mahameed <saeedm@nvidia.com>
Subject: [net-next 04/16] net/mlx5: DR, Rename list field in matcher struct to list_node
Date: Tue, 28 Dec 2021 22:24:50 -0800 [thread overview]
Message-ID: <20211229062502.24111-5-saeed@kernel.org> (raw)
In-Reply-To: <20211229062502.24111-1-saeed@kernel.org>
From: Yevgeny Kliteynik <kliteyn@nvidia.com>
In dr_types structs, some list fields are list heads, and some
are just list nodes that are stored on the other structs' lists.
Rename the appropriate list field to reflect this distinction.
Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: Alex Vesker <valex@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
.../mellanox/mlx5/core/steering/dr_matcher.c | 26 +++++++++----------
.../mellanox/mlx5/core/steering/dr_table.c | 2 +-
.../mellanox/mlx5/core/steering/dr_types.h | 2 +-
3 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_matcher.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_matcher.c
index 613074d50212..af2cbbb6ef95 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_matcher.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_matcher.c
@@ -721,7 +721,7 @@ static int dr_matcher_add_to_tbl(struct mlx5dr_matcher *matcher)
int ret;
next_matcher = NULL;
- list_for_each_entry(tmp_matcher, &tbl->matcher_list, matcher_list) {
+ list_for_each_entry(tmp_matcher, &tbl->matcher_list, list_node) {
if (tmp_matcher->prio >= matcher->prio) {
next_matcher = tmp_matcher;
break;
@@ -731,11 +731,11 @@ static int dr_matcher_add_to_tbl(struct mlx5dr_matcher *matcher)
prev_matcher = NULL;
if (next_matcher && !first)
- prev_matcher = list_prev_entry(next_matcher, matcher_list);
+ prev_matcher = list_prev_entry(next_matcher, list_node);
else if (!first)
prev_matcher = list_last_entry(&tbl->matcher_list,
struct mlx5dr_matcher,
- matcher_list);
+ list_node);
if (dmn->type == MLX5DR_DOMAIN_TYPE_FDB ||
dmn->type == MLX5DR_DOMAIN_TYPE_NIC_RX) {
@@ -756,12 +756,12 @@ static int dr_matcher_add_to_tbl(struct mlx5dr_matcher *matcher)
}
if (prev_matcher)
- list_add(&matcher->matcher_list, &prev_matcher->matcher_list);
+ list_add(&matcher->list_node, &prev_matcher->list_node);
else if (next_matcher)
- list_add_tail(&matcher->matcher_list,
- &next_matcher->matcher_list);
+ list_add_tail(&matcher->list_node,
+ &next_matcher->list_node);
else
- list_add(&matcher->matcher_list, &tbl->matcher_list);
+ list_add(&matcher->list_node, &tbl->matcher_list);
return 0;
}
@@ -968,7 +968,7 @@ mlx5dr_matcher_create(struct mlx5dr_table *tbl,
matcher->prio = priority;
matcher->match_criteria = match_criteria_enable;
refcount_set(&matcher->refcount, 1);
- INIT_LIST_HEAD(&matcher->matcher_list);
+ INIT_LIST_HEAD(&matcher->list_node);
mlx5dr_domain_lock(tbl->dmn);
@@ -1031,15 +1031,15 @@ static int dr_matcher_remove_from_tbl(struct mlx5dr_matcher *matcher)
struct mlx5dr_domain *dmn = tbl->dmn;
int ret = 0;
- if (list_is_last(&matcher->matcher_list, &tbl->matcher_list))
+ if (list_is_last(&matcher->list_node, &tbl->matcher_list))
next_matcher = NULL;
else
- next_matcher = list_next_entry(matcher, matcher_list);
+ next_matcher = list_next_entry(matcher, list_node);
- if (matcher->matcher_list.prev == &tbl->matcher_list)
+ if (matcher->list_node.prev == &tbl->matcher_list)
prev_matcher = NULL;
else
- prev_matcher = list_prev_entry(matcher, matcher_list);
+ prev_matcher = list_prev_entry(matcher, list_node);
if (dmn->type == MLX5DR_DOMAIN_TYPE_FDB ||
dmn->type == MLX5DR_DOMAIN_TYPE_NIC_RX) {
@@ -1059,7 +1059,7 @@ static int dr_matcher_remove_from_tbl(struct mlx5dr_matcher *matcher)
return ret;
}
- list_del(&matcher->matcher_list);
+ list_del(&matcher->list_node);
return 0;
}
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_table.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_table.c
index 30ae3cda6d2e..4c40178e7d1e 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_table.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_table.c
@@ -19,7 +19,7 @@ int mlx5dr_table_set_miss_action(struct mlx5dr_table *tbl,
if (!list_empty(&tbl->matcher_list))
last_matcher = list_last_entry(&tbl->matcher_list,
struct mlx5dr_matcher,
- matcher_list);
+ list_node);
if (tbl->dmn->type == MLX5DR_DOMAIN_TYPE_NIC_RX ||
tbl->dmn->type == MLX5DR_DOMAIN_TYPE_FDB) {
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h
index 75bfdd7890da..a19b40a6e813 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h
@@ -881,7 +881,7 @@ struct mlx5dr_matcher {
struct mlx5dr_table *tbl;
struct mlx5dr_matcher_rx_tx rx;
struct mlx5dr_matcher_rx_tx tx;
- struct list_head matcher_list;
+ struct list_head list_node;
u32 prio;
struct mlx5dr_match_param mask;
u8 match_criteria;
--
2.33.1
next prev parent reply other threads:[~2021-12-29 6:25 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-29 6:24 [pull request][net-next 00/16] mlx5 updates 2021-12-28 Saeed Mahameed
2021-12-29 6:24 ` [net-next 01/16] net/mlx5: DR, Fix error flow in creating matcher Saeed Mahameed
2021-12-29 6:24 ` [net-next 02/16] net/mlx5: DR, Fix lower case macro prefix "mlx5_" to "MLX5_" Saeed Mahameed
2021-12-29 6:24 ` [net-next 03/16] net/mlx5: DR, Remove unused struct member in matcher Saeed Mahameed
2021-12-29 6:24 ` Saeed Mahameed [this message]
2021-12-29 6:24 ` [net-next 05/16] net/mlx5: DR, Add check for flex parser ID value Saeed Mahameed
2021-12-29 6:24 ` [net-next 06/16] net/mlx5: DR, Add missing reserved fields to dr_match_param Saeed Mahameed
2021-12-29 6:24 ` [net-next 07/16] net/mlx5: DR, Add support for dumping steering info Saeed Mahameed
2021-12-30 2:16 ` Jakub Kicinski
2021-12-31 1:49 ` Yevgeny Kliteynik
2021-12-31 2:09 ` Jakub Kicinski
2022-01-02 10:18 ` Yevgeny Kliteynik
2021-12-29 6:24 ` [net-next 08/16] net/mlx5: DR, Add support for UPLINK destination type Saeed Mahameed
2021-12-29 6:24 ` [net-next 09/16] net/mlx5: DR, Warn on failure to destroy objects due to refcount Saeed Mahameed
2021-12-29 6:24 ` [net-next 10/16] net/mlx5: Add misc5 flow table match parameters Saeed Mahameed
2021-12-29 6:24 ` [net-next 11/16] net/mlx5: DR, Add misc5 to match_param structs Saeed Mahameed
2021-12-29 6:24 ` [net-next 12/16] net/mlx5: DR, Support matching on tunnel headers 0 and 1 Saeed Mahameed
2021-12-29 6:24 ` [net-next 13/16] net/mlx5: DR, Add support for matching on geneve_tlv_option_0_exist field Saeed Mahameed
2021-12-29 6:25 ` [net-next 14/16] net/mlx5: DR, Improve steering for empty or RX/TX-only matchers Saeed Mahameed
2021-12-29 6:25 ` [net-next 15/16] net/mlx5: DR, Ignore modify TTL if device doesn't support it Saeed Mahameed
2021-12-29 6:25 ` [net-next 16/16] net/mlx5: Set SMFS as a default steering mode if device supports it Saeed Mahameed
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=20211229062502.24111-5-saeed@kernel.org \
--to=saeed@kernel.org \
--cc=davem@davemloft.net \
--cc=kliteyn@nvidia.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=saeedm@nvidia.com \
--cc=valex@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).