Acked-by: Ethan Jackson <et...@nicira.com>

On Fri, May 10, 2013 at 11:50 AM, Ben Pfaff <b...@nicira.com> wrote:
> ---
>  lib/netdev-bsd.c   |   24 ++++++++++++------------
>  lib/netdev-dummy.c |   18 +++++++++---------
>  lib/netdev-linux.c |   38 +++++++++++++++++++-------------------
>  lib/netdev-vport.c |    8 ++++----
>  4 files changed, 44 insertions(+), 44 deletions(-)
>
> diff --git a/lib/netdev-bsd.c b/lib/netdev-bsd.c
> index 2e870d4..36cacdd 100644
> --- a/lib/netdev-bsd.c
> +++ b/lib/netdev-bsd.c
> @@ -79,7 +79,7 @@ VLOG_DEFINE_THIS_MODULE(netdev_bsd);
>   * struct, and using CONTAINER_OF to access the parent structure.
>   */
>  struct netdev_bsd {
> -    struct netdev netdev;
> +    struct netdev up;
>  };
>
>  struct netdev_rx_bsd {
> @@ -97,7 +97,7 @@ struct netdev_rx_bsd {
>  static const struct netdev_rx_class netdev_rx_bsd_class;
>
>  struct netdev_dev_bsd {
> -    struct netdev_dev netdev_dev;
> +    struct netdev_dev up;
>      unsigned int cache_valid;
>      unsigned int change_seq;
>
> @@ -172,14 +172,14 @@ netdev_bsd_cast(const struct netdev *netdev)
>  {
>      ovs_assert(is_netdev_bsd_class(netdev_dev_get_class(
>                                         netdev_get_dev(netdev))));
> -    return CONTAINER_OF(netdev, struct netdev_bsd, netdev);
> +    return CONTAINER_OF(netdev, struct netdev_bsd, up);
>  }
>
>  static struct netdev_dev_bsd *
>  netdev_dev_bsd_cast(const struct netdev_dev *netdev_dev)
>  {
>      ovs_assert(is_netdev_bsd_class(netdev_dev_get_class(netdev_dev)));
> -    return CONTAINER_OF(netdev_dev, struct netdev_dev_bsd, netdev_dev);
> +    return CONTAINER_OF(netdev_dev, struct netdev_dev_bsd, up);
>  }
>
>  static struct netdev_rx_bsd *
> @@ -318,9 +318,9 @@ netdev_bsd_create_system(const struct netdev_class 
> *class, const char *name,
>
>      netdev_dev = xzalloc(sizeof *netdev_dev);
>      netdev_dev->change_seq = 1;
> -    netdev_dev_init(&netdev_dev->netdev_dev, name, class);
> +    netdev_dev_init(&netdev_dev->up, name, class);
>      netdev_dev->tap_fd = -1;
> -    *netdev_devp = &netdev_dev->netdev_dev;
> +    *netdev_devp = &netdev_dev->up;
>
>      return 0;
>  }
> @@ -390,8 +390,8 @@ netdev_bsd_create_tap(const struct netdev_class *class, 
> const char *name,
>
>      /* initialize the device structure and
>       * link the structure to its netdev */
> -    netdev_dev_init(&netdev_dev->netdev_dev, name, class);
> -    *netdev_devp = &netdev_dev->netdev_dev;
> +    netdev_dev_init(&netdev_dev->up, name, class);
> +    *netdev_devp = &netdev_dev->up;
>
>      return 0;
>
> @@ -428,19 +428,19 @@ netdev_bsd_open_system(struct netdev_dev *netdev_dev_, 
> struct netdev **netdevp)
>
>      /* Allocate network device. */
>      netdev = xcalloc(1, sizeof *netdev);
> -    netdev_init(&netdev->netdev, netdev_dev_);
> +    netdev_init(&netdev->up, netdev_dev_);
>
>      /* Verify that the netdev really exists by attempting to read its flags 
> */
> -    error = netdev_get_flags(&netdev->netdev, &flags);
> +    error = netdev_get_flags(&netdev->up, &flags);
>      if (error == ENXIO) {
>          goto error;
>      }
>
> -    *netdevp = &netdev->netdev;
> +    *netdevp = &netdev->up;
>      return 0;
>
>  error:
> -    netdev_uninit(&netdev->netdev, true);
> +    netdev_uninit(&netdev->up, true);
>      return error;
>  }
>
> diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c
> index 3762d5c..dabff18 100644
> --- a/lib/netdev-dummy.c
> +++ b/lib/netdev-dummy.c
> @@ -43,7 +43,7 @@ VLOG_DEFINE_THIS_MODULE(netdev_dummy);
>  #endif
>
>  struct netdev_dev_dummy {
> -    struct netdev_dev netdev_dev;
> +    struct netdev_dev up;
>      uint8_t hwaddr[ETH_ADDR_LEN];
>      int mtu;
>      struct netdev_stats stats;
> @@ -55,7 +55,7 @@ struct netdev_dev_dummy {
>  };
>
>  struct netdev_dummy {
> -    struct netdev netdev;
> +    struct netdev up;
>  };
>
>  struct netdev_rx_dummy {
> @@ -87,7 +87,7 @@ static struct netdev_dev_dummy *
>  netdev_dev_dummy_cast(const struct netdev_dev *netdev_dev)
>  {
>      ovs_assert(is_dummy_class(netdev_dev_get_class(netdev_dev)));
> -    return CONTAINER_OF(netdev_dev, struct netdev_dev_dummy, netdev_dev);
> +    return CONTAINER_OF(netdev_dev, struct netdev_dev_dummy, up);
>  }
>
>  static struct netdev_dummy *
> @@ -95,7 +95,7 @@ netdev_dummy_cast(const struct netdev *netdev)
>  {
>      struct netdev_dev *netdev_dev = netdev_get_dev(netdev);
>      ovs_assert(is_dummy_class(netdev_dev_get_class(netdev_dev)));
> -    return CONTAINER_OF(netdev, struct netdev_dummy, netdev);
> +    return CONTAINER_OF(netdev, struct netdev_dummy, up);
>  }
>
>  static struct netdev_rx_dummy *
> @@ -113,7 +113,7 @@ netdev_dummy_create(const struct netdev_class *class, 
> const char *name,
>      struct netdev_dev_dummy *netdev_dev;
>
>      netdev_dev = xzalloc(sizeof *netdev_dev);
> -    netdev_dev_init(&netdev_dev->netdev_dev, name, class);
> +    netdev_dev_init(&netdev_dev->up, name, class);
>      netdev_dev->hwaddr[0] = 0xaa;
>      netdev_dev->hwaddr[1] = 0x55;
>      netdev_dev->hwaddr[2] = n >> 24;
> @@ -130,7 +130,7 @@ netdev_dummy_create(const struct netdev_class *class, 
> const char *name,
>
>      n++;
>
> -    *netdev_devp = &netdev_dev->netdev_dev;
> +    *netdev_devp = &netdev_dev->up;
>
>      return 0;
>  }
> @@ -172,9 +172,9 @@ netdev_dummy_open(struct netdev_dev *netdev_dev_, struct 
> netdev **netdevp)
>      struct netdev_dummy *netdev;
>
>      netdev = xmalloc(sizeof *netdev);
> -    netdev_init(&netdev->netdev, netdev_dev_);
> +    netdev_init(&netdev->up, netdev_dev_);
>
> -    *netdevp = &netdev->netdev;
> +    *netdevp = &netdev->up;
>      return 0;
>  }
>
> @@ -193,7 +193,7 @@ netdev_dummy_rx_open(struct netdev *netdev_, struct 
> netdev_rx **rxp)
>      struct netdev_rx_dummy *rx;
>
>      rx = xmalloc(sizeof *rx);
> -    netdev_rx_init(&rx->up, &dev->netdev_dev, &netdev_rx_dummy_class);
> +    netdev_rx_init(&rx->up, &dev->up, &netdev_rx_dummy_class);
>      list_push_back(&dev->rxes, &rx->node);
>      list_init(&rx->recv_queue);
>
> diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
> index 2e6fedd..d5a3a93 100644
> --- a/lib/netdev-linux.c
> +++ b/lib/netdev-linux.c
> @@ -355,7 +355,7 @@ static void tc_put_rtab(struct ofpbuf *, uint16_t type,
>  static int tc_calc_buffer(unsigned int Bps, int mtu, uint64_t burst_bytes);
>
>  struct netdev_dev_linux {
> -    struct netdev_dev netdev_dev;
> +    struct netdev_dev up;
>
>      struct shash_node *shash_node;
>      unsigned int cache_valid;
> @@ -398,7 +398,7 @@ struct netdev_dev_linux {
>  };
>
>  struct netdev_linux {
> -    struct netdev netdev;
> +    struct netdev up;
>  };
>
>  struct netdev_rx_linux {
> @@ -460,7 +460,7 @@ netdev_dev_linux_cast(const struct netdev_dev *netdev_dev)
>      const struct netdev_class *netdev_class = 
> netdev_dev_get_class(netdev_dev);
>      ovs_assert(is_netdev_linux_class(netdev_class));
>
> -    return CONTAINER_OF(netdev_dev, struct netdev_dev_linux, netdev_dev);
> +    return CONTAINER_OF(netdev_dev, struct netdev_dev_linux, up);
>  }
>
>  static struct netdev_linux *
> @@ -470,7 +470,7 @@ netdev_linux_cast(const struct netdev *netdev)
>      const struct netdev_class *netdev_class = 
> netdev_dev_get_class(netdev_dev);
>      ovs_assert(is_netdev_linux_class(netdev_class));
>
> -    return CONTAINER_OF(netdev, struct netdev_linux, netdev);
> +    return CONTAINER_OF(netdev, struct netdev_linux, up);
>  }
>
>  static struct netdev_rx_linux *
> @@ -593,7 +593,7 @@ netdev_linux_cache_cb(const struct rtnetlink_link_change 
> *change,
>
>              dev = node->data;
>
> -            get_flags(&dev->netdev_dev, &flags);
> +            get_flags(&dev->up, &flags);
>              netdev_dev_linux_changed(dev, flags, 0);
>          }
>          shash_destroy(&device_shash);
> @@ -644,10 +644,10 @@ netdev_linux_create(const struct netdev_class *class, 
> const char *name,
>
>      netdev_dev = xzalloc(sizeof *netdev_dev);
>      netdev_dev->change_seq = 1;
> -    netdev_dev_init(&netdev_dev->netdev_dev, name, class);
> -    get_flags(&netdev_dev->netdev_dev, &netdev_dev->ifi_flags);
> +    netdev_dev_init(&netdev_dev->up, name, class);
> +    get_flags(&netdev_dev->up, &netdev_dev->ifi_flags);
>
> -    *netdev_devp = &netdev_dev->netdev_dev;
> +    *netdev_devp = &netdev_dev->up;
>      return 0;
>  }
>
> @@ -699,8 +699,8 @@ netdev_linux_create_tap(const struct netdev_class *class 
> OVS_UNUSED,
>          goto error_unref_notifier;
>      }
>
> -    netdev_dev_init(&netdev_dev->netdev_dev, name, &netdev_tap_class);
> -    *netdev_devp = &netdev_dev->netdev_dev;
> +    netdev_dev_init(&netdev_dev->up, name, &netdev_tap_class);
> +    *netdev_devp = &netdev_dev->up;
>      return 0;
>
>  error_unref_notifier:
> @@ -748,7 +748,7 @@ netdev_linux_open(struct netdev_dev *netdev_dev_, struct 
> netdev **netdevp)
>
>      /* Allocate network device. */
>      netdev = xzalloc(sizeof *netdev);
> -    netdev_init(&netdev->netdev, netdev_dev_);
> +    netdev_init(&netdev->up, netdev_dev_);
>
>      /* Verify that the device really exists, by attempting to read its flags.
>       * (The flags might be cached, in which case this won't actually do an
> @@ -759,17 +759,17 @@ netdev_linux_open(struct netdev_dev *netdev_dev_, 
> struct netdev **netdevp)
>       * creating them in the kernel happens by passing a netdev object to
>       * dpif_port_add(). */
>      if (netdev_dev_get_class(netdev_dev_) != &netdev_internal_class) {
> -        error = netdev_get_flags(&netdev->netdev, &flags);
> +        error = netdev_get_flags(&netdev->up, &flags);
>          if (error == ENODEV) {
>              goto error;
>          }
>      }
>
> -    *netdevp = &netdev->netdev;
> +    *netdevp = &netdev->up;
>      return 0;
>
>  error:
> -    netdev_uninit(&netdev->netdev, true);
> +    netdev_uninit(&netdev->up, true);
>      return error;
>  }
>
> @@ -814,7 +814,7 @@ netdev_linux_rx_open(struct netdev *netdev_, struct 
> netdev_rx **rxp)
>          }
>
>          /* Get ethernet device index. */
> -        error = get_ifindex(&netdev->netdev, &ifindex);
> +        error = get_ifindex(&netdev->up, &ifindex);
>          if (error) {
>              goto error;
>          }
> @@ -1257,7 +1257,7 @@ netdev_linux_miimon_run(void)
>              continue;
>          }
>
> -        netdev_linux_get_miimon(dev->netdev_dev.name, &miimon);
> +        netdev_linux_get_miimon(dev->up.name, &miimon);
>          if (miimon != dev->miimon) {
>              dev->miimon = miimon;
>              netdev_dev_linux_changed(dev, dev->ifi_flags, 0);
> @@ -1590,7 +1590,7 @@ netdev_linux_read_features(struct netdev_dev_linux 
> *netdev_dev)
>
>      COVERAGE_INC(netdev_get_ethtool);
>      memset(&ecmd, 0, sizeof ecmd);
> -    error = netdev_linux_do_ethtool(netdev_dev->netdev_dev.name, &ecmd,
> +    error = netdev_linux_do_ethtool(netdev_dev->up.name, &ecmd,
>                                      ETHTOOL_GSET, "ETHTOOL_GSET");
>      if (error) {
>          goto out;
> @@ -2377,7 +2377,7 @@ netdev_linux_get_status(const struct netdev *netdev, 
> struct smap *smap)
>
>          COVERAGE_INC(netdev_get_ethtool);
>          memset(&netdev_dev->drvinfo, 0, sizeof netdev_dev->drvinfo);
> -        error = netdev_linux_do_ethtool(netdev_dev->netdev_dev.name,
> +        error = netdev_linux_do_ethtool(netdev_dev->up.name,
>                                          cmd,
>                                          ETHTOOL_GDRVINFO,
>                                          "ETHTOOL_GDRVINFO");
> @@ -2474,7 +2474,7 @@ netdev_linux_update_flags(struct netdev_dev *dev_, enum 
> netdev_flags off,
>      new_flags = (old_flags & ~nd_to_iff_flags(off)) | nd_to_iff_flags(on);
>      if (new_flags != old_flags) {
>          error = set_flags(netdev_dev_get_name(dev_), new_flags);
> -        get_flags(&netdev_dev->netdev_dev, &netdev_dev->ifi_flags);
> +        get_flags(&netdev_dev->up, &netdev_dev->ifi_flags);
>      }
>      return error;
>  }
> diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c
> index c1c3cbb..3d4b314 100644
> --- a/lib/netdev-vport.c
> +++ b/lib/netdev-vport.c
> @@ -47,7 +47,7 @@ VLOG_DEFINE_THIS_MODULE(netdev_vport);
>  #define DEFAULT_TTL 64
>
>  struct netdev_dev_vport {
> -    struct netdev_dev netdev_dev;
> +    struct netdev_dev up;
>      unsigned int change_seq;
>      uint8_t etheraddr[ETH_ADDR_LEN];
>      struct netdev_stats stats;
> @@ -87,7 +87,7 @@ static struct netdev_dev_vport *
>  netdev_dev_vport_cast(const struct netdev_dev *netdev_dev)
>  {
>      ovs_assert(is_vport_class(netdev_dev_get_class(netdev_dev)));
> -    return CONTAINER_OF(netdev_dev, struct netdev_dev_vport, netdev_dev);
> +    return CONTAINER_OF(netdev_dev, struct netdev_dev_vport, up);
>  }
>
>  static struct netdev_dev_vport *
> @@ -159,11 +159,11 @@ netdev_vport_create(const struct netdev_class 
> *netdev_class, const char *name,
>      struct netdev_dev_vport *dev;
>
>      dev = xzalloc(sizeof *dev);
> -    netdev_dev_init(&dev->netdev_dev, name, netdev_class);
> +    netdev_dev_init(&dev->up, name, netdev_class);
>      dev->change_seq = 1;
>      eth_addr_random(dev->etheraddr);
>
> -    *netdev_devp = &dev->netdev_dev;
> +    *netdev_devp = &dev->up;
>      route_table_register();
>
>      return 0;
> --
> 1.7.10.4
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to