Re: [ovs-dev] [PATCH v2 11/26] vconn: Update length of bundled messages.

2016-07-29 Thread Jarno Rajahalme

> On Jul 29, 2016, at 1:20 PM, Ben Pfaff  wrote:
> 
> On Thu, Jul 28, 2016 at 05:56:03PM -0700, Jarno Rajahalme wrote:
>> Variable length messages need their length updated before they can be
>> added to the bundle.
>> 
>> Message length updating after encoding is sometimes done by the
>> encoding function, but always latest when the message is sent out.  As
>> an OpenFlow message is added to a bundle add message, it will not be
>> sent by itself, and we need to update the length explicitly instead.
>> 
>> Signed-off-by: Jarno Rajahalme 
> 
> Does this need a backport?
> 

Noted, will check.

> Acked-by: Ben Pfaff 

Thanks for the review!

  Jarno

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH v2 11/26] vconn: Update length of bundled messages.

2016-07-29 Thread Ben Pfaff
On Thu, Jul 28, 2016 at 05:56:03PM -0700, Jarno Rajahalme wrote:
> Variable length messages need their length updated before they can be
> added to the bundle.
> 
> Message length updating after encoding is sometimes done by the
> encoding function, but always latest when the message is sent out.  As
> an OpenFlow message is added to a bundle add message, it will not be
> sent by itself, and we need to update the length explicitly instead.
> 
> Signed-off-by: Jarno Rajahalme 

Does this need a backport?

Acked-by: Ben Pfaff 
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH v2 11/26] vconn: Update length of bundled messages.

2016-07-28 Thread Jarno Rajahalme
Variable length messages need their length updated before they can be
added to the bundle.

Message length updating after encoding is sometimes done by the
encoding function, but always latest when the message is sent out.  As
an OpenFlow message is added to a bundle add message, it will not be
sent by itself, and we need to update the length explicitly instead.

Signed-off-by: Jarno Rajahalme 
---
 lib/ofp-util.c | 3 ++-
 lib/vconn.c| 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index 6d73e69..06b48b8 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -10011,13 +10011,14 @@ ofputil_encode_bundle_add(enum ofp_version 
ofp_version,
 request = ofpraw_alloc_xid(ofp_version == OFP13_VERSION
? OFPRAW_ONFT13_BUNDLE_ADD_MESSAGE
: OFPRAW_OFPT14_BUNDLE_ADD_MESSAGE, ofp_version,
-   msg->msg->xid, 0);
+   msg->msg->xid, ntohs(msg->msg->length));
 m = ofpbuf_put_zeros(request, sizeof *m);
 
 m->bundle_id = htonl(msg->bundle_id);
 m->flags = htons(msg->flags);
 ofpbuf_put(request, msg->msg, ntohs(msg->msg->length));
 
+ofpmsg_update_length(request);
 return request;
 }
 
diff --git a/lib/vconn.c b/lib/vconn.c
index 50b4047..917ad28 100644
--- a/lib/vconn.c
+++ b/lib/vconn.c
@@ -1040,12 +1040,13 @@ vconn_bundle_add_msg(struct vconn *vconn, struct 
ofputil_bundle_ctrl_msg *bc,
 struct ofpbuf *request;
 int error;
 
+ofpmsg_update_length(msg);
+
 bam.bundle_id = bc->bundle_id;
 bam.flags = bc->flags;
 bam.msg = msg->data;
 
 request = ofputil_encode_bundle_add(vconn->version, );
-ofpmsg_update_length(request);
 
 error = vconn_send_block(vconn, request);
 if (!error) {
-- 
2.1.4

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev