Hi,

On 2015年07月25日 00:34, Ben Pfaff wrote:
> On Fri, Jul 24, 2015 at 02:45:33PM +0900, Minoru TAKAHASHI wrote:
>> Hi,
>>
>> On 2015年07月22日 17:25, Minoru TAKAHASHI wrote:
>>> Hi,
>>>
>>> Thank you for reply.
>>>
>>> On 2015年07月22日 00:19, Ben Pfaff wrote:
>>>> On Tue, Jul 21, 2015 at 03:10:08PM +0900, Minoru TAKAHASHI wrote:
>>>>>> they do not make the corresponding change to the decoder
>>>>>
>>>>> Should I fix this problem?
>>>>> If so, please tell me that which source file should I fix.
>>>>> (Sorry, I am new in implementation of OpenvSwitch.)
>>>>
>>>> I cannot apply anything to the repository that makes tests fail, so yes
>>>> you should fix the decoder.
>>>>
>>>> The decode function is right next to the encode function.
>>
>>> ## ------------------------------ ##
>>> ## openvswitch 2.4.90 test suite. ##
>>> ## ------------------------------ ##
>>>
>>> 694: ofproto - del group (OpenFlow 1.5)              FAILED (ofproto.at:350)
>>> 696: ofproto - insert buckets                        FAILED (ofproto.at:424)
>>
>> I think that the following code is causing the above error.
>>
>> [lib/ofp-msgs.h]
>> https://github.com/openvswitch/ovs/blob/master/lib/ofp-msgs.h#L336
>>
>> [tests/ofp-print.at]
>> https://github.com/openvswitch/ovs/blob/master/tests/ofp-print.at#L2003
>>
>> After I fix these, the above error does not occur.
> 
> Did you run all the tests?  I see three failures:

Oh, sorry about that.
Hmm, how to run the testsuite is correct in the following?

1. uninstall ovs

 sudo make uninstall
 sudo make distclean

2. install ovs

 ./boot.sh
 ./configure
 make && sudo make install

3. run tests

 ./tests/testsuite -C tests AUTOTEST_PATH=utilities:vswitchd:ovsdb:vtep:tests

