diff mbox series

[ovs-dev] lflow: Avoid parsing lflow->pipeline for non-local flows.

Message ID 20210325145604.10138-1-dceara@redhat.com
State Accepted
Headers show
Series [ovs-dev] lflow: Avoid parsing lflow->pipeline for non-local flows. | expand

Commit Message

Dumitru Ceara March 25, 2021, 2:56 p.m. UTC
Spotted during code inspection.

Signed-off-by: Dumitru Ceara <dceara@redhat.com>
---
 controller/lflow.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Mark Gray March 26, 2021, 8:12 a.m. UTC | #1
On 25/03/2021 14:56, Dumitru Ceara wrote:
> Spotted during code inspection.
> 
> Signed-off-by: Dumitru Ceara <dceara@redhat.com>
> ---
>  controller/lflow.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/controller/lflow.c b/controller/lflow.c
> index a3d84aff4..680b8cca1 100644
> --- a/controller/lflow.c
> +++ b/controller/lflow.c
> @@ -716,15 +716,15 @@ consider_logical_flow__(const struct sbrec_logical_flow *lflow,
>                          struct lflow_ctx_in *l_ctx_in,
>                          struct lflow_ctx_out *l_ctx_out)
>  {
> -    /* Determine translation of logical table IDs to physical table IDs. */
> -    bool ingress = !strcmp(lflow->pipeline, "ingress");
> -
>      if (!get_local_datapath(l_ctx_in->local_datapaths, dp->tunnel_key)) {
>          VLOG_DBG("lflow "UUID_FMT" is not for local datapath, skip",
>                   UUID_ARGS(&lflow->header_.uuid));
>          return true;
>      }
>  
> +    /* Determine translation of logical table IDs to physical table IDs. */
> +    bool ingress = !strcmp(lflow->pipeline, "ingress");
> +
>      /* Determine translation of logical table IDs to physical table IDs. */
>      uint8_t first_ptable = (ingress
>                              ? OFTABLE_LOG_INGRESS_PIPELINE
> 
Acked-by: Mark Gray <mark.d.gray@redhat.com>
Han Zhou March 28, 2021, 6:30 a.m. UTC | #2
On Fri, Mar 26, 2021 at 1:12 AM Mark Gray <mark.d.gray@redhat.com> wrote:
>
> On 25/03/2021 14:56, Dumitru Ceara wrote:
> > Spotted during code inspection.
> >
> > Signed-off-by: Dumitru Ceara <dceara@redhat.com>
> > ---
> >  controller/lflow.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/controller/lflow.c b/controller/lflow.c
> > index a3d84aff4..680b8cca1 100644
> > --- a/controller/lflow.c
> > +++ b/controller/lflow.c
> > @@ -716,15 +716,15 @@ consider_logical_flow__(const struct
sbrec_logical_flow *lflow,
> >                          struct lflow_ctx_in *l_ctx_in,
> >                          struct lflow_ctx_out *l_ctx_out)
> >  {
> > -    /* Determine translation of logical table IDs to physical table
IDs. */
> > -    bool ingress = !strcmp(lflow->pipeline, "ingress");
> > -
> >      if (!get_local_datapath(l_ctx_in->local_datapaths,
dp->tunnel_key)) {
> >          VLOG_DBG("lflow "UUID_FMT" is not for local datapath, skip",
> >                   UUID_ARGS(&lflow->header_.uuid));
> >          return true;
> >      }
> >
> > +    /* Determine translation of logical table IDs to physical table
IDs. */
> > +    bool ingress = !strcmp(lflow->pipeline, "ingress");
> > +
> >      /* Determine translation of logical table IDs to physical table
IDs. */
> >      uint8_t first_ptable = (ingress
> >                              ? OFTABLE_LOG_INGRESS_PIPELINE
> >
> Acked-by: Mark Gray <mark.d.gray@redhat.com>
>

Thanks Dumitru and Mark. I applied this to master.

Han
Dumitru Ceara March 29, 2021, 7 a.m. UTC | #3
On 3/28/21 8:30 AM, Han Zhou wrote:
> On Fri, Mar 26, 2021 at 1:12 AM Mark Gray <mark.d.gray@redhat.com> wrote:
>>
>> On 25/03/2021 14:56, Dumitru Ceara wrote:
>>> Spotted during code inspection.
>>>
>>> Signed-off-by: Dumitru Ceara <dceara@redhat.com>
>>> ---
>>>  controller/lflow.c | 6 +++---
>>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/controller/lflow.c b/controller/lflow.c
>>> index a3d84aff4..680b8cca1 100644
>>> --- a/controller/lflow.c
>>> +++ b/controller/lflow.c
>>> @@ -716,15 +716,15 @@ consider_logical_flow__(const struct
> sbrec_logical_flow *lflow,
>>>                          struct lflow_ctx_in *l_ctx_in,
>>>                          struct lflow_ctx_out *l_ctx_out)
>>>  {
>>> -    /* Determine translation of logical table IDs to physical table
> IDs. */
>>> -    bool ingress = !strcmp(lflow->pipeline, "ingress");
>>> -
>>>      if (!get_local_datapath(l_ctx_in->local_datapaths,
> dp->tunnel_key)) {
>>>          VLOG_DBG("lflow "UUID_FMT" is not for local datapath, skip",
>>>                   UUID_ARGS(&lflow->header_.uuid));
>>>          return true;
>>>      }
>>>
>>> +    /* Determine translation of logical table IDs to physical table
> IDs. */
>>> +    bool ingress = !strcmp(lflow->pipeline, "ingress");
>>> +
>>>      /* Determine translation of logical table IDs to physical table
> IDs. */
>>>      uint8_t first_ptable = (ingress
>>>                              ? OFTABLE_LOG_INGRESS_PIPELINE
>>>
>> Acked-by: Mark Gray <mark.d.gray@redhat.com>
>>
> 
> Thanks Dumitru and Mark. I applied this to master.
> 
> Han
> 

Thanks!
diff mbox series

Patch

diff --git a/controller/lflow.c b/controller/lflow.c
index a3d84aff4..680b8cca1 100644
--- a/controller/lflow.c
+++ b/controller/lflow.c
@@ -716,15 +716,15 @@  consider_logical_flow__(const struct sbrec_logical_flow *lflow,
                         struct lflow_ctx_in *l_ctx_in,
                         struct lflow_ctx_out *l_ctx_out)
 {
-    /* Determine translation of logical table IDs to physical table IDs. */
-    bool ingress = !strcmp(lflow->pipeline, "ingress");
-
     if (!get_local_datapath(l_ctx_in->local_datapaths, dp->tunnel_key)) {
         VLOG_DBG("lflow "UUID_FMT" is not for local datapath, skip",
                  UUID_ARGS(&lflow->header_.uuid));
         return true;
     }
 
+    /* Determine translation of logical table IDs to physical table IDs. */
+    bool ingress = !strcmp(lflow->pipeline, "ingress");
+
     /* Determine translation of logical table IDs to physical table IDs. */
     uint8_t first_ptable = (ingress
                             ? OFTABLE_LOG_INGRESS_PIPELINE