I applied this to master and added that tag.

Thanks,

Ben.

On Tue, Sep 26, 2017 at 09:45:16AM +0000, Fischetti, Antonio wrote:
> Actually I forgot to add in the commit message
> 
> Reviewed-by: Greg Rose <gvrose8...@gmail.com>
> 
> Can this please be added later?
> 
> Thanks, Antonio
> 
> > -----Original Message-----
> > From: ovs-dev-boun...@openvswitch.org 
> > [mailto:ovs-dev-boun...@openvswitch.org]
> > On Behalf Of antonio.fische...@intel.com
> > Sent: Tuesday, September 26, 2017 10:37 AM
> > To: d...@openvswitch.org
> > Subject: [ovs-dev] [PATCH v2] dpctl: manage ret value when dumping CT 
> > entries.
> > 
> > Manage error value returned by ct_dpif_dump_next.
> > 
> > Signed-off-by: Antonio Fischetti <antonio.fische...@intel.com>
> > ---
> >  lib/dpctl.c | 27 ++++++++++++++++++++++++---
> >  1 file changed, 24 insertions(+), 3 deletions(-)
> > 
> > diff --git a/lib/dpctl.c b/lib/dpctl.c
> > index 8951d6e..d229c97 100644
> > --- a/lib/dpctl.c
> > +++ b/lib/dpctl.c
> > @@ -1286,7 +1286,7 @@ dpctl_dump_conntrack(int argc, const char *argv[],
> >          return error;
> >      }
> > 
> > -    while (!ct_dpif_dump_next(dump, &cte)) {
> > +    while (!(error = ct_dpif_dump_next(dump, &cte))) {
> >          struct ds s = DS_EMPTY_INITIALIZER;
> > 
> >          ct_dpif_format_entry(&cte, &s, dpctl_p->verbosity,
> > @@ -1296,6 +1296,13 @@ dpctl_dump_conntrack(int argc, const char *argv[],
> >          dpctl_print(dpctl_p, "%s\n", ds_cstr(&s));
> >          ds_destroy(&s);
> >      }
> > +    if (error == EOF) {
> > +        /* Any CT entry was dumped with no issue. */
> > +        error = 0;
> > +    } else if (error) {
> > +        dpctl_error(dpctl_p, error, "dumping conntrack entry");
> > +    }
> > +
> >      ct_dpif_dump_done(dump);
> >      dpif_close(dpif);
> >      return error;
> > @@ -1384,7 +1391,7 @@ dpctl_ct_stats_show(int argc, const char *argv[],
> >      }
> > 
> >      int tot_conn = 0;
> > -    while (!ct_dpif_dump_next(dump, &cte)) {
> > +    while (!(error = ct_dpif_dump_next(dump, &cte))) {
> >          ct_dpif_entry_uninit(&cte);
> >          tot_conn++;
> >          switch (cte.tuple_orig.ip_proto) {
> > @@ -1425,6 +1432,13 @@ dpctl_ct_stats_show(int argc, const char *argv[],
> >              break;
> >          }
> >      }
> > +    if (error == EOF) {
> > +        /* All CT entries were dumped with no issue.  */
> > +        error = 0;
> > +    } else if (error) {
> > +        dpctl_error(dpctl_p, error, "dumping conntrack entry");
> > +        /* Fall through to show any other info we collected. */
> > +    }
> > 
> >      dpctl_print(dpctl_p, "Connections Stats:\n    Total: %d\n", tot_conn);
> >      if (proto_stats[CT_STATS_TCP]) {
> > @@ -1521,7 +1535,7 @@ dpctl_ct_bkts(int argc, const char *argv[],
> >      int tot_conn = 0;
> >      uint32_t *conn_per_bkts = xzalloc(tot_bkts * sizeof(uint32_t));
> > 
> > -    while (!ct_dpif_dump_next(dump, &cte)) {
> > +    while (!(error = ct_dpif_dump_next(dump, &cte))) {
> >          ct_dpif_entry_uninit(&cte);
> >          tot_conn++;
> >          if (tot_bkts > 0) {
> > @@ -1533,6 +1547,13 @@ dpctl_ct_bkts(int argc, const char *argv[],
> >              }
> >          }
> >      }
> > +    if (error == EOF) {
> > +        /* All CT entries were dumped with no issue.  */
> > +        error = 0;
> > +    } else if (error) {
> > +        dpctl_error(dpctl_p, error, "dumping conntrack entry");
> > +        /* Fall through and display all the collected info.  */
> > +    }
> > 
> >      dpctl_print(dpctl_p, "Current Connections: %d\n", tot_conn);
> >      dpctl_print(dpctl_p, "\n");
> > --
> > 2.4.11
> > 
> > _______________________________________________
> > dev mailing list
> > d...@openvswitch.org
> > https://mail.openvswitch.org/mailman/listinfo/ovs-dev
> _______________________________________________
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to