On Fri, Apr 18, 2014 at 9:28 AM, Jesse Gross <[email protected]> wrote:
> On Fri, Apr 18, 2014 at 2:51 AM, Andy Zhou <[email protected]> wrote:
>> diff --git a/datapath/actions.c b/datapath/actions.c
>> index 82cfd2d..87a8a40 100644
>> --- a/datapath/actions.c
>> +++ b/datapath/actions.c
>> @@ -460,6 +460,20 @@ static int sample(struct datapath *dp, struct sk_buff 
>> *skb,
>>                                   nla_len(acts_list), true);
>>  }
>>
>> +static void execute_hash(struct sk_buff *skb, const struct nlattr *attr)
>> +{
>> +       struct sw_flow_key *key = OVS_CB(skb)->pkt_key;
>> +       struct ovs_action_hash *hash_act = nla_data(attr);
>> +       u32 hash = 0;
>> +
>> +       /* OVS_HASH_ALG_L4 is the only possible hash algorithm.  */
>> +       hash = skb_get_rxhash(skb);
>> +       if (!hash)
>> +               hash = 0x1;
>> +
>> +       key->ovs_flow_hash = jhash_1word(hash, hash_act->hash_basis);
>
> I think you need to rehash before the zero check - otherwise after
> rehashing it's possible to have zero again.
Good catch.  Will do.
>
> I don't understand the other change about accepting a hash mask even
> when there isn't a hash value. Can you explain this?
It is not necessary now. I was thinking of the case Pravin suggested that
we do a  masked action.  A hash value may be zero after applying a mask.
In this case, the hash value won't be exported on a post recirculation miss, but
its mask can be supplied on flow installation. We can remove it if this is not
the direction we want to go.
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to