From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D0E8AA09E9; Fri, 11 Dec 2020 21:09:47 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 41EE8C940; Fri, 11 Dec 2020 21:09:46 +0100 (CET) Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) by dpdk.org (Postfix) with ESMTP id EB92CAC9A; Fri, 11 Dec 2020 21:09:43 +0100 (CET) Received: by mail-lf1-f68.google.com with SMTP id a12so15004476lfl.6; Fri, 11 Dec 2020 12:09:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XMk3qmcKkXveBpvJ0ELAdUhKUy8aP+4Mxdefuox47rc=; b=ayTeFhlvIjXP2UzVR9XKnGRh695zKFfUfPA8e9/gnv/ApqcwTLqu6w4CtpXkdSFKpN FlnpJj7sima1mA79KM0mn9mZMb6xWwF4l1cQcBkD/w0HsmlNTvVCHHtfhPrjJLA4h0JO AIePfhwwYRwJBo47bK2oiZWUeVzteNHdyUIdFZFMJ8JPKV3v9VrKelZKXhpYDJk1ZGgl KBS5hAeZF6gtSZR8sfTygrtN/hQNDz5or+Joqo6JgHCJNflfqDO6+NbMPPOeQSnbeFuc IPKImacx3jij/sDehLyvAm3d5QQdZn9yRC9KW8P1gJPuqLfI2dRXOt/zch+63I/nyiOG epzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XMk3qmcKkXveBpvJ0ELAdUhKUy8aP+4Mxdefuox47rc=; b=OjbuWxPXZi4vkcfMM+Sb1jN+Tm8jilm25ifn+s+6u8HK16UyJ/1D4eH67tX/Ms1YsC tfU6VdEh8ryUEqKaWfnWVRr20YMMjg7jUkoEnafLj9arhsk/wAqb0BS8rzsYDxvQ3J/r NJN+y3ZNyjO0ybwtgUkIsSUlf0YKEpCU6cKNw7OP8a/8r/DorzawwCaOYnV3Bz9zFNHs v7SykB9y3fWvGGU+OZIBpo1mhwTAVbRZgokmvnOzx1AufedYLPrE7r7EezZhIIPrcvRh bkpQ5lkAwqsAFHcqpXAROZJGN0XPUA/HNe2cagb/DF/UwWV9hkO1eu6w2jSQxFsrek1H +Qrg== X-Gm-Message-State: AOAM531cekeygQcFe2RXi3NKRu+60xbRWFM0UfwSysRSOWfKbSDD4GNk hrz+FiKIx1ba7tkVSO9ynb5+JKmuqH4PvA== X-Google-Smtp-Source: ABdhPJw0QNDZt1nL3Rqk3Qz/nGG84oS/CIMb3Jni0lc7BRopuxpiVmeqKQgarz4o9Z8BmE+eHDElvw== X-Received: by 2002:ac2:43b6:: with SMTP id t22mr903191lfl.32.1607717383089; Fri, 11 Dec 2020 12:09:43 -0800 (PST) Received: from localhost.localdomain (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id v7sm998713lfd.235.2020.12.11.12.09.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Dec 2020 12:09:41 -0800 (PST) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: Narcisa Ana Maria Vasile , Pallavi Kadam , Dmitry Kozlyuk , stable@dpdk.org, Tal Shnaiderman Date: Fri, 11 Dec 2020 23:09:30 +0300 Message-Id: <20201211200930.24006-1-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201211191505.11693-1-dmitry.kozliuk@gmail.com> References: <20201211191505.11693-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2] pci/windows: fix limit for hardware ID X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Length of hardware IDs list is limited by REGSTR_VAL_MAX_HCID_LEN [1], which is currently 1024. With the old limit of 260, obtaining the list could fail in a rare occasion of a very long result (no examples known). This also removes a bogus dependency on the maximum path length. [1]: https://docs.microsoft.com/en-us/windows-hardware/drivers/install/hardware-ids Fixes: b762221ac24f ("bus/pci: support Windows with bifurcated drivers") Cc: stable@dpdk.org Cc: Tal Shnaiderman Signed-off-by: Dmitry Kozlyuk --- v2: change limit and description (self-fix) drivers/bus/pci/windows/pci.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c index 33a5fb1d8..fbf0785fd 100644 --- a/drivers/bus/pci/windows/pci.c +++ b/drivers/bus/pci/windows/pci.c @@ -10,6 +10,7 @@ #include "pci_netuio.h" #include +#include #if defined RTE_TOOLCHAIN_GCC && (__MINGW64_VERSION_MAJOR < 8) #include @@ -303,7 +304,7 @@ pci_scan_one(HDEVINFO dev_info, PSP_DEVINFO_DATA device_info_data) { struct rte_pci_device *dev; int ret = -1; - char pci_device_info[PATH_MAX]; + char pci_device_info[REGSTR_VAL_MAX_HCID_LEN]; struct rte_pci_addr addr; struct rte_pci_id pci_id; @@ -314,7 +315,7 @@ pci_scan_one(HDEVINFO dev_info, PSP_DEVINFO_DATA device_info_data) memset(dev, 0, sizeof(*dev)); ret = get_pci_hardware_id(dev_info, device_info_data, - pci_device_info, PATH_MAX); + pci_device_info, sizeof(pci_device_info)); if (ret != 0) goto end; -- 2.29.2