<div dir="ltr"><div dir="auto"><div>Hi Stephen</div><div dir="auto">We wish to capture both rte version and linux kernel version.</div><div dir="auto"><br></div><div dir="auto">The current implementation is needed to answer questions like how many customers are on Dpdk 23.11 for Ubuntu 22 vs Debian 11.</div><div dir="auto">Therefore, we need the uts library and the adminq is working as intended.<br><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Fri, Jan 12, 2024, 1:38 AM Stephen Hemminger <<a href="mailto:stephen@networkplumber.org" target="_blank">stephen@networkplumber.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This seems wrong:<br>
        *driver_info = (struct gve_driver_info) {<br>
                .os_type = 5, /* DPDK */<br>
                .driver_major = GVE_VERSION_MAJOR,<br>
                .driver_minor = GVE_VERSION_MINOR,<br>
                .driver_sub = GVE_VERSION_SUB,<br>
                .os_version_major = cpu_to_be32(DPDK_VERSION_MAJOR),<br>
                .os_version_minor = cpu_to_be32(DPDK_VERSION_MINOR),<br>
                .os_version_sub = cpu_to_be32(DPDK_VERSION_SUB),<br>
                .driver_capability_flags = {<br>
                        cpu_to_be64(GVE_DRIVER_CAPABILITY_FLAGS1),<br>
                        cpu_to_be64(GVE_DRIVER_CAPABILITY_FLAGS2),<br>
                        cpu_to_be64(GVE_DRIVER_CAPABILITY_FLAGS3),<br>
                        cpu_to_be64(GVE_DRIVER_CAPABILITY_FLAGS4),<br>
                },<br>
        };<br>
<br>
        populate_driver_version_strings((char *)driver_info->os_version_str1,<br>
                        (char *)driver_info->os_version_str2);<br>
<br>
The numeric values os_version_major, os_version_minor use DPDK version which<br>
is good.  But the populate_driver_version_strings gets the Linux kernel<br>
version number which is problematic.  Looks like a bug to me.<br>
<br>
Also technically, the Linux kernel version is not the same as the OS release.<br>
<br>
Shouldn't it be more like:<br>
<br>
diff --git a/drivers/net/gve/base/gve_osdep.h b/drivers/net/gve/base/gve_osdep.h<br>
index a3702f4b8c8d..914746c8d226 100644<br>
--- a/drivers/net/gve/base/gve_osdep.h<br>
+++ b/drivers/net/gve/base/gve_osdep.h<br>
@@ -171,17 +171,4 @@ gve_free_dma_mem(struct gve_dma_mem *mem)<br>
        mem->pa = 0;<br>
 }<br>
<br>
-static inline void<br>
-populate_driver_version_strings(char *str1, char *str2)<br>
-{<br>
-       struct utsname uts;<br>
-       if (uname(&uts) >= 0) {<br>
-               /* release */<br>
-               rte_strscpy(str1, uts.release,<br>
-                       OS_VERSION_STRLEN);<br>
-               /* version */<br>
-               rte_strscpy(str2, uts.version,<br>
-                       OS_VERSION_STRLEN);<br>
-       }<br>
-}<br>
 #endif /* _GVE_OSDEP_H_ */<br>
diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c<br>
index ecd37ff37f55..b8c48fc657b9 100644<br>
--- a/drivers/net/gve/gve_ethdev.c<br>
+++ b/drivers/net/gve/gve_ethdev.c<br>
@@ -273,8 +273,8 @@ gve_verify_driver_compatibility(struct gve_priv *priv)<br>
                },<br>
        };<br>
<br>
-       populate_driver_version_strings((char *)driver_info->os_version_str1,<br>
-                       (char *)driver_info->os_version_str2);<br>
+       rte_strscpy(driver_info.os_version_str1, OS_VERSION_STRLEN,<br>
+                   rte_version());<br>
<br>
        err = gve_adminq_verify_driver_compatibility(priv,<br>
                sizeof(struct gve_driver_info),<br>
</blockquote></div></div></div>
</div>