diff mbox series

[ovs-dev,ovn,3/7] actions: Rename xxx_lookup_mac to xxx_lookup_mac_bind.

Message ID 1595481999-121310-4-git-send-email-hzhou@ovn.org
State Accepted
Headers show
Series Avoid ARP flow explosion. | expand

Commit Message

Han Zhou July 23, 2020, 5:26 a.m. UTC
For the functions related to lookup_arp/lookup_nd, renaming them to
avoid confusion, because those functions checks both mac and ip in
mac-bindings. This patch renames them so that a future patch can
add a function that only looks up by ip without confusing names.

This patch also removes the unnecessary OVS_UNUSED for the function
execute_lookup_mac() in ovn-trace.c.

Signed-off-by: Han Zhou <hzhou@ovn.org>
---
 lib/actions.c         | 21 +++++++++++----------
 utilities/ovn-trace.c | 13 +++++++------
 2 files changed, 18 insertions(+), 16 deletions(-)

Comments

Numan Siddique July 29, 2020, 5:33 p.m. UTC | #1
On Thu, Jul 23, 2020 at 10:57 AM Han Zhou <hzhou@ovn.org> wrote:

> For the functions related to lookup_arp/lookup_nd, renaming them to
> avoid confusion, because those functions checks both mac and ip in
> mac-bindings. This patch renames them so that a future patch can
> add a function that only looks up by ip without confusing names.
>
> This patch also removes the unnecessary OVS_UNUSED for the function
> execute_lookup_mac() in ovn-trace.c.
>
> Signed-off-by: Han Zhou <hzhou@ovn.org>
>

Acked-by: Numan Siddique <numans@ovn.org>

Thanks
Numan


