Did not review this as this seems to be already reviewed. Jarno
On Jun 30, 2014, at 1:11 PM, Ethan Jackson <et...@nicira.com> wrote: > From: Gurucharan Shetty <gshe...@nicira.com> > > This just makes ovs-benchmark compile on windows. > This lets us go ahead with just a 'make' instead of > picking and choosing executables that are tested to work on > windows as arguments for make. > > This commit does not make ovs-benchmark a supported utility > on windows. > > Signed-off-by: Gurucharan Shetty <gshe...@nicira.com> > Acked-by: Ben Pfaff <b...@nicira.com> > --- > BUILD.Windows | 10 +++++----- > utilities/ovs-benchmark.c | 30 ++++++++++++++++++------------ > 2 files changed, 23 insertions(+), 17 deletions(-) > > diff --git a/BUILD.Windows b/BUILD.Windows > index f8f13e9..2ff17ee 100644 > --- a/BUILD.Windows > +++ b/BUILD.Windows > @@ -58,11 +58,11 @@ or from a distribution tar ball. > > * Run make for the ported executables in the top source directory, e.g.: > > - % make lib/vswitch-idl.h lib/vtep-idl.h ofproto/ipfix-entities.def > - % make ovsdb/ovsdb-server.exe ovsdb/ovsdb-tool.exe ovsdb/ovsdb-client.exe \ > - utilities/ovs-vsctl.exe utilities/ovs-ofctl.exe \ > - utilities/ovs-dpctl.exe vswitchd/ovs-vswitchd.exe \ > - utilities/ovs-appctl.exe > + % make > + > +* To run all the unit tests: > + > + % make check > > OpenSSL, Open vSwitch and Visual C++ > ------------------------------------ > diff --git a/utilities/ovs-benchmark.c b/utilities/ovs-benchmark.c > index 0bb316f..386e654 100644 > --- a/utilities/ovs-benchmark.c > +++ b/utilities/ovs-benchmark.c > @@ -54,14 +54,26 @@ static const struct command *get_all_commands(void); > static void parse_options(int argc, char *argv[]); > static void usage(void); > > +static int > +do_poll(struct pollfd *fds, int nfds, int timeout) > +{ > + int retval; > +#ifndef _WIN32 > + do { > + retval = poll(fds, nfds, timeout); > + } while (retval < 0 && errno == EINTR); > +#else > + retval = WSAPoll(fds, nfds, timeout); > +#endif > + return retval; > +} > + > static long long int > time_in_msec(void) > { > struct timeval tv; > > - if (gettimeofday(&tv, NULL) < 0) { > - ovs_fatal(errno, "gettimeofday"); > - } > + xgettimeofday(&tv); > > return tv.tv_sec * 1000LL + tv.tv_usec / 1000; > } > @@ -284,9 +296,7 @@ cmd_listen(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) > for (;;) { > int retval; > > - do { > - retval = poll(fds, n_fds, -1); > - } while (retval < 0 && errno == EINTR); > + retval = do_poll(fds, n_fds, -1); > if (retval < 0) { > ovs_fatal(errno, "poll failed"); > } > @@ -445,9 +455,7 @@ cmd_rate(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) > delay = 1000; > } > > - do { > - error = poll(fds, n_fds, delay) < 0 ? errno : 0; > - } while (error == EINTR); > + error = do_poll(fds, n_fds, delay); > if (error) { > ovs_fatal(errno, "poll"); > } > @@ -578,9 +586,7 @@ cmd_latency(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) > while (n_fds > 0) { > int error; > > - do { > - error = poll(fds, n_fds, -1) < 0 ? errno : 0; > - } while (error == EINTR); > + error = do_poll(fds, n_fds, -1); > if (error) { > ovs_fatal(errno, "poll"); > } > -- > 1.8.1.2 > > _______________________________________________ > dev mailing list > dev@openvswitch.org > http://openvswitch.org/mailman/listinfo/dev _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev