[ovs-dev] [PATCH 15/24] ofp-util: Update ofputil_capabilities for Open Flow 1.2

Simon Horman horms at verge.net.au
Thu Jul 26 09:01:49 UTC 2012


On Tue, Jul 24, 2012 at 10:43:53PM -0700, Ben Pfaff wrote:
> On Mon, Jul 23, 2012 at 03:16:44PM +0900, Simon Horman wrote:
> > * OFPUTIL_C_ARP_MATCH_IP is not present in Open Flow 1.2.
> > * OFPUTIL_C_PORT_BLOCKED is new in Open Flow 1.2.
> > 
> > Otherwise the Open Flow 1.2 capabilities are the same as those of
> > Open Flow 1.1.
> > 
> > Signed-off-by: Simon Horman <horms at verge.net.au>
> 
> Don't we need a change to ofputil_decode_switch_features() to handle the
> added and removed bits?

As noted elsewhere, I will merge this patch with "ofp-util: Update
OFPC_COMMON and add ofputil_capabilities_mask" to provide an update of
ofputil_decode_switch_features()().

> Could you add a test to ofp-print.at?

Sure, I will add the test below.

Incidently, I believe that the features field of switch_features
has become reserved in Open Flow 1.1 and 1.2. I will prepare a patch
to do the folliwing in the case of those Open Flow versions:
* Omit outputing its value in ofp_print_switch_features()
* Call decode_action_bits(decode_action_bits(UINT32_MAX, ...) in
  ofputil_action_bit_translation
* Not set osf->actions in ofputil_encode_switch_features()
  which result in it being zero.

I will also add of12_action_bits an make ofputil_decode_switch_features()
Open Flow 1.2 aware.



diff --git a/tests/ofp-print.at b/tests/ofp-print.at
index 1b8367e..05e6cac 100644
--- a/tests/ofp-print.at
+++ b/tests/ofp-print.at
@@ -202,7 +202,6 @@ ff ff ff fe 00 00 00 00 50 54 00 00 00 01 00 00 \
 OFPT_FEATURES_REPLY (OF1.1) (xid=0x1): dpid:0000505400000001
 n_tables:2, n_buffers:256
 capabilities: FLOW_STATS TABLE_STATS PORT_STATS ARP_MATCH_IP
-actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP SET_DL_SRC SET_DL_DST SET_NW_SRC SET_NW_DST SET_NW_ECN SET_NW_TOS SET_TP_SRC SET_TP_DST COPY_TTL_OUT COPY_TTL_IN SET_MPLS_LABEL SET_MPLS_TC SET_MPLS_TTL
  3(eth0): addr:50:54:00:00:00:01
      config:     0
      state:      0
@@ -246,6 +245,66 @@ received OFPT_FEATURES_REPLY with incorrect length 144 (must be exactly 32 bytes
 ])
 AT_CLEANUP
 
+AT_SETUP([OFPT_FEATURES_REPLY - OF1.2])
+AT_KEYWORDS([ofp-print])
+AT_CHECK([ovs-ofctl ofp-print "\
+03 06 00 a0 00 00 00 01 00 00 50 54 00 00 00 01 \
+00 00 01 00 ff 00 00 00 00 00 01 77 00 00 06 ff \
+ff ff ff fe 00 00 00 00 50 54 00 00 00 01 00 00 \
+62 72 30 0a 00 00 00 00 00 00 00 00 00 00 00 00 \
+00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 \
+00 00 00 00 00 00 00 00 00 01 86 a0 00 01 86 a0 \
+00 00 00 03 00 00 00 00 50 54 00 00 00 01 00 00 \
+65 74 68 30 00 00 00 00 00 00 00 00 00 00 00 00 \
+00 00 00 00 00 00 00 00 00 00 20 08 00 00 28 0f \
+00 00 28 0f 00 00 00 00 00 01 86 a0 00 01 86 a0 \
+"], [0], [dnl
+OFPT_FEATURES_REPLY (OF1.2) (xid=0x1): dpid:0000505400000001
+n_tables:255, n_buffers:256
+capabilities: FLOW_STATS TABLE_STATS PORT_STATS IP_REASM QUEUE_STATS PORT_BLOCKED
+ 3(eth0): addr:50:54:00:00:00:01
+     config:     0
+     state:      0
+     current:    100MB-FD AUTO_NEG
+     advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG
+     supported:  10MB-HD 10MB-FD 100MB-HD 100MB-FD COPPER AUTO_NEG
+     speed: 100 Mbps now, 100 Mbps max
+ LOCAL(br0): addr:50:54:00:00:00:01
+     config:     PORT_DOWN
+     state:      LINK_DOWN
+     speed: 100 Mbps now, 100 Mbps max
+])
+AT_CLEANUP
+
+AT_SETUP([OFPT_FEATURES_REPLY cut off mid-port - OF1.2])
+AT_KEYWORDS([ofp-print])
+AT_CHECK([ovs-ofctl ofp-print "\
+03 06 00 a0 00 00 00 01 00 00 50 54 00 00 00 01 \
+00 00 01 00 ff 00 00 00 00 00 01 77 00 00 06 ff \
+ff ff ff fe 00 00 00 00 50 54 00 00 00 01 00 00 \
+62 72 30 0a 00 00 00 00 00 00 00 00 00 00 00 00 \
+00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 \
+00 00 00 00 00 00 00 00 00 01 86 a0 00 01 86 a0 \
+00 00 00 03 00 00 00 00 50 54 00 00 00 01 00 00 \
+65 74 68 30 00 00 00 00 00 00 00 00 00 00 00 00 \
+00 00 00 00 00 00 00 00 00 00 20 08 00 00 28 0f \
+"], [0], [dnl
+OFPT_FEATURES_REPLY (OF1.2) (xid=0x1):
+(***truncated to 144 bytes from 160***)
+00000000  03 06 00 a0 00 00 00 01-00 00 50 54 00 00 00 01 |..........PT....|
+00000010  00 00 01 00 ff 00 00 00-00 00 01 77 00 00 06 ff |...........w....|
+00000020  ff ff ff fe 00 00 00 00-50 54 00 00 00 01 00 00 |........PT......|
+00000030  62 72 30 0a 00 00 00 00-00 00 00 00 00 00 00 00 |br0.............|
+00000040  00 00 00 01 00 00 00 01-00 00 00 00 00 00 00 00 |................|
+00000050  00 00 00 00 00 00 00 00-00 01 86 a0 00 01 86 a0 |................|
+00000060  00 00 00 03 00 00 00 00-50 54 00 00 00 01 00 00 |........PT......|
+00000070  65 74 68 30 00 00 00 00-00 00 00 00 00 00 00 00 |eth0............|
+00000080  00 00 00 00 00 00 00 00-00 00 20 08 00 00 28 0f |.......... ...@{:@.|
+], [stderr])
+AT_CHECK([sed 's/.*|//' stderr], [0], [dnl
+])
+AT_CLEANUP
+
 AT_SETUP([OFPT_GET_CONFIG_REQUEST])
 AT_KEYWORDS([ofp-print])
 AT_CHECK([ovs-ofctl ofp-print '0107000800000001'], [0], [dnl




More information about the dev mailing list