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

2020-07-29 Thread Numan Siddique
On Thu, Jul 23, 2020 at 10:57 AM Han Zhou  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 
>

Acked-by: Numan Siddique 

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(_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(_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(>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
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


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

2020-07-22 Thread Han Zhou
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 
---
 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(_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(_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(>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
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev