On Wed, Nov 05, 2014 at 01:32:32PM -0800, Andy Zhou wrote:
> OVS userspace are backward compatible with older Linux kernel modules.
> However, not having the most up-to-date datapath kernel modules can
> some times lead to user confusion. Storing the datapath version in
> OVSDB allows management software to check and optionally provide
> notifications to users.
> 
> Signed-off-by: Andy Zhou <az...@nicira.com>
> 
> ----
> v1->v2:  Get version string from dpif_class.
> V2->V3:  Fix missspelling of 'datapath' in comments
> V3->v4:  Fix vswitch.xml description to referece Open vSwitch instead
>          of OpenFlow
> V4->V5:  Add handlinf for possible empty kernel module version file.
>          Update OVSDB with empty string when datapath version cannot
>          be determined.
> V5->v6:  Store "<unknown>" when datapath version can not be determined.
>          Store "<built-in>" when datapath is linked into the user space.
> ---
>  lib/dpif-netdev.c          |  7 +++++++
>  lib/dpif-netlink.c         | 31 +++++++++++++++++++++++++++++++
>  lib/dpif-provider.h        |  4 ++++
>  lib/dpif.c                 | 16 ++++++++++++++++
>  lib/dpif.h                 |  1 +
>  ofproto/ofproto-dpif.c     | 17 +++++++++++++++++
>  ofproto/ofproto-provider.h | 13 +++++++++++++
>  tests/ovs-vsctl.at         |  2 ++
>  vswitchd/bridge.c          | 18 ++++++++++++++++++
>  vswitchd/vswitch.ovsschema |  6 ++++--
>  vswitchd/vswitch.xml       |  7 +++++++
>  11 files changed, 120 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
> index 2009206..dfb831c 100644
> --- a/lib/dpif-netdev.c
> +++ b/lib/dpif-netdev.c
> @@ -2520,6 +2520,12 @@ dp_netdev_reset_pmd_threads(struct dp_netdev *dp)
>      }
>  }
>  
> +static char *
> +dpif_netdev_get_datapath_version(void)
> +{
> +     return xstrdup("<built-in>");
> +}
> +
>  static void
>  dp_netdev_flow_used(struct dp_netdev_flow *netdev_flow,
>                      int cnt, int size,
> @@ -3100,6 +3106,7 @@ const struct dpif_class dpif_netdev_class = {
>      dpif_netdev_register_upcall_cb,
>      dpif_netdev_enable_upcall,
>      dpif_netdev_disable_upcall,
> +    dpif_netdev_get_datapath_version,
>  };
>  
>  static void
> diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c
> index 67c2814..f5a4a6c 100644
> --- a/lib/dpif-netlink.c
> +++ b/lib/dpif-netlink.c
> @@ -1903,6 +1903,36 @@ dpif_netlink_recv_purge(struct dpif *dpif_)
>      fat_rwlock_unlock(&dpif->upcall_lock);
>  }
>  
> +static char *
> +dpif_netlink_get_datapath_version(void)
> +{
> +    char *version_str = NULL;
> +
> +#ifdef __linux__
> +
> +#define MAX_VERSION_STR_SIZE 80
> +#define LINUX_DATAPATH_VERSION_FILE  "/sys/module/openvswitch/version"

The above is not available in Fedora 20.
# stat /sys/module/openvswitch/version
stat: cannot stat ‘/sys/module/openvswitch/version’: No such file or
directory
# uname -r
3.16.7-200.fc20.x86_64

Which kernel are you testing?

fbl

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to