On 5/10/24 12:06 PM, Eelco Chaudron wrote:
On 24 Apr 2024, at 21:53, Adrian Moreno wrote:

In preparation to allowing certain actions to have a cookie that does
not represent the entire flow, rename flower->act_cookie to
flower->flow_cookie.

This patch does not introduce any behavioral change, it's just a
variable renaming.

Small nit on the comment below, the rest looks good.

//Eelco

Signed-off-by: Adrian Moreno <[email protected]>
---
  lib/netdev-offload-tc.c |  8 ++++----
  lib/tc.c                | 14 +++++++-------
  lib/tc.h                |  2 +-
  3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c
index 921d52317..36e814bee 100644
--- a/lib/netdev-offload-tc.c
+++ b/lib/netdev-offload-tc.c
@@ -1322,8 +1322,8 @@ netdev_tc_flow_dump_next(struct netdev_flow_dump *dump,
              continue;
          }

-        if (flower.act_cookie.len >= sizeof *ufid) {
-            *ufid = get_32aligned_u128(flower.act_cookie.data);
+        if (flower.flow_cookie.len >= sizeof *ufid) {
+            *ufid = get_32aligned_u128(flower.flow_cookie.data);
          } else if (!find_ufid(netdev, &id, ufid)) {
              continue;
          }
@@ -2537,8 +2537,8 @@ netdev_tc_flow_put(struct netdev *netdev, struct match 
*match,
          return ENOSPC;
      }

-    flower.act_cookie.data = ufid;
-    flower.act_cookie.len = sizeof *ufid;
+    flower.flow_cookie.data = ufid;
+    flower.flow_cookie.len = sizeof *ufid;

      block_id = get_block_id_from_netdev(netdev);
      id = tc_make_tcf_id_chain(ifindex, block_id, chain, prio, hook);
diff --git a/lib/tc.c b/lib/tc.c
index e9bcae4e4..7176991c3 100644
--- a/lib/tc.c
+++ b/lib/tc.c
@@ -2088,8 +2088,8 @@ nl_parse_single_action(struct nlattr *action, struct 
tc_flower *flower,
      }

      if (act_cookie) {
-        flower->act_cookie.data = nl_attr_get(act_cookie);
-        flower->act_cookie.len = nl_attr_get_size(act_cookie);
+        flower->flow_cookie.data = nl_attr_get(act_cookie);
+        flower->flow_cookie.len = nl_attr_get_size(act_cookie);
      }

      return nl_parse_action_stats(action_attrs[TCA_ACT_STATS],
@@ -3458,7 +3458,7 @@ nl_msg_put_flower_acts(struct ofpbuf *request, struct 
tc_flower *flower)
                                                TCA_EGRESS_MIRROR);
                      }
                  }
-                nl_msg_put_act_cookie(request, &flower->act_cookie);
+                nl_msg_put_act_cookie(request, &flower->flow_cookie);
                  nl_msg_put_act_flags(request);
                  nl_msg_end_nested(request, act_offset);
              }
@@ -3476,14 +3476,14 @@ nl_msg_put_flower_acts(struct ofpbuf *request, struct 
tc_flower *flower)

                  act_offset = nl_msg_start_nested(request, act_index++);
                  nl_msg_put_act_gact(request, action->chain);
-                nl_msg_put_act_cookie(request, &flower->act_cookie);
+                nl_msg_put_act_cookie(request, &flower->flow_cookie);
                  nl_msg_end_nested(request, act_offset);
              }
              break;
              case TC_ACT_CT: {
                  act_offset = nl_msg_start_nested(request, act_index++);
                  nl_msg_put_act_ct(request, action, action_pc);
-                nl_msg_put_act_cookie(request, &flower->act_cookie);
+                nl_msg_put_act_cookie(request, &flower->flow_cookie);
                  nl_msg_end_nested(request, act_offset);
              }
              break;
@@ -3501,7 +3501,7 @@ nl_msg_put_flower_acts(struct ofpbuf *request, struct 
tc_flower *flower)
                                                released)) {
                      return -EOPNOTSUPP;
                  }
-                nl_msg_put_act_cookie(request, &flower->act_cookie);
+                nl_msg_put_act_cookie(request, &flower->flow_cookie);
                  nl_msg_put_act_flags(request);
                  nl_msg_end_nested(request, act_offset);
              }
@@ -3515,7 +3515,7 @@ nl_msg_put_flower_acts(struct ofpbuf *request, struct 
tc_flower *flower)
      if (!flower->action_count) {
          act_offset = nl_msg_start_nested(request, act_index++);
          nl_msg_put_act_gact(request, 0);
-        nl_msg_put_act_cookie(request, &flower->act_cookie);
+        nl_msg_put_act_cookie(request, &flower->flow_cookie);
          nl_msg_put_act_flags(request);
          nl_msg_end_nested(request, act_offset);
      }
diff --git a/lib/tc.h b/lib/tc.h
index fdbcf4b7c..40ea3d816 100644
--- a/lib/tc.h
+++ b/lib/tc.h
@@ -386,7 +386,7 @@ struct tc_flower {

      bool tunnel;

-    struct tc_cookie act_cookie;
+    struct tc_cookie flow_cookie; /* Cookie to help identify the flow. */

nit: Cookie that identifies the flow by ufid.


OK.


      bool needs_full_ip_proto_mask;

--
2.44.0


_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to