Re: [ovs-dev] [PATCH v2 2/3] ofproto-dpif: Improve dp_hash selection method for select groups

2018-04-18 Thread Jan Scheurich
> How about this approach, which should cleanly eliminate the warning? > > diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c > index e1a5c097f3aa..362339a4abb4 100644 > --- a/ofproto/ofproto-dpif.c > +++ b/ofproto/ofproto-dpif.c > @@ -4780,22 +4780,17 @@

Re: [ovs-dev] [PATCH v2 2/3] ofproto-dpif: Improve dp_hash selection method for select groups

2018-04-17 Thread Ben Pfaff
On Tue, Apr 17, 2018 at 01:03:17PM -0700, Ben Pfaff wrote: > On Mon, Apr 16, 2018 at 04:26:27PM +0200, Jan Scheurich wrote: > > The current implementation of the "dp_hash" selection method suffers > > from two deficiences: 1. The hash mask and hence the number of dp_hash > > values is just large

Re: [ovs-dev] [PATCH v2 2/3] ofproto-dpif: Improve dp_hash selection method for select groups

2018-04-17 Thread Ben Pfaff
On Mon, Apr 16, 2018 at 04:26:27PM +0200, Jan Scheurich wrote: > The current implementation of the "dp_hash" selection method suffers > from two deficiences: 1. The hash mask and hence the number of dp_hash > values is just large enough to cover the number of group buckets, but > does not consider

Re: [ovs-dev] [PATCH v2 2/3] ofproto-dpif: Improve dp_hash selection method for select groups

2018-04-17 Thread Jan Scheurich
Hi Ychen, Thank you for finding yet another corner case. I will fix it in the next version with the following incremental: diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 8f71083..674b3b5 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -4762,6 +4762,11 @@

Re: [ovs-dev] [PATCH v2 2/3] ofproto-dpif: Improve dp_hash selection method for select groups

2018-04-17 Thread ychen
Hi, Jan: I think the following code should also be modified + for (int hash = 0; hash < n_hash; hash++) { + double max_val = 0.0; + struct webster *winner; +for (i = 0; i < n_buckets; i++) { +if (webster[i].value > max_val) { ===> if bucket->weight=0,

[ovs-dev] [PATCH v2 2/3] ofproto-dpif: Improve dp_hash selection method for select groups

2018-04-16 Thread Jan Scheurich
The current implementation of the "dp_hash" selection method suffers from two deficiences: 1. The hash mask and hence the number of dp_hash values is just large enough to cover the number of group buckets, but does not consider the case that buckets have different weights. 2. The xlate-time