And, previous patch has the following error.
I attached fixed patch in this email.
(However, might this patch still have an error.
 Because I don't know how to run correctly the testsuite.)

thanks,

## ------------------------ ##
## Summary of the failures. ##
## ------------------------ ##

 243: ofp-print.at:2000  OFPST_GROUP_DESC request - OF1.5
      ofp-print ofpt_stats_request

## ---------------------- ##
## Detailed failed tests. ##
## ---------------------- ##

#                             -*- compilation -*-
243. ofp-print.at:2000: testing OFPST_GROUP_DESC request - OF1.5 ...
./ofp-print.at:2002: ovs-ofctl ofp-print "\
06 12 00 14 00 00 00 02 00 07 00 00 00 00 00 00 \
00 00 00 01
"
--- /dev/null   2015-07-27 08:55:16.622039910 +0900
+++ /home/ryu/wk_takahashi/my_ovs/ovs/tests/testsuite.dir/at-groups/243/stderr  
2015-07-27 15:43:43.304223828 +0900
@@ -0,0 +1 @@
+2015-07-27T06:43:43Z|00001|ofp_msgs|WARN|received OFPST_GROUP_DESC request 
with incorrect length 20 (expected length 24)
--- -   2015-07-27 15:43:43.314504500 +0900
+++ /home/ryu/wk_takahashi/my_ovs/ovs/tests/testsuite.dir/at-groups/243/stdout  
2015-07-27 15:43:43.308223828 +0900
@@ -1,2 +1,4 @@
-OFPST_GROUP_DESC request (OF1.5) (xid=0x2): group_id=1
+***decode error: OFPBRC_BAD_LEN***
+00000000  06 12 00 14 00 00 00 02-00 07 00 00 00 00 00 00 |................|
+00000010  00 00 00 01                                     |....            |
 
243. ofp-print.at:2000: 243. OFPST_GROUP_DESC request - OF1.5 
(ofp-print.at:2000): FAILED (ofp-print.at:2002)

> 
> ## ------------------------ ##
> ## Summary of the failures. ##
> ## ------------------------ ##
> Failed tests:
> openvswitch 2.4.90 test suite test groups:
> 
>  NUM: FILE-NAME:LINE     TEST-GROUP-NAME
>       KEYWORDS
> 
>  695: ofproto.at:343     ofproto - del group (OpenFlow 1.5)
>  697: ofproto.at:418     ofproto - insert buckets
>  698: ofproto.at:476     ofproto - remove buckets
> 
>From 26434209b2672f485b08e91fa4a2bf0a9158a9c9 Mon Sep 17 00:00:00 2001
From: Minoru TAKAHASHI <takahashi.mino...@gmail.com>
Date: Fri, 17 Jul 2015 13:22:13 +0900
Subject: [PATCH 1/2] openflow: Add OpenFlow1.5 group desc request.

Signed-off-by: Minoru TAKAHASHI <takahashi.mino...@gmail.com>
---
 include/openflow/openflow-1.5.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/openflow/openflow-1.5.h b/include/openflow/openflow-1.5.h
index 4d77818..dd068cf 100644
--- a/include/openflow/openflow-1.5.h
+++ b/include/openflow/openflow-1.5.h
@@ -137,6 +137,13 @@ struct ofp15_group_mod {
 };
 OFP_ASSERT(sizeof(struct ofp15_group_mod) == 16);
 
+/* Body for ofp15_multipart_request of type OFPMP_GROUP_DESC. */
+struct ofp15_group_desc_request {
+    ovs_be32 group_id;         /* All groups if OFPG_ALL. */
+    uint8_t pad[4];            /* Align to 64 bits. */
+};
+OFP_ASSERT(sizeof(struct ofp15_group_desc_request) == 8);
+
 /* Body of reply to OFPMP_GROUP_DESC request. */
 struct ofp15_group_desc_stats {
     ovs_be16 length;              /* Length of this entry. */
-- 
1.9.1

>From abf23759aa12219cf2f19bcc6e02a4a774b1025c Mon Sep 17 00:00:00 2001
From: Minoru TAKAHASHI <takahashi.mino...@gmail.com>
Date: Fri, 24 Jul 2015 13:31:58 +0900
Subject: [PATCH 2/2] ofp-util: Fix group desc request encoding.

Signed-off-by: Minoru TAKAHASHI <takahashi.mino...@gmail.com>
---
 lib/ofp-msgs.h     | 2 +-
 lib/ofp-util.c     | 9 +++++----
 tests/ofp-print.at | 4 ++--
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/lib/ofp-msgs.h b/lib/ofp-msgs.h
index 3d9fedf..85576eb 100644
--- a/lib/ofp-msgs.h
+++ b/lib/ofp-msgs.h
@@ -333,7 +333,7 @@ enum ofpraw {
 
     /* OFPST 1.1-1.4 (7): void. */
     OFPRAW_OFPST11_GROUP_DESC_REQUEST,
-    /* OFPST 1.5+ (7): ovs_be32. */
+    /* OFPST 1.5+ (7): struct ofp15_group_desc_request. */
     OFPRAW_OFPST15_GROUP_DESC_REQUEST,
 
     /* OFPST 1.1+ (7): uint8_t[8][]. */
diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index cdb8553..a0723cb 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -7258,7 +7258,6 @@ ofputil_encode_group_desc_request(enum ofp_version ofp_version,
                                   uint32_t group_id)
 {
     struct ofpbuf *request;
-    ovs_be32 gid;
 
     switch (ofp_version) {
     case OFP10_VERSION:
@@ -7271,12 +7270,14 @@ ofputil_encode_group_desc_request(enum ofp_version ofp_version,
         request = ofpraw_alloc(OFPRAW_OFPST11_GROUP_DESC_REQUEST,
                                ofp_version, 0);
         break;
-    case OFP15_VERSION:
+    case OFP15_VERSION:{
+        struct ofp15_group_desc_request *req;
         request = ofpraw_alloc(OFPRAW_OFPST15_GROUP_DESC_REQUEST,
                                ofp_version, 0);
-        gid = htonl(group_id);
-        ofpbuf_put(request, &gid, sizeof gid);
+        req = ofpbuf_put_zeros(request, sizeof *req);
+        req->group_id = htonl(group_id);
         break;
+    }
     default:
         OVS_NOT_REACHED();
     }
diff --git a/tests/ofp-print.at b/tests/ofp-print.at
index 6e11150..51f59d3 100644
--- a/tests/ofp-print.at
+++ b/tests/ofp-print.at
@@ -2000,8 +2000,8 @@ AT_CLEANUP
 AT_SETUP([OFPST_GROUP_DESC request - OF1.5])
 AT_KEYWORDS([ofp-print OFPT_STATS_REQUEST])
 AT_CHECK([ovs-ofctl ofp-print "\
-06 12 00 14 00 00 00 02 00 07 00 00 00 00 00 00 \
-00 00 00 01
+06 12 00 18 00 00 00 02 00 07 00 00 00 00 00 00 \
+00 00 00 01 00 00 00 00
 "], [0], [OFPST_GROUP_DESC request (OF1.5) (xid=0x2): group_id=1
 ])
 AT_CLEANUP
-- 
1.9.1

_______________________________________________
discuss mailing list
discuss@openvswitch.org
http://openvswitch.org/mailman/listinfo/discuss

Reply via email to