On Tue, Jan 09, 2018 at 07:55:37AM +0000, Michal Weglicki wrote:
> - New get_custom_stats interface function is added to netdev. It
>   allows particular netdev implementation to expose custom
>   counters in dictionary format (counter name/counter value).
> - New statistics are retrieved using experimenter code and
>   are printed as a result to ofctl dump-ports.
> - New counters are available for OpenFlow 1.4+.
> - New statistics are printed to output via ofctl only if those
>   are present in reply message.
> - New statistics definition is added to include/openflow/intel-ext.h.
> - Custom statistics are implemented only for dpdk-physical
>   port type.
> - DPDK-physical implementation uses xstats to collect statistics.
>   Only dropped and error counters are exposed.
> 
> v1->v2:
> - Buffer overrun check in parse_intel_port_custom_property.
> - ofputil_append_ofp14_port_stats uses "postappend" instead
>   of "reserve" during message creation.
> - NEWS update.
> - DPDK documentation update.
> - Compilation and sparse warnings corrections.
> v2->v3:
> - Netdev statistics and custom statistics are inserted into
>   ovsdb at the same time (in single transaction).
> - ofproto_class function has been removed, direct call is
>   used instead.
> - Current "dump ports" test case has been adjusted to check
>   also custom counters.
> - Some other minor corrections.
> v3->v4:
> - netdev-dpdk: "management" counters are added to custom
>   statistics.
> 
> Co-authored-by: Ben Pfaff <[email protected]>
> Signed-off-by: Ben Pfaff <[email protected]>
> Signed-off-by: Michal Weglicki <[email protected]>

Thanks for the patch!

I noticed some oddities in the test and figured out that what was going
on was some white space at the end of lines, so I fixed up the code to
avoid white space at the end of lines and the test to match.  I also
deleted some code that checked for a NULL return value from xmalloc(),
which can't happen.  I'm appending what I folded in.

With those changes, I applied this to master.

Thanks again!

--8<--------------------------cut here-------------------------->8--

diff --git a/lib/ofp-print.c b/lib/ofp-print.c
index 6c64cd267bc0..8a1f426ade36 100644
--- a/lib/ofp-print.c
+++ b/lib/ofp-print.c
@@ -1960,8 +1960,10 @@ ofp_print_ofpst_port_reply(struct ds *string, const 
struct ofp_header *oh,
                     if (i % 3 == 0) {
                         ds_put_cstr(string, "\n");
                         ds_put_cstr(string, "                      ");
+                    } else {
+                        ds_put_char(string, ' ');
                     }
-                    ds_put_format(string, "%s=%"PRIu64", ",
+                    ds_put_format(string, "%s=%"PRIu64",",
                                   ps.custom_stats.counters[i].name,
                                   ps.custom_stats.counters[i].value);
                 }
diff --git a/tests/ofproto.at b/tests/ofproto.at
index c5eb5f654d57..ec1dc5161309 100644
--- a/tests/ofproto.at
+++ b/tests/ofproto.at
@@ -105,14 +105,14 @@ AT_CLEANUP
 AT_SETUP([ofproto - port stats - (OpenFlow 1.4)])
 OVS_VSWITCHD_START
 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn dump-ports br0], [0], [stdout])
-AT_CHECK_UNQUOTED([strip_xids < stdout | sed 
's/duration=[[0-9.]]*s/duration=?s/'],
+AT_CHECK([strip_xids < stdout | sed 's/duration=[[0-9.]]*s/duration=?s/'],
   [0], [dnl
-$(echo 'OFPST_PORT reply (OF1.4): 1 ports
+OFPST_PORT reply (OF1.4): 1 ports
   port LOCAL: rx pkts=0, bytes=0, drop=?, errs=?, frame=?, over=?, crc=?
            tx pkts=0, bytes=0, drop=?, errs=?, coll=?
            duration=?s
            CUSTOM Statistics
-                      rx_custom_packets_1=0, rx_custom_packets_2=0, ')
+                      rx_custom_packets_1=0, rx_custom_packets_2=0,
 ])
 OVS_VSWITCHD_STOP
 AT_CLEANUP
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 28c96c1cb64d..d80da1cdd6e9 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -2401,11 +2401,6 @@ iface_refresh_stats(struct iface *iface)
     int64_t *values = xmalloc(counters_size * sizeof(int64_t));
     const char **keys = xmalloc(counters_size * sizeof(char *));
 
-    if ((keys == NULL) || (values == NULL)) {
-        VLOG_ERR("Can't allocate memory to get statistics!");
-        return;
-    }
-
     /* Intentionally ignore return value, since errors will set 'stats' to
      * all-1s, and we will deal with that correctly below. */
     netdev_get_stats(iface->netdev, &stats);
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to