[ovs-dev] [PATCH 1/2] netdev-dpdk: Fix variables naming in set_admin_state function.

Stokes, Ian ian.stokes at intel.com
Wed Nov 22 17:25:19 UTC 2017


> Function 'netdev_dpdk_set_admin_state()' was missed while fixing variables
> naming according to the following convention:
> 
>     'struct netdev':'netdev'
>     'struct netdev_dpdk':'dev'
>     'struct netdev_rxq':'rxq'
>     'struct netdev_rxq_dpdk':'rx'
> 

LGTM, will add this to the DPDK merge branch.

Thanks
Ian

> Fixes: d46285a2206f ("netdev-dpdk: Consistent variable naming.")
> Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
> ---
>  lib/netdev-dpdk.c | 19 ++++++++++---------
>  1 file changed, 10 insertions(+), 9 deletions(-)
> 
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index dc210cc..872b133
> 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -2486,12 +2486,13 @@ netdev_dpdk_set_admin_state(struct unixctl_conn
> *conn, int argc,
> 
>      if (argc > 2) {
>          struct netdev *netdev = netdev_from_name(argv[1]);
> +
>          if (netdev && is_dpdk_class(netdev->netdev_class)) {
> -            struct netdev_dpdk *dpdk_dev = netdev_dpdk_cast(netdev);
> +            struct netdev_dpdk *dev = netdev_dpdk_cast(netdev);
> 
> -            ovs_mutex_lock(&dpdk_dev->mutex);
> -            netdev_dpdk_set_admin_state__(dpdk_dev, up);
> -            ovs_mutex_unlock(&dpdk_dev->mutex);
> +            ovs_mutex_lock(&dev->mutex);
> +            netdev_dpdk_set_admin_state__(dev, up);
> +            ovs_mutex_unlock(&dev->mutex);
> 
>              netdev_close(netdev);
>          } else {
> @@ -2500,13 +2501,13 @@ netdev_dpdk_set_admin_state(struct unixctl_conn
> *conn, int argc,
>              return;
>          }
>      } else {
> -        struct netdev_dpdk *netdev;
> +        struct netdev_dpdk *dev;
> 
>          ovs_mutex_lock(&dpdk_mutex);
> -        LIST_FOR_EACH (netdev, list_node, &dpdk_list) {
> -            ovs_mutex_lock(&netdev->mutex);
> -            netdev_dpdk_set_admin_state__(netdev, up);
> -            ovs_mutex_unlock(&netdev->mutex);
> +        LIST_FOR_EACH (dev, list_node, &dpdk_list) {
> +            ovs_mutex_lock(&dev->mutex);
> +            netdev_dpdk_set_admin_state__(dev, up);
> +            ovs_mutex_unlock(&dev->mutex);
>          }
>          ovs_mutex_unlock(&dpdk_mutex);
>      }
> --
> 2.7.4
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev


More information about the dev mailing list