[ovs-dev] [PATCH v3 1/8] match: Do not skip formatting a zero dp_hash.

Jarno Rajahalme jrajahalme at nicira.com
Tue Mar 17 00:10:36 UTC 2015


> On Mar 16, 2015, at 10:34 AM, Andy Zhou <azhou at nicira.com> wrote:
> 
> On Fri, Mar 13, 2015 at 4:51 PM, Jarno Rajahalme <jrajahalme at nicira.com> wrote:
>> The dp_hash match should be printed whenever it is being matched.  We
>> keep the old behavior for flow_format(), which is mostly used to
>> format PACKET_IN messages. This keeps those messages tidier and avoids
>> changing a lot of test cases.
>> 
>> Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
>> ---
>> lib/flow.c            |    3 +++
>> lib/match.c           |    2 +-
>> tests/dpif-netdev.at  |    2 +-
>> tests/ofproto-dpif.at |    4 ++--
>> 4 files changed, 7 insertions(+), 4 deletions(-)
>> 
>> diff --git a/lib/flow.c b/lib/flow.c
>> index 965da41..aa1cc47 100644
>> --- a/lib/flow.c
>> +++ b/lib/flow.c
>> @@ -872,6 +872,9 @@ flow_format(struct ds *ds, const struct flow *flow)
>>     if (!flow->recirc_id) {
>>         WC_UNMASK_FIELD(wc, recirc_id);
>>     }
>> +    if (!flow->dp_hash) {
>> +        WC_UNMASK_FIELD(wc, dp_hash);
>> +    }
> 
> The comment block above calling out printing zero value for in_port.
> It seems the it needs
> to be updated with other fields, such as skb_priority, pkt_mark,
> recirc_id and dp_hash.
> 

It turns out the comment is wrong, and printing out the “in_port=0” for PACKET_IN messages does not make sense for two reasons:
- 0 is not a valid OpenFlow port number
- PACKET_IN messages have an in port member in the message itself, and printing out “in_port=0” in addition to that makes no sense.

I’ll post a separate patch to fix this.

  Jarno

> For the reset of this patch
> Acked-by: Andy Zhou <azhou at nicira.com>
> 
> And thanks for noticing the output anomaly in the test cases.




More information about the dev mailing list