diff mbox series

[ovs-dev,1/6] ofp-util: Use consistent naming convention.

Message ID 20180216225445.28688-1-blp@ovn.org
State Accepted
Headers show
Series [ovs-dev,1/6] ofp-util: Use consistent naming convention. | expand

Commit Message

Ben Pfaff Feb. 16, 2018, 10:54 p.m. UTC
Most of the tree now uses "encode" as the verb for making an OpenFlow
message, so adopt it here in this very old code as well.

Signed-off-by: Ben Pfaff <blp@ovn.org>
---
 include/openvswitch/ofp-util.h | 4 ++--
 lib/learning-switch.c          | 2 +-
 lib/ofp-util.c                 | 4 ++--
 lib/rconn.c                    | 2 +-
 ofproto/ofproto.c              | 2 +-
 ovn/controller/ofctrl.c        | 2 +-
 ovn/controller/pinctrl.c       | 2 +-
 utilities/ovs-ofctl.c          | 4 ++--
 8 files changed, 11 insertions(+), 11 deletions(-)

Comments

Justin Pettit Feb. 28, 2018, 11:48 p.m. UTC | #1
> On Feb 16, 2018, at 2:54 PM, Ben Pfaff <blp@ovn.org> wrote:
> 
> Most of the tree now uses "encode" as the verb for making an OpenFlow
> message, so adopt it here in this very old code as well.
> 
> Signed-off-by: Ben Pfaff <blp@ovn.org>

Acked-by: Justin Pettit <jpettit@ovn.org>

--Justin
Ben Pfaff March 1, 2018, 12:49 a.m. UTC | #2
On Wed, Feb 28, 2018 at 03:48:49PM -0800, Justin Pettit wrote:
> 
> > On Feb 16, 2018, at 2:54 PM, Ben Pfaff <blp@ovn.org> wrote:
> > 
> > Most of the tree now uses "encode" as the verb for making an OpenFlow
> > message, so adopt it here in this very old code as well.
> > 
> > Signed-off-by: Ben Pfaff <blp@ovn.org>
> 
> Acked-by: Justin Pettit <jpettit@ovn.org>

Thanks, I applied this patch (only) to master.
diff mbox series

Patch

diff --git a/include/openvswitch/ofp-util.h b/include/openvswitch/ofp-util.h
index f45877ba2c7a..1f4b23eb5190 100644
--- a/include/openvswitch/ofp-util.h
+++ b/include/openvswitch/ofp-util.h
@@ -31,8 +31,8 @@  bool ofputil_decode_hello(const struct ofp_header *,
                           uint32_t *allowed_versions);
 struct ofpbuf *ofputil_encode_hello(uint32_t version_bitmap);
 
-struct ofpbuf *make_echo_request(enum ofp_version);
-struct ofpbuf *make_echo_reply(const struct ofp_header *);
+struct ofpbuf *ofputil_encode_echo_request(enum ofp_version);
+struct ofpbuf *ofputil_encode_echo_reply(const struct ofp_header *);
 
 struct ofpbuf *ofputil_encode_barrier_request(enum ofp_version);
 
diff --git a/lib/learning-switch.c b/lib/learning-switch.c
index db520325c681..3a9e015bbe9c 100644
--- a/lib/learning-switch.c
+++ b/lib/learning-switch.c
@@ -618,7 +618,7 @@  process_packet_in(struct lswitch *sw, const struct ofp_header *oh)
 static void
 process_echo_request(struct lswitch *sw, const struct ofp_header *rq)
 {
-    queue_tx(sw, make_echo_reply(rq));
+    queue_tx(sw, ofputil_encode_echo_reply(rq));
 }
 
 static ofp_port_t
diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index df5a9dcb9777..c78c856eaf81 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -176,7 +176,7 @@  ofputil_encode_hello(uint32_t allowed_versions)
 
 /* Creates and returns an OFPT_ECHO_REQUEST message with an empty payload. */
 struct ofpbuf *
