[ovs-dev] [PATCH 5/8] ofproto: Match on IP ToS/DSCP bits (OpenFlow 1.0)

Justin Pettit jpettit at nicira.com
Fri Jan 22 23:43:21 UTC 2010


On Jan 22, 2010, at 10:07 AM, Ben Pfaff wrote:

> I don't know why; I applied all of the previous patches on top of the
> openflow-0.9 branch.

Weird..

>> @@ -244,6 +244,7 @@ int flow_extract(struct sk_buff *skb, u16 in_port, struct odp_flow_key *key)
>> 		int th_ofs = nh_ofs + nh->ihl * 4;
>> 		key->nw_src = nh->saddr;
>> 		key->nw_dst = nh->daddr;
>> +		key->nw_tos = nh->tos & 0xfc;
>> 		key->nw_proto = nh->protocol;
>> 		skb_set_transport_header(skb, th_ofs);
> 
> I guess I always assumed that the TOS bits would be in the least
> significant 6 bits of the nw_tos field, i.e. nh->tos >> 2.  I hope that
> the OpenFlow specification is clear about this one way or another?

That makes two of us.  And, no, it's not clear in the spec.  I've got a couple of items that I'm going to send out later to the OpenFlow folks about the spec and reference implementation.

>> @@ -291,11 +295,11 @@ void
>> flow_format(struct ds *ds, const flow_t *flow)
>> {
>>     ds_put_format(ds, "in_port%04x:vlan%d:pcp%d mac"ETH_ADDR_FMT
>> -                  "->"ETH_ADDR_FMT" type%04x proto%"PRId8" ip"IP_FMT
>> +                  "->"ETH_ADDR_FMT" type%04x proto%"PRId8" tos%d ip"IP_FMT
> 
> __u8 should be printed with PRIu8.

Thanks.  Fixed.

>>                   "->"IP_FMT" port%d->%d",
>>                   flow->in_port, ntohs(flow->dl_vlan), flow->dl_vlan_pcp,
>>                   ETH_ADDR_ARGS(flow->dl_src), ETH_ADDR_ARGS(flow->dl_dst),
>> -                  ntohs(flow->dl_type), flow->nw_proto,
>> +                  ntohs(flow->dl_type), flow->nw_proto, flow->nw_tos,
>>                   IP_ARGS(&flow->nw_src), IP_ARGS(&flow->nw_dst),
>>                   ntohs(flow->tp_src), ntohs(flow->tp_dst));


The feedback just sort of ended here.  I'm assuming there wasn't anything else...

--Justin






More information about the dev mailing list