> ---
>  lib/actions.c         | 21 +++++++++++----------
>  utilities/ovn-trace.c | 13 +++++++------
>  2 files changed, 18 insertions(+), 16 deletions(-)
>
> diff --git a/lib/actions.c b/lib/actions.c
> index e14907e..82463fa 100644
> --- a/lib/actions.c
> +++ b/lib/actions.c
> @@ -1867,8 +1867,9 @@ ovnact_put_mac_bind_free(struct ovnact_put_mac_bind
> *put_mac OVS_UNUSED)
>  {
>  }
>
> -static void format_lookup_mac(const struct ovnact_lookup_mac_bind
> *lookup_mac,
> -                              struct ds *s, const char *name)
> +static void format_lookup_mac_bind(
> +    const struct ovnact_lookup_mac_bind *lookup_mac,
> +    struct ds *s, const char *name)
>  {
>      expr_field_format(&lookup_mac->dst, s);
>      ds_put_format(s, " = %s(", name);
> @@ -1884,21 +1885,21 @@ static void
>  format_LOOKUP_ARP(const struct ovnact_lookup_mac_bind *lookup_mac,
>                           struct ds *s)
>  {
> -    format_lookup_mac(lookup_mac, s, "lookup_arp");
> +    format_lookup_mac_bind(lookup_mac, s, "lookup_arp");
>  }
>
>  static void
>  format_LOOKUP_ND(const struct ovnact_lookup_mac_bind *lookup_mac,
>                          struct ds *s)
>  {
> -    format_lookup_mac(lookup_mac, s, "lookup_nd");
> +    format_lookup_mac_bind(lookup_mac, s, "lookup_nd");
>  }
>
>  static void
> -encode_lookup_mac(const struct ovnact_lookup_mac_bind *lookup_mac,
> -                  enum mf_field_id ip_field,
> -                  const struct ovnact_encode_params *ep,
> -                  struct ofpbuf *ofpacts)
> +encode_lookup_mac_bind(const struct ovnact_lookup_mac_bind *lookup_mac,
> +                       enum mf_field_id ip_field,
> +                       const struct ovnact_encode_params *ep,
> +                       struct ofpbuf *ofpacts)
>  {
>      const struct arg args[] = {
>          { expr_resolve_field(&lookup_mac->port), MFF_LOG_INPORT },
> @@ -1928,7 +1929,7 @@ encode_LOOKUP_ARP(const struct
> ovnact_lookup_mac_bind *lookup_mac,
>                    const struct ovnact_encode_params *ep,
>                    struct ofpbuf *ofpacts)
>  {
> -    encode_lookup_mac(lookup_mac, MFF_REG0, ep, ofpacts);
> +    encode_lookup_mac_bind(lookup_mac, MFF_REG0, ep, ofpacts);
>  }
>
>  static void
> @@ -1936,7 +1937,7 @@ encode_LOOKUP_ND(const struct ovnact_lookup_mac_bind
> *lookup_mac,
>                          const struct ovnact_encode_params *ep,
>                          struct ofpbuf *ofpacts)
>  {
> -    encode_lookup_mac(lookup_mac, MFF_XXREG0, ep, ofpacts);
> +    encode_lookup_mac_bind(lookup_mac, MFF_XXREG0, ep, ofpacts);
>  }
>
>  static void
> diff --git a/utilities/ovn-trace.c b/utilities/ovn-trace.c
> index de75088..2c432ac 100644
> --- a/utilities/ovn-trace.c
> +++ b/utilities/ovn-trace.c
> @@ -1746,10 +1746,10 @@ execute_get_mac_bind(const struct
> ovnact_get_mac_bind *bind,
>  }
>
>  static void
> -execute_lookup_mac(const struct ovnact_lookup_mac_bind *bind OVS_UNUSED,
> -                   const struct ovntrace_datapath *dp OVS_UNUSED,
> -                   struct flow *uflow OVS_UNUSED,
> -                   struct ovs_list *super OVS_UNUSED)
> +execute_lookup_mac_bind(const struct ovnact_lookup_mac_bind *bind,
> +                        const struct ovntrace_datapath *dp,
> +                        struct flow *uflow,
> +                        struct ovs_list *super)
>  {
>      /* Get logical port number.*/
>      struct mf_subfield port_sf = expr_resolve_field(&bind->port);
> @@ -2214,11 +2214,12 @@ trace_actions(const struct ovnact *ovnacts, size_t
> ovnacts_len,
>              break;
>
>          case OVNACT_LOOKUP_ARP:
> -            execute_lookup_mac(ovnact_get_LOOKUP_ARP(a), dp, uflow,
> super);
> +            execute_lookup_mac_bind(ovnact_get_LOOKUP_ARP(a), dp, uflow,
> +                                    super);
>              break;
>
>          case OVNACT_LOOKUP_ND:
> -            execute_lookup_mac(ovnact_get_LOOKUP_ND(a), dp, uflow, super);
> +            execute_lookup_mac_bind(ovnact_get_LOOKUP_ND(a), dp, uflow,
> super);
>              break;
>
>          case OVNACT_PUT_DHCPV4_OPTS:
> --
> 2.1.0
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
>
diff mbox series

Patch

diff --git a/lib/actions.c b/lib/actions.c
index e14907e..82463fa 100644
--- a/lib/actions.c
+++ b/lib/actions.c
@@ -1867,8 +1867,9 @@  ovnact_put_mac_bind_free(struct ovnact_put_mac_bind *put_mac OVS_UNUSED)
 {
 }
 
-static void format_lookup_mac(const struct ovnact_lookup_mac_bind *lookup_mac,
-                              struct ds *s, const char *name)
+static void format_lookup_mac_bind(
+    const struct ovnact_lookup_mac_bind *lookup_mac,
+    struct ds *s, const char *name)
 {
     expr_field_format(&lookup_mac->dst, s);
     ds_put_format(s, " = %s(", name);
@@ -1884,21 +1885,21 @@  static void
 format_LOOKUP_ARP(const struct ovnact_lookup_mac_bind *lookup_mac,
                          struct ds *s)
 {
-    format_lookup_mac(lookup_mac, s, "lookup_arp");
+    format_lookup_mac_bind(lookup_mac, s, "lookup_arp");
 }
 
 static void
 format_LOOKUP_ND(const struct ovnact_lookup_mac_bind *lookup_mac,
                         struct ds *s)
 {
-    format_lookup_mac(lookup_mac, s, "lookup_nd");
+    format_lookup_mac_bind(lookup_mac, s, "lookup_nd");
 }
 
 static void
-encode_lookup_mac(const struct ovnact_lookup_mac_bind *lookup_mac,
-                  enum mf_field_id ip_field,
-                  const struct ovnact_encode_params *ep,
-                  struct ofpbuf *ofpacts)
+encode_lookup_mac_bind(const struct ovnact_lookup_mac_bind *lookup_mac,
+                       enum mf_field_id ip_field,
+                       const struct ovnact_encode_params *ep,
+                       struct ofpbuf *ofpacts)
 {
     const struct arg args[] = {
         { expr_resolve_field(&lookup_mac->port), MFF_LOG_INPORT },
@@ -1928,7 +1929,7 @@  encode_LOOKUP_ARP(const struct ovnact_lookup_mac_bind *lookup_mac,
                   const struct ovnact_encode_params *ep,
                   struct ofpbuf *ofpacts)
 {
-    encode_lookup_mac(lookup_mac, MFF_REG0, ep, ofpacts);
+    encode_lookup_mac_bind(lookup_mac, MFF_REG0, ep, ofpacts);
 }
 
 static void
@@ -1936,7 +1937,7 @@  encode_LOOKUP_ND(const struct ovnact_lookup_mac_bind *lookup_mac,
                         const struct ovnact_encode_params *ep,
                         struct ofpbuf *ofpacts)
 {
-    encode_lookup_mac(lookup_mac, MFF_XXREG0, ep, ofpacts);
+    encode_lookup_mac_bind(lookup_mac, MFF_XXREG0, ep, ofpacts);
 }
 
 static void
diff --git a/utilities/ovn-trace.c b/utilities/ovn-trace.c
index de75088..2c432ac 100644
--- a/utilities/ovn-trace.c
+++ b/utilities/ovn-trace.c
@@ -1746,10 +1746,10 @@  execute_get_mac_bind(const struct ovnact_get_mac_bind *bind,
 }
 
 static void
-execute_lookup_mac(const struct ovnact_lookup_mac_bind *bind OVS_UNUSED,
-                   const struct ovntrace_datapath *dp OVS_UNUSED,
-                   struct flow *uflow OVS_UNUSED,
-                   struct ovs_list *super OVS_UNUSED)
+execute_lookup_mac_bind(const struct ovnact_lookup_mac_bind *bind,
+                        const struct ovntrace_datapath *dp,
+                        struct flow *uflow,
+                        struct ovs_list *super)
 {
     /* Get logical port number.*/
     struct mf_subfield port_sf = expr_resolve_field(&bind->port);
@@ -2214,11 +2214,12 @@  trace_actions(const struct ovnact *ovnacts, size_t ovnacts_len,
             break;
 
         case OVNACT_LOOKUP_ARP:
-            execute_lookup_mac(ovnact_get_LOOKUP_ARP(a), dp, uflow, super);
+            execute_lookup_mac_bind(ovnact_get_LOOKUP_ARP(a), dp, uflow,
+                                    super);
             break;
 
         case OVNACT_LOOKUP_ND:
-            execute_lookup_mac(ovnact_get_LOOKUP_ND(a), dp, uflow, super);
+            execute_lookup_mac_bind(ovnact_get_LOOKUP_ND(a), dp, uflow, super);
             break;
 
         case OVNACT_PUT_DHCPV4_OPTS: