Thanks for the review. The example given in coding style have switch and
case aligned.  But it is not my editors' default C format style. It is
fixed now.

Pushed to the master after adjusting the indentation.


On Thu, Jan 23, 2014 at 2:45 PM, Ben Pfaff <b...@nicira.com> wrote:

> On Thu, Jan 02, 2014 at 02:09:11PM -0800, Andy Zhou wrote:
> > The dummy ports thus far only support passive connections. It can
> > listen for multiple incoming connection requests but not make active
> > connections. This patch adds support of active stream, so that a
> > dummy port can be configured with either passive or active connections.
> >
> > The net result is that dummy ports can now connect to each other,
> > without being patch ports. This feature will be useful in adding test
> > cases of future commits.
> >
> > Signed-off-by: Andy Zhou <az...@nicira.com>
>
> I'm happy with this.  Thank you.
>
> Some of the indentation is not how we usually do it, for example this:
>     switch (reconnect_run(rconn->reconnect, time_msec())) {
>         case RECONNECT_CONNECT: {
>             int err = stream_connect(rconn->rstream->stream);
>
>             switch (err) {
>             case 0: /* Connected. */
>                 reconnect_connected(rconn->reconnect, time_msec());
>                 dev->conn.type = ACTIVE;
>                 break;
>
>             case EAGAIN:
>                 reconnect_connecting(rconn->reconnect, time_msec());
>                 return;
>
>             default:
>                 reconnect_connect_failed(rconn->reconnect,
>                                          time_msec(), err);
>                 stream_close(rconn->rstream->stream);
>                 return;
>             }
>         }
>             break;
>
>         case RECONNECT_DISCONNECT:
>         case RECONNECT_PROBE:
>         default:
>             break;
>     }
> I would ordinarily indent as:
>     switch (reconnect_run(rconn->reconnect, time_msec())) {
>     case RECONNECT_CONNECT: {
>         int err = stream_connect(rconn->rstream->stream);
>
>         switch (err) {
>         case 0: /* Connected. */
>             reconnect_connected(rconn->reconnect, time_msec());
>             dev->conn.type = ACTIVE;
>             break;
>
>         case EAGAIN:
>             reconnect_connecting(rconn->reconnect, time_msec());
>             return;
>
>         default:
>             reconnect_connect_failed(rconn->reconnect,
>                                      time_msec(), err);
>             stream_close(rconn->rstream->stream);
>             return;
>         }
>         break;
>     }
>
>         case RECONNECT_DISCONNECT:
>         case RECONNECT_PROBE:
>         default:
>             break;
>     }
> (even though the two }s at the same level are confusing, it's how
> we've being doing it) and similarly for the other switch statements.
>
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to