diff mbox

[ovs-dev,2/9] ofproto-dpif-xlate: Fix revalidation in execute_controller_action().

Message ID 1449714462-31831-3-git-send-email-diproiettod@vmware.com
State Accepted
Headers show

Commit Message

Daniele Di Proietto Dec. 10, 2015, 2:27 a.m. UTC
If there's no actual packet (e.g. during revalidation),
execute_controller_action() exits right away, without calling
xlate_commit_actions().

xlate_commit_actions() might have an influence on slow_path reason
(which is included in the generated ODP actions), meaning that the
revalidation will not generate the same actions than the original
translation.

Fix the problem my making execute_controller_action() call
xlate_commit_actions() even without a packet.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
---
 ofproto/ofproto-dpif-xlate.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Jarno Rajahalme Dec. 10, 2015, 10:42 p.m. UTC | #1
> On Dec 9, 2015, at 6:27 PM, Daniele Di Proietto <diproiettod@vmware.com> wrote:
> 
> If there's no actual packet (e.g. during revalidation),
> execute_controller_action() exits right away, without calling
> xlate_commit_actions().
> 
> xlate_commit_actions() might have an influence on slow_path reason
> (which is included in the generated ODP actions), meaning that the
> revalidation will not generate the same actions than the original
> translation.
> 
> Fix the problem my making execute_controller_action() call

“my” -> “by”

Acked-by: Jarno Rajahalme <jarno@ovn.org>

> xlate_commit_actions() even without a packet.
> 
> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
> ---
> ofproto/ofproto-dpif-xlate.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
> index cf184e4..dab64b9 100644
> --- a/ofproto/ofproto-dpif-xlate.c
> +++ b/ofproto/ofproto-dpif-xlate.c
> @@ -3572,14 +3572,13 @@ execute_controller_action(struct xlate_ctx *ctx, int len,
>     struct dp_packet *packet;
> 
>     ctx->xout->slow |= SLOW_CONTROLLER;
> +    xlate_commit_actions(ctx);
>     if (!ctx->xin->packet) {
>         return;
>     }
> 
>     packet = dp_packet_clone(ctx->xin->packet);
> 
> -    xlate_commit_actions(ctx);
> -
>     odp_execute_actions(NULL, &packet, 1, false,
>                         ctx->odp_actions->data, ctx->odp_actions->size, NULL);
> 
> -- 
> 2.1.4
> 
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
Daniele Di Proietto Dec. 11, 2015, 1:45 a.m. UTC | #2
On 10/12/2015 14:42, "Jarno Rajahalme" <jarno@ovn.org> wrote:

>
>> On Dec 9, 2015, at 6:27 PM, Daniele Di Proietto
>><diproiettod@vmware.com> wrote:
>> 
>> If there's no actual packet (e.g. during revalidation),
>> execute_controller_action() exits right away, without calling
>> xlate_commit_actions().
>> 
>> xlate_commit_actions() might have an influence on slow_path reason
>> (which is included in the generated ODP actions), meaning that the
>> revalidation will not generate the same actions than the original
>> translation.
>> 
>> Fix the problem my making execute_controller_action() call
>
>³my² -> ³by²

Fixed!

>Acked-by: Jarno Rajahalme <jarno@ovn.org>

Thanks, pushed to master and branch-2.5

>
>> xlate_commit_actions() even without a packet.
>> 
>> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
>> ---
>> ofproto/ofproto-dpif-xlate.c | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>> 
>> diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
>> index cf184e4..dab64b9 100644
>> --- a/ofproto/ofproto-dpif-xlate.c
>> +++ b/ofproto/ofproto-dpif-xlate.c
>> @@ -3572,14 +3572,13 @@ execute_controller_action(struct xlate_ctx
>>*ctx, int len,
>>     struct dp_packet *packet;
>> 
>>     ctx->xout->slow |= SLOW_CONTROLLER;
>> +    xlate_commit_actions(ctx);
>>     if (!ctx->xin->packet) {
>>         return;
>>     }
>> 
>>     packet = dp_packet_clone(ctx->xin->packet);
>> 
>> -    xlate_commit_actions(ctx);
>> -
>>     odp_execute_actions(NULL, &packet, 1, false,
>>                         ctx->odp_actions->data, ctx->odp_actions->size,
>>NULL);
>> 
>> -- 
>> 2.1.4
>> 
>> _______________________________________________
>> dev mailing list
>> dev@openvswitch.org
>> 
>>https://urldefense.proofpoint.com/v2/url?u=http-3A__openvswitch.org_mailm
>>an_listinfo_dev&d=BQIFaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=
>>SmB5nZacmXNq0gKCC1s_Cw5yUNjxgD4v5kJqZ2uWLlE&m=xuM8HGBe5fFCLhJHq1xqKDktlzA
>>E17It3Rtdcw6czpI&s=0s9sXgRG4C0tm1AH1ketAkaVlEmiYrbYXC8c2Yk34OY&e=
>
diff mbox

Patch

diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index cf184e4..dab64b9 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -3572,14 +3572,13 @@  execute_controller_action(struct xlate_ctx *ctx, int len,
     struct dp_packet *packet;
 
     ctx->xout->slow |= SLOW_CONTROLLER;
+    xlate_commit_actions(ctx);
     if (!ctx->xin->packet) {
         return;
     }
 
     packet = dp_packet_clone(ctx->xin->packet);
 
-    xlate_commit_actions(ctx);
-
     odp_execute_actions(NULL, &packet, 1, false,
                         ctx->odp_actions->data, ctx->odp_actions->size, NULL);