Re: [ovs-dev] [PATCH] ofctl: Fixup compare_flows function

2018-08-08 Thread Alin Gabriel Serdean
On 7 Aug 2018, at 19:36, Ben Pfaff  wrote:
> 
> Signed-off-by: Ben Pfaff 
> 
> On Tue, Aug 07, 2018 at 03:59:59PM +0300, aserd...@ovn.org wrote:
>> Can you also provide a Signed-off-by pls?
>> 
>>> -Mesaj original-
>>> De la: ovs-dev-boun...@openvswitch.org >> boun...@openvswitch.org> În numele Ben Pfaff
>>> Trimis: Tuesday, August 7, 2018 12:40 AM
>>> Către: Alin Gabriel Serdean 
>>> Cc: d...@openvswitch.org
>>> Subiect: Re: [ovs-dev] [PATCH] ofctl: Fixup compare_flows function
>>> 
>>> On Tue, Aug 07, 2018 at 12:34:45AM +0300, Alin Gabriel Serdean wrote:
>>>> In the case there was no sorting criteria the flows on Windows were
>>>> being rearranged because it was always returning zero.
>>>> 
>>>> Also check if there we need sorting to save a few cycles.
>>>> 
>>>> CC: Ben Pfaff 
>>>> Co-authored-by: Ben Pfaff 
>>>> Signed-off-by: Alin Gabriel Serdean 
>>> 
>>> Acked-by: Ben Pfaff 
>>> ___
>>> dev mailing list
>>> d...@openvswitch.org
>>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>> 

Thanks! I applied this from master to branch-2.7
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] ofctl: Fixup compare_flows function

2018-08-07 Thread Ben Pfaff
Signed-off-by: Ben Pfaff 

On Tue, Aug 07, 2018 at 03:59:59PM +0300, aserd...@ovn.org wrote:
> Can you also provide a Signed-off-by pls?
> 
> > -Mesaj original-
> > De la: ovs-dev-boun...@openvswitch.org  > boun...@openvswitch.org> În numele Ben Pfaff
> > Trimis: Tuesday, August 7, 2018 12:40 AM
> > Către: Alin Gabriel Serdean 
> > Cc: d...@openvswitch.org
> > Subiect: Re: [ovs-dev] [PATCH] ofctl: Fixup compare_flows function
> > 
> > On Tue, Aug 07, 2018 at 12:34:45AM +0300, Alin Gabriel Serdean wrote:
> > > In the case there was no sorting criteria the flows on Windows were
> > > being rearranged because it was always returning zero.
> > >
> > > Also check if there we need sorting to save a few cycles.
> > >
> > > CC: Ben Pfaff 
> > > Co-authored-by: Ben Pfaff 
> > > Signed-off-by: Alin Gabriel Serdean 
> > 
> > Acked-by: Ben Pfaff 
> > ___
> > 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


Re: [ovs-dev] [PATCH] ofctl: Fixup compare_flows function

2018-08-07 Thread aserdean
Can you also provide a Signed-off-by pls?

> -Mesaj original-
> De la: ovs-dev-boun...@openvswitch.org  boun...@openvswitch.org> În numele Ben Pfaff
> Trimis: Tuesday, August 7, 2018 12:40 AM
> Către: Alin Gabriel Serdean 
> Cc: d...@openvswitch.org
> Subiect: Re: [ovs-dev] [PATCH] ofctl: Fixup compare_flows function
> 
> On Tue, Aug 07, 2018 at 12:34:45AM +0300, Alin Gabriel Serdean wrote:
> > In the case there was no sorting criteria the flows on Windows were
> > being rearranged because it was always returning zero.
> >
> > Also check if there we need sorting to save a few cycles.
> >
> > CC: Ben Pfaff 
> > Co-authored-by: Ben Pfaff 
> > Signed-off-by: Alin Gabriel Serdean 
> 
> Acked-by: Ben Pfaff 
> ___
> 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


Re: [ovs-dev] [PATCH] ofctl: Fixup compare_flows function

2018-08-06 Thread Ben Pfaff
On Tue, Aug 07, 2018 at 12:34:45AM +0300, Alin Gabriel Serdean wrote:
> In the case there was no sorting criteria the flows on Windows were being
> rearranged because it was always returning zero.
> 
> Also check if there we need sorting to save a few cycles.
> 
> CC: Ben Pfaff 
> Co-authored-by: Ben Pfaff 
> Signed-off-by: Alin Gabriel Serdean 

Acked-by: Ben Pfaff 
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH] ofctl: Fixup compare_flows function

2018-08-06 Thread Alin Gabriel Serdean
In the case there was no sorting criteria the flows on Windows were being
rearranged because it was always returning zero.

Also check if there we need sorting to save a few cycles.

CC: Ben Pfaff 
Co-authored-by: Ben Pfaff 
Signed-off-by: Alin Gabriel Serdean 
---
 utilities/ovs-ofctl.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
index 6acbbf140..d06c827c4 100644
--- a/utilities/ovs-ofctl.c
+++ b/utilities/ovs-ofctl.c
@@ -1543,7 +1543,7 @@ compare_flows(const void *afs_, const void *bfs_)
 }
 }
 
-return 0;
+return a < b ? -1 : 1;
 }
 
 static void
@@ -1565,7 +1565,9 @@ ofctl_dump_flows(struct ovs_cmdl_context *ctx)
 run(vconn_dump_flows(vconn, , protocol, , _fses),
 "dump flows");
 
-qsort(fses, n_fses, sizeof *fses, compare_flows);
+if (n_criteria) {
+qsort(fses, n_fses, sizeof *fses, compare_flows);
+}
 
 struct ds s = DS_EMPTY_INITIALIZER;
 for (size_t i = 0; i < n_fses; i++) {
-- 
2.16.1.windows.1

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev