[ovs-dev] [PATCH 03/13] dpctl: Remove tabs from output.

Ben Pfaff blp at ovn.org
Mon Jun 4 21:27:40 UTC 2018


OVS uses spaces for indentation in source code and it makes sense for it to
also use spaces for indentation in output.  Spaces also consume less
horizontal space in output, which often makes it easier to read.  This
commit transitions one part of output from tabs to spaces and updates
appropriate parts of the tests to match.

Signed-off-by: Ben Pfaff <blp at ovn.org>
---
 lib/dpctl.c           | 34 +++++++++++++++++-----------------
 tests/dpctl.at        | 26 +++++++++++++-------------
 tests/ofproto-dpif.at |  4 ++--
 tests/pmd.at          | 10 +++++-----
 4 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/lib/dpctl.c b/lib/dpctl.c
index 47f4182c7be8..ec8c51e4b0a7 100644
--- a/lib/dpctl.c
+++ b/lib/dpctl.c
@@ -535,14 +535,14 @@ show_dpif(struct dpif *dpif, struct dpctl_params *dpctl_p)
 
     dpctl_print(dpctl_p, "%s:\n", dpif_name(dpif));
     if (!dpif_get_dp_stats(dpif, &stats)) {
-        dpctl_print(dpctl_p, "\tlookups: hit:%"PRIu64" missed:%"PRIu64
-                             " lost:%"PRIu64"\n\tflows: %"PRIu64"\n",
+        dpctl_print(dpctl_p, "  lookups: hit:%"PRIu64" missed:%"PRIu64
+                             " lost:%"PRIu64"\n  flows: %"PRIu64"\n",
                     stats.n_hit, stats.n_missed, stats.n_lost, stats.n_flows);
         if (stats.n_masks != UINT32_MAX) {
             uint64_t n_pkts = stats.n_hit + stats.n_missed;
             double avg = n_pkts ? (double) stats.n_mask_hit / n_pkts : 0.0;
 
-            dpctl_print(dpctl_p, "\tmasks: hit:%"PRIu64" total:%"PRIu32
+            dpctl_print(dpctl_p, "  masks: hit:%"PRIu64" total:%"PRIu32
                                  " hit/pkt:%.2f\n",
                         stats.n_mask_hit, stats.n_masks, avg);
         }
@@ -569,7 +569,7 @@ show_dpif(struct dpif *dpif, struct dpctl_params *dpctl_p)
             continue;
         }
 
-        dpctl_print(dpctl_p, "\tport %u: %s",
+        dpctl_print(dpctl_p, "  port %u: %s",
                     dpif_port.port_no, dpif_port.name);
 
         if (strcmp(dpif_port.type, "system")) {
@@ -620,24 +620,24 @@ show_dpif(struct dpif *dpif, struct dpctl_params *dpctl_p)
             error = netdev_get_stats(netdev, &s);
             if (!error) {
                 netdev_close(netdev);
-                print_stat(dpctl_p, "\t\tRX packets:", s.rx_packets);
+                print_stat(dpctl_p, "    RX packets:", s.rx_packets);
                 print_stat(dpctl_p, " errors:", s.rx_errors);
                 print_stat(dpctl_p, " dropped:", s.rx_dropped);
                 print_stat(dpctl_p, " overruns:", s.rx_over_errors);
                 print_stat(dpctl_p, " frame:", s.rx_frame_errors);
                 dpctl_print(dpctl_p, "\n");
 
-                print_stat(dpctl_p, "\t\tTX packets:", s.tx_packets);
+                print_stat(dpctl_p, "    TX packets:", s.tx_packets);
                 print_stat(dpctl_p, " errors:", s.tx_errors);
                 print_stat(dpctl_p, " dropped:", s.tx_dropped);
                 print_stat(dpctl_p, " aborted:", s.tx_aborted_errors);
                 print_stat(dpctl_p, " carrier:", s.tx_carrier_errors);
                 dpctl_print(dpctl_p, "\n");
 
-                print_stat(dpctl_p, "\t\tcollisions:", s.collisions);
+                print_stat(dpctl_p, "    collisions:", s.collisions);
                 dpctl_print(dpctl_p, "\n");
 
-                print_stat(dpctl_p, "\t\tRX bytes:", s.rx_bytes);
+                print_stat(dpctl_p, "    RX bytes:", s.rx_bytes);
                 print_human_size(dpctl_p, s.rx_bytes);
                 print_stat(dpctl_p, "  TX bytes:", s.tx_bytes);
                 print_human_size(dpctl_p, s.tx_bytes);
@@ -1510,9 +1510,9 @@ dpctl_ct_stats_show(int argc, const char *argv[],
 
     dpctl_print(dpctl_p, "Connections Stats:\n    Total: %d\n", tot_conn);
     if (proto_stats[CT_STATS_TCP]) {
-        dpctl_print(dpctl_p, "\tTCP: %d\n", proto_stats[CT_STATS_TCP]);
+        dpctl_print(dpctl_p, "  TCP: %d\n", proto_stats[CT_STATS_TCP]);
         if (verbose) {
-            dpctl_print(dpctl_p, "\t  Conn per TCP states:\n");
+            dpctl_print(dpctl_p, "    Conn per TCP states:\n");
             for (int i = 0; i < CT_DPIF_TCPS_MAX_NUM; i++) {
                 if (tcp_conn_per_states[i]) {
                     struct ds s = DS_EMPTY_INITIALIZER;
@@ -1524,25 +1524,25 @@ dpctl_ct_stats_show(int argc, const char *argv[],
         }
     }
     if (proto_stats[CT_STATS_UDP]) {
-        dpctl_print(dpctl_p, "\tUDP: %d\n", proto_stats[CT_STATS_UDP]);
+        dpctl_print(dpctl_p, "  UDP: %d\n", proto_stats[CT_STATS_UDP]);
     }
     if (proto_stats[CT_STATS_UDPLITE]) {
-        dpctl_print(dpctl_p, "\tUDPLITE: %d\n", proto_stats[CT_STATS_UDPLITE]);
+        dpctl_print(dpctl_p, "  UDPLITE: %d\n", proto_stats[CT_STATS_UDPLITE]);
     }
     if (proto_stats[CT_STATS_SCTP]) {
-        dpctl_print(dpctl_p, "\tSCTP: %d\n", proto_stats[CT_STATS_SCTP]);
+        dpctl_print(dpctl_p, "  SCTP: %d\n", proto_stats[CT_STATS_SCTP]);
     }
     if (proto_stats[CT_STATS_ICMP]) {
-        dpctl_print(dpctl_p, "\tICMP: %d\n", proto_stats[CT_STATS_ICMP]);
+        dpctl_print(dpctl_p, "  ICMP: %d\n", proto_stats[CT_STATS_ICMP]);
     }
     if (proto_stats[CT_STATS_DCCP]) {
-        dpctl_print(dpctl_p, "\tDCCP: %d\n", proto_stats[CT_STATS_DCCP]);
+        dpctl_print(dpctl_p, "  DCCP: %d\n", proto_stats[CT_STATS_DCCP]);
     }
     if (proto_stats[CT_STATS_IGMP]) {
-        dpctl_print(dpctl_p, "\tIGMP: %d\n", proto_stats[CT_STATS_IGMP]);
+        dpctl_print(dpctl_p, "  IGMP: %d\n", proto_stats[CT_STATS_IGMP]);
     }
     if (proto_stats[CT_STATS_OTHER]) {
-        dpctl_print(dpctl_p, "\tOther: %d\n", proto_stats[CT_STATS_OTHER]);
+        dpctl_print(dpctl_p, "  Other: %d\n", proto_stats[CT_STATS_OTHER]);
     }
 
     ct_dpif_dump_done(dump);
diff --git a/tests/dpctl.at b/tests/dpctl.at
index 8c761c8329d4..deec54959fce 100644
--- a/tests/dpctl.at
+++ b/tests/dpctl.at
@@ -21,17 +21,17 @@ OVS_VSWITCHD_START([], [], [=override])
 AT_CHECK([ovs-appctl dpctl/add-dp dummy at br0])
 AT_CHECK([ovs-appctl dpctl/show dummy at br0], [0], [dnl
 dummy at br0:
-	lookups: hit:0 missed:0 lost:0
-	flows: 0
-	port 0: br0 (dummy-internal)
+  lookups: hit:0 missed:0 lost:0
+  flows: 0
+  port 0: br0 (dummy-internal)
 ])
 AT_CHECK([ovs-appctl dpctl/add-if dummy at br0 vif1.0,type=dummy,port_no=5])
 AT_CHECK([ovs-appctl dpctl/show dummy at br0], [0], [dnl
 dummy at br0:
-	lookups: hit:0 missed:0 lost:0
-	flows: 0
-	port 0: br0 (dummy-internal)
-	port 5: vif1.0 (dummy)
+  lookups: hit:0 missed:0 lost:0
+  flows: 0
+  port 0: br0 (dummy-internal)
+  port 5: vif1.0 (dummy)
 ])
 AT_CHECK([ovs-appctl dpctl/add-if dummy at br0 vif1.0,type=dummy], [2], [],
   [stderr])
@@ -52,9 +52,9 @@ ovs-appctl: ovs-vswitchd: server returned an error
 AT_CHECK([ovs-appctl dpctl/del-if dummy at br0 vif1.0])
 AT_CHECK([ovs-appctl dpctl/show dummy at br0], [0], [dnl
 dummy at br0:
-	lookups: hit:0 missed:0 lost:0
-	flows: 0
-	port 0: br0 (dummy-internal)
+  lookups: hit:0 missed:0 lost:0
+  flows: 0
+  port 0: br0 (dummy-internal)
 ])
 AT_CHECK([ovs-appctl dpctl/del-if dummy at br0 vif1.0], [2], [],
   [ovs-vswitchd: no port named vif1.0
@@ -62,9 +62,9 @@ ovs-appctl: ovs-vswitchd: server returned an error
 ])
 AT_CHECK([ovs-appctl dpctl/show dummy at br0], [0], [dnl
 dummy at br0:
-	lookups: hit:0 missed:0 lost:0
-	flows: 0
-	port 0: br0 (dummy-internal)
+  lookups: hit:0 missed:0 lost:0
+  flows: 0
+  port 0: br0 (dummy-internal)
 ])
 AT_CHECK([ovs-appctl dpctl/del-if dummy at br0 nonexistent], [2], [],
   [ovs-vswitchd: no port named nonexistent
diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index d827d5333116..2bfbfa2f3445 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -6627,8 +6627,8 @@ AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
 AT_CHECK([ovs-vsctl add-br int-br -- set bridge int-br datapath_type=dummy], [0])
 AT_CHECK([ovs-vsctl -- add-port int-br t1 -- set Interface t1 type=gre \
                        options:remote_ip=1.1.2.92 options:key=456 ofport_request=4\
-		    -- add-port int-br vm1 -- set Interface vm1 type=dummy \
-		       options:ifindex=2011 ofport_request=5
+                    -- add-port int-br vm1 -- set Interface vm1 type=dummy \
+                       options:ifindex=2011 ofport_request=5
                        ], [0])
 
 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
diff --git a/tests/pmd.at b/tests/pmd.at
index 532a182ba8c2..2957daf4d64e 100644
--- a/tests/pmd.at
+++ b/tests/pmd.at
@@ -681,11 +681,11 @@ p1 0 0 0
 
 AT_CHECK([ovs-appctl dpctl/show dummy at dp0], [0], [dnl
 dummy at dp0:
-	lookups: hit:0 missed:0 lost:0
-	flows: 0
-	port 0: dp0 (dummy-internal)
-	port 1: p1 (dummy-pmd: configured_rx_queues=1, configured_tx_queues=1, requested_rx_queues=1, requested_tx_queues=1)
-	port 2: p2 (dummy)
+  lookups: hit:0 missed:0 lost:0
+  flows: 0
+  port 0: dp0 (dummy-internal)
+  port 1: p1 (dummy-pmd: configured_rx_queues=1, configured_tx_queues=1, requested_rx_queues=1, requested_tx_queues=1)
+  port 2: p2 (dummy)
 ])
 
 AT_CHECK([ovs-appctl dpctl/add-flow dummy at dp0 'in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x1234)' 2], [0], [dnl
-- 
2.16.1



More information about the dev mailing list