-make_echo_request(enum ofp_version ofp_version)
+ofputil_encode_echo_request(enum ofp_version ofp_version)
 {
     return ofpraw_alloc_xid(OFPRAW_OFPT_ECHO_REQUEST, ofp_version,
                             htonl(0), 0);
@@ -185,7 +185,7 @@  make_echo_request(enum ofp_version ofp_version)
 /* Creates and returns an OFPT_ECHO_REPLY message matching the
  * OFPT_ECHO_REQUEST message in 'rq'. */
 struct ofpbuf *
-make_echo_reply(const struct ofp_header *rq)
+ofputil_encode_echo_reply(const struct ofp_header *rq)
 {
     struct ofpbuf rq_buf = ofpbuf_const_initializer(rq, ntohs(rq->length));
     ofpraw_pull_assert(&rq_buf);
diff --git a/lib/rconn.c b/lib/rconn.c
index 2eebbff70bd6..3cad259d0178 100644
--- a/lib/rconn.c
+++ b/lib/rconn.c
@@ -581,7 +581,7 @@  run_ACTIVE(struct rconn *rc)
          * anything.) */
         int version = rconn_get_version__(rc);
         if (version >= 0 && version <= 0xff) {
-            rconn_send__(rc, make_echo_request(version), NULL);
+            rconn_send__(rc, ofputil_encode_echo_request(version), NULL);
         }
 
         return;
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index f28bb896eee9..f4604209e43f 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -3203,7 +3203,7 @@  learned_cookies_flush(struct ofproto *ofproto, struct ovs_list *dead_cookies)
 static enum ofperr
 handle_echo_request(struct ofconn *ofconn, const struct ofp_header *oh)
 {
-    ofconn_send_reply(ofconn, make_echo_reply(oh));
+    ofconn_send_reply(ofconn, ofputil_encode_echo_reply(oh));
     return 0;
 }
 
diff --git a/ovn/controller/ofctrl.c b/ovn/controller/ofctrl.c
index 897ff3694bfa..fc712f679008 100644
--- a/ovn/controller/ofctrl.c
+++ b/ovn/controller/ofctrl.c
@@ -607,7 +607,7 @@  static void
 ofctrl_recv(const struct ofp_header *oh, enum ofptype type)
 {
     if (type == OFPTYPE_ECHO_REQUEST) {
-        queue_msg(make_echo_reply(oh));
+        queue_msg(ofputil_encode_echo_reply(oh));
     } else if (type == OFPTYPE_ERROR) {
         static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(30, 300);
         log_openflow_rl(&rl, VLL_INFO, oh, "OpenFlow error");
diff --git a/ovn/controller/pinctrl.c b/ovn/controller/pinctrl.c
index e34916f5c387..5b936754c55a 100644
--- a/ovn/controller/pinctrl.c
+++ b/ovn/controller/pinctrl.c
@@ -1034,7 +1034,7 @@  pinctrl_recv(const struct ofp_header *oh, enum ofptype type,
              struct controller_ctx *ctx)
 {
     if (type == OFPTYPE_ECHO_REQUEST) {
-        queue_msg(make_echo_reply(oh));
+        queue_msg(ofputil_encode_echo_reply(oh));
     } else if (type == OFPTYPE_GET_CONFIG_REPLY) {
         /* Enable asynchronous messages */
         struct ofputil_switch_config config;
diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
index e47891ddb353..e82bb12cae10 100644
--- a/utilities/ovs-ofctl.c
+++ b/utilities/ovs-ofctl.c
@@ -2161,7 +2161,7 @@  monitor_vconn(struct vconn *vconn, bool reply_to_echo_requests,
                 if (reply_to_echo_requests) {
                     struct ofpbuf *reply;
 
-                    reply = make_echo_reply(b->data);
+                    reply = ofputil_encode_echo_reply(b->data);
                     retval = vconn_send_block(vconn, reply);
                     if (retval) {
                         ovs_fatal(retval, "failed to send echo reply");
@@ -2359,7 +2359,7 @@  ofctl_probe(struct ovs_cmdl_context *ctx)
     struct ofpbuf *reply;
 
     open_vconn(ctx->argv[1], &vconn);
-    request = make_echo_request(vconn_get_version(vconn));
+    request = ofputil_encode_echo_request(vconn_get_version(vconn));
     run(vconn_transact(vconn, request, &reply), "talking to %s", ctx->argv[1]);
     if (reply->size != sizeof(struct ofp_header)) {
         ovs_fatal(0, "reply does not match request");