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.

## ------------------------------ ##

## openvswitch 2.4.90 test suite. ##

## ------------------------------ ##


692: ofproto - no group support (OpenFlow 1.0)       ok

693: ofproto - del group (OpenFlow 1.1)              ok

694: ofproto - add indirect group                    ok

695: ofproto - del group (OpenFlow 1.5)              ok

696: ofproto - del group deletes flows               ok

Could you please take another look on the patches.

Thanks!

>>
> 
> OK, I will try to make a patch.
> Please, wait a while.
> 
> thanks,
> 
>From 372ec56af0e9071a906f6271e38d7df7cd22c5d3 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 5f84c25a57abc02339fcde99888d146f2bb51846 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 | 2 +-
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/lib/ofp-msgs.h b/lib/ofp-msgs.h
index 23c334a..344dce2 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 0f9a38d..bf30532 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -7076,7 +7076,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:
@@ -7089,12 +7088,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 c2250d0..b39ccb2 100644
--- a/tests/ofp-print.at
+++ b/tests/ofp-print.at
@@ -2000,7 +2000,7 @@ 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 \
+06 12 00 18 00 00 00 02 00 07 00 00 00 00 00 00 \
 00 00 00 01
 "], [0], [OFPST_GROUP_DESC request (OF1.5) (xid=0x2): group_id=1
 ])
-- 
1.9.1

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

Reply via email to