From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 935ED43896; Thu, 11 Jan 2024 21:08:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0F37340269; Thu, 11 Jan 2024 21:08:47 +0100 (CET) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mails.dpdk.org (Postfix) with ESMTP id 3CB0F40266 for ; Thu, 11 Jan 2024 21:08:45 +0100 (CET) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-1d40eec5e12so47301415ad.1 for ; Thu, 11 Jan 2024 12:08:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1705003724; x=1705608524; darn=dpdk.org; h=content-transfer-encoding:mime-version:message-id:subject:cc:to :from:date:from:to:cc:subject:date:message-id:reply-to; bh=DTTptzv+p6h1vULgr5bBf5d4PghS8mSu2JBKrm/AvSk=; b=h98JVVj9oNIQ4FVtfYF2LCGSgvsipNYDX+Qkm9ZJQitpIR96uKpfgyBw0ZNKan3Pyc fN59GVxGjdFSAo1udfT5wkQ3Tpvs4RqiDZbrgNpGBtHpe/E1dvTOIWjm5vYjWAgBPJPJ xeZ31yfnO/0Aslm53OADju7C76dTzJ78UzmXT16AHY8HbA/nW9SzBGhJeaxRvihwxmWv HhLL8/RogyGcZWsj15lnUlAuAFlxhdgZyp3KrHNRzCipw7CZN1YR1lgGnNcHsOeFLnOE Voi/EFrwVrjxRaEZlWKRMWF0i3yp6htrGX10fY7eo37ihQHlXj/L79qf77ABWtJ7v52H GYjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705003724; x=1705608524; h=content-transfer-encoding:mime-version:message-id:subject:cc:to :from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DTTptzv+p6h1vULgr5bBf5d4PghS8mSu2JBKrm/AvSk=; b=F2XW7eXbf9x9wJbIWXYkXmD7L2Rp1/0ipMIA6bskqpz1HfriFz+igOuKal8kL86pUK J/siPZ1C7P9HrSx6F7EpBDatEYmPoVpOTb9kYYdqaAUqYI8XR1IYv4NMfmD1BNHSS3ZQ G+sGnq8NinT+gHdUHK0idB3nX/G7Hlfdc8xhyX+FQhlQ4H6wa5w7Sp6O6gS4Y8Hs3sit nCh0RuPpzOYSd8LnniIHyqle/WFOVCCMoFgnMPv60dVDbCkOd9YT7AbdrsE/jli673bt fxUaYVo9i7AeUFBn7NGnxGYeKoo9ExzEf+Mxr8Q69XqYALIp6IvOtpuHScd78gFME5hm Elng== X-Gm-Message-State: AOJu0YxRBFbXT5Jx9Vd0nqjDDYRiD/NC59MZ8CdNeOWWoJTluHjjPgmD M3/xuElaRpzRDIyXiUoVTBnTfYjbBHc8PA== X-Google-Smtp-Source: AGHT+IHyRfREDo5LW24G5jlAOXMg/RwacDKnUKCTes8bRtZMzAsixHENeDZfVzCNnREg3zoPKU72JA== X-Received: by 2002:a17:902:db10:b0:1d4:e575:5224 with SMTP id m16-20020a170902db1000b001d4e5755224mr282105plx.122.1705003724039; Thu, 11 Jan 2024 12:08:44 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id d5-20020a170903230500b001cfa0c04553sm1547240plh.116.2024.01.11.12.08.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 12:08:43 -0800 (PST) Date: Thu, 11 Jan 2024 12:08:41 -0800 From: Stephen Hemminger To: Rushil Gupta , Joshua Washington , Junfeng Guo , Jeroen de Borst Cc: dev@dpdk.org Subject: gve: mixes DPDK and Linux versions in compatibility check Message-ID: <20240111120841.136b1e7c@hermes.local> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org This seems wrong: *driver_info = (struct gve_driver_info) { .os_type = 5, /* DPDK */ .driver_major = GVE_VERSION_MAJOR, .driver_minor = GVE_VERSION_MINOR, .driver_sub = GVE_VERSION_SUB, .os_version_major = cpu_to_be32(DPDK_VERSION_MAJOR), .os_version_minor = cpu_to_be32(DPDK_VERSION_MINOR), .os_version_sub = cpu_to_be32(DPDK_VERSION_SUB), .driver_capability_flags = { cpu_to_be64(GVE_DRIVER_CAPABILITY_FLAGS1), cpu_to_be64(GVE_DRIVER_CAPABILITY_FLAGS2), cpu_to_be64(GVE_DRIVER_CAPABILITY_FLAGS3), cpu_to_be64(GVE_DRIVER_CAPABILITY_FLAGS4), }, }; populate_driver_version_strings((char *)driver_info->os_version_str1, (char *)driver_info->os_version_str2); The numeric values os_version_major, os_version_minor use DPDK version which is good. But the populate_driver_version_strings gets the Linux kernel version number which is problematic. Looks like a bug to me. Also technically, the Linux kernel version is not the same as the OS release. Shouldn't it be more like: diff --git a/drivers/net/gve/base/gve_osdep.h b/drivers/net/gve/base/gve_osdep.h index a3702f4b8c8d..914746c8d226 100644 --- a/drivers/net/gve/base/gve_osdep.h +++ b/drivers/net/gve/base/gve_osdep.h @@ -171,17 +171,4 @@ gve_free_dma_mem(struct gve_dma_mem *mem) mem->pa = 0; } -static inline void -populate_driver_version_strings(char *str1, char *str2) -{ - struct utsname uts; - if (uname(&uts) >= 0) { - /* release */ - rte_strscpy(str1, uts.release, - OS_VERSION_STRLEN); - /* version */ - rte_strscpy(str2, uts.version, - OS_VERSION_STRLEN); - } -} #endif /* _GVE_OSDEP_H_ */ diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c index ecd37ff37f55..b8c48fc657b9 100644 --- a/drivers/net/gve/gve_ethdev.c +++ b/drivers/net/gve/gve_ethdev.c @@ -273,8 +273,8 @@ gve_verify_driver_compatibility(struct gve_priv *priv) }, }; - populate_driver_version_strings((char *)driver_info->os_version_str1, - (char *)driver_info->os_version_str2); + rte_strscpy(driver_info.os_version_str1, OS_VERSION_STRLEN, + rte_version()); err = gve_adminq_verify_driver_compatibility(priv, sizeof(struct gve_driver_info),