]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net/mlx5: HWS, Export rule skip logic
authorVlad Dogaru <vdogaru@nvidia.com>
Thu, 3 Jul 2025 18:54:24 +0000 (21:54 +0300)
committerJakub Kicinski <kuba@kernel.org>
Tue, 8 Jul 2025 02:12:16 +0000 (19:12 -0700)
The bwc layer will use `mlx5hws_rule_skip` to keep track of numbers of
RX and TX rules individually, so export this function for future usage.

Signed-off-by: Vlad Dogaru <vdogaru@nvidia.com>
Reviewed-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250703185431.445571-4-mbloch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/rule.c
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/rule.h

index 5342a4cc7194235a998144912bb679d288040e87..4883e4e1d2518bea5db9fd66d5ed19c2432d2943 100644 (file)
@@ -3,10 +3,8 @@
 
 #include "internal.h"
 
-static void hws_rule_skip(struct mlx5hws_matcher *matcher,
-                         struct mlx5hws_match_template *mt,
-                         u32 flow_source,
-                         bool *skip_rx, bool *skip_tx)
+void mlx5hws_rule_skip(struct mlx5hws_matcher *matcher, u32 flow_source,
+                      bool *skip_rx, bool *skip_tx)
 {
        /* By default FDB rules are added to both RX and TX */
        *skip_rx = false;
@@ -66,7 +64,8 @@ static void hws_rule_init_dep_wqe(struct mlx5hws_send_ring_dep_wqe *dep_wqe,
                                attr->rule_idx : 0;
 
        if (tbl->type == MLX5HWS_TABLE_TYPE_FDB) {
-               hws_rule_skip(matcher, mt, attr->flow_source, &skip_rx, &skip_tx);
+               mlx5hws_rule_skip(matcher, attr->flow_source,
+                                 &skip_rx, &skip_tx);
 
                if (!skip_rx) {
                        dep_wqe->rtc_0 = matcher->match_ste.rtc_0_id;
index 1c47a9c11572a9121244bc69df2d8d60461c3667..d0f082b8dbf51b9bc07f932cbe66a87d5c10e266 100644 (file)
@@ -69,6 +69,9 @@ struct mlx5hws_rule {
                           */
 };
 
+void mlx5hws_rule_skip(struct mlx5hws_matcher *matcher, u32 flow_source,
+                      bool *skip_rx, bool *skip_tx);
+
 void mlx5hws_rule_free_action_ste(struct mlx5hws_action_ste_chunk *action_ste);
 
 int mlx5hws_rule_move_hws_remove(struct mlx5hws_rule *rule,