On Fri, May 17, 2013 at 3:23 PM, Ben Pfaff <b...@nicira.com> wrote:

> Ethan pointed out that this wasn't very useful.
>
> Signed-off-by: Ben Pfaff <b...@nicira.com>
> ---
>  lib/netdev-dummy.c    |   16 +++-------------
>  tests/ofproto-dpif.at |   24 ++++++++----------------
>  2 files changed, 11 insertions(+), 29 deletions(-)
>
> diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c
> index ce84a0c..8c182a3 100644
> --- a/lib/netdev-dummy.c
> +++ b/lib/netdev-dummy.c
> @@ -441,24 +441,19 @@ eth_from_packet_or_flow(const char *s)
>      return packet;
>  }
>
> -static int
> +static void
>  netdev_dummy_queue_packet(struct netdev_dummy *dummy,
>                            const void *data, size_t size)
>  {
>      struct netdev_rx_dummy *rx;
> -    int n_listeners;
>
> -    n_listeners = 0;
>      LIST_FOR_EACH (rx, node, &dummy->rxes) {
>          if (rx->recv_queue_len < NETDEV_DUMMY_MAX_QUEUE) {
>              struct ofpbuf *copy = ofpbuf_clone_data(data, size);
>              list_push_back(&rx->recv_queue, &copy->list_node);
>              rx->recv_queue_len++;
> -            n_listeners++;
>          }
>      }
> -
> -    return n_listeners;
>  }
>
>  static void
> @@ -488,16 +483,11 @@ netdev_dummy_receive(struct unixctl_conn *conn,
>          dummy_dev->stats.rx_packets++;
>          dummy_dev->stats.rx_bytes += packet->size;
>
> -        n_listeners += netdev_dummy_queue_packet(dummy_dev,
> -                                                 packet->data,
> packet->size);
> +        netdev_dummy_queue_packet(dummy_dev, packet->data, packet->size);
>          ofpbuf_delete(packet);
>      }
>
> -    if (!n_listeners) {
> -        unixctl_command_reply(conn, "packets queued but nobody listened");
> -    } else {
> -        unixctl_command_reply(conn, "success");
> -    }
> +    unixctl_command_reply(conn, NULL);
>  }
>
>
The first three patches all look good to me.

Just one comment, you forgot to delete the declaration and initialization
of 'n_listeners' in function "netdev_dummy_receive".
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to