diff mbox series

[ovs-dev] controller: Use ofctrl_add_flow for CT SNAT hairpin flows.

Message ID 20230303230315.1816558-1-i.maximets@ovn.org
State Accepted
Headers show
Series [ovs-dev] controller: Use ofctrl_add_flow for CT SNAT hairpin flows. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_ovn-kubernetes success github build: passed

Commit Message

Ilya Maximets March 3, 2023, 11:03 p.m. UTC
We no longer use conjunctions for these flows, so no need to
try to append them.

Fixes: c2f968235241 ("controller: Fix hairpin SNAT flow explosion if hairpin_snat_ip is set.")
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
---
 controller/lflow.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Ales Musil March 7, 2023, 8:29 a.m. UTC | #1
On Sat, Mar 4, 2023 at 12:03 AM Ilya Maximets <i.maximets@ovn.org> wrote:

> We no longer use conjunctions for these flows, so no need to
> try to append them.
>
> Fixes: c2f968235241 ("controller: Fix hairpin SNAT flow explosion if
> hairpin_snat_ip is set.")
> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
> ---
>  controller/lflow.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/controller/lflow.c b/controller/lflow.c
> index 6a98b19e1..003195ae4 100644
> --- a/controller/lflow.c
> +++ b/controller/lflow.c
> @@ -1746,11 +1746,9 @@ add_lb_ct_snat_hairpin_for_dp(const struct
> ovn_controller_lb *lb,
>       * datapath match, but it will also match on the less restrictive
>       * general case.  Therefore, we set the priority in the
>       * "hairpin_snat_ip" case to be higher than the general case. */
> -    ofctrl_add_or_append_flow(flow_table, OFTABLE_CT_SNAT_HAIRPIN,
> -                              datapath ? 200 : 100,
> -                              lb->slb->header_.uuid.parts[0],
> -                              dp_match, dp_acts, &lb->slb->header_.uuid,
> -                              NX_CTLR_NO_METER, NULL);
> +    ofctrl_add_flow(flow_table, OFTABLE_CT_SNAT_HAIRPIN,
> +                    datapath ? 200 : 100, lb->slb->header_.uuid.parts[0],
> +                    dp_match, dp_acts, &lb->slb->header_.uuid);
>  }
>
>  /* Add a ct_snat flow for each VIP of the LB.  If this LB does not use
> --
> 2.39.1
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
>
Looks good to me, thanks.

Acked-by: Ales Musil <amusil@redhat.com>
Dumitru Ceara March 8, 2023, 12:45 p.m. UTC | #2
On 3/7/23 09:29, Ales Musil wrote:
> On Sat, Mar 4, 2023 at 12:03 AM Ilya Maximets <i.maximets@ovn.org> wrote:
> 
>> We no longer use conjunctions for these flows, so no need to
>> try to append them.
>>
>> Fixes: c2f968235241 ("controller: Fix hairpin SNAT flow explosion if
>> hairpin_snat_ip is set.")
>> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
>> ---
>>  controller/lflow.c | 8 +++-----
>>  1 file changed, 3 insertions(+), 5 deletions(-)
>>
>> diff --git a/controller/lflow.c b/controller/lflow.c
>> index 6a98b19e1..003195ae4 100644
>> --- a/controller/lflow.c
>> +++ b/controller/lflow.c
>> @@ -1746,11 +1746,9 @@ add_lb_ct_snat_hairpin_for_dp(const struct
>> ovn_controller_lb *lb,
>>       * datapath match, but it will also match on the less restrictive
>>       * general case.  Therefore, we set the priority in the
>>       * "hairpin_snat_ip" case to be higher than the general case. */
>> -    ofctrl_add_or_append_flow(flow_table, OFTABLE_CT_SNAT_HAIRPIN,
>> -                              datapath ? 200 : 100,
>> -                              lb->slb->header_.uuid.parts[0],
>> -                              dp_match, dp_acts, &lb->slb->header_.uuid,
>> -                              NX_CTLR_NO_METER, NULL);
>> +    ofctrl_add_flow(flow_table, OFTABLE_CT_SNAT_HAIRPIN,
>> +                    datapath ? 200 : 100, lb->slb->header_.uuid.parts[0],
>> +                    dp_match, dp_acts, &lb->slb->header_.uuid);
>>  }
>>
>>  /* Add a ct_snat flow for each VIP of the LB.  If this LB does not use
>> --
>> 2.39.1
>>
>> _______________________________________________
>> dev mailing list
>> dev@openvswitch.org
>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>>
>>
> Looks good to me, thanks.
> 
> Acked-by: Ales Musil <amusil@redhat.com>
> 

Thanks, Ilya and Ales!

I applied this to the main branch and to 23.03.

Regards,
Dumitru
diff mbox series

Patch

diff --git a/controller/lflow.c b/controller/lflow.c
index 6a98b19e1..003195ae4 100644
--- a/controller/lflow.c
+++ b/controller/lflow.c
@@ -1746,11 +1746,9 @@  add_lb_ct_snat_hairpin_for_dp(const struct ovn_controller_lb *lb,
      * datapath match, but it will also match on the less restrictive
      * general case.  Therefore, we set the priority in the
      * "hairpin_snat_ip" case to be higher than the general case. */
-    ofctrl_add_or_append_flow(flow_table, OFTABLE_CT_SNAT_HAIRPIN,
-                              datapath ? 200 : 100,
-                              lb->slb->header_.uuid.parts[0],
-                              dp_match, dp_acts, &lb->slb->header_.uuid,
-                              NX_CTLR_NO_METER, NULL);
+    ofctrl_add_flow(flow_table, OFTABLE_CT_SNAT_HAIRPIN,
+                    datapath ? 200 : 100, lb->slb->header_.uuid.parts[0],
+                    dp_match, dp_acts, &lb->slb->header_.uuid);
 }
 
 /* Add a ct_snat flow for each VIP of the LB.  If this LB does not use