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 B5FD2A09E4; Tue, 23 Mar 2021 10:33:38 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3F0F04014D; Tue, 23 Mar 2021 10:33:38 +0100 (CET) Received: from mail-108-mta226.mxroute.com (mail-108-mta226.mxroute.com [136.175.108.226]) by mails.dpdk.org (Postfix) with ESMTP id 4591C40143 for ; Tue, 23 Mar 2021 10:33:36 +0100 (CET) Received: from filter004.mxroute.com ([149.28.56.236] filter004.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta226.mxroute.com (ZoneMTA) with ESMTPSA id 1785e6eae9a0004964.001 for (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Tue, 23 Mar 2021 09:33:35 +0000 X-Zone-Loop: 0e0d5de9ce7bbc94eee7a025afaad04fdcadebffc377 X-Originating-IP: [149.28.56.236] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ashroe.eu; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=nBtbYat5LcapsFZJ32UzSbBbXu0+O3qT9F85UAlqXg0=; b=F7OSzimuwogg9MzcQOcYcoJzqk sf0w5nHZ90DeweFT9FK+J1LdOhkjw3uZN7I3UH4zow5E6vXMkeksCEtOB2y9vK2MwIW0uP8T4FUBx 7NkKof1ZJYPCWsHouLeEyunzv51Ubte34gyVDJLEUoZx36BJG6qGUnBWXflKpFhXZ40NZ7oyFa5Vv I55TxLbHmHI8Lgdk1eIYcigE5n6P2/NI/4rZi7H7DsRb0P8f/4itVXrEaT3aHgE3DkmiEJsJXrNg5 xuibPiS1HDlSHM0dtZSPuLt8gg/BNTmbQGfD9xq38u/9++du1BlonnYcyJud9pDl9MuT1eEeQGE+G ce+pYJuQ==; To: Dmitry Kozlyuk , Xueming Li Cc: dev@dpdk.org, Narcisa Ana Maria Vasile , Dmitry Malloy , Pallavi Kadam , Neil Horman References: <20210316124520.19726-1-xuemingl@nvidia.com> <20210323023239.2687be4e@sovereign> From: "Kinsella, Ray" Message-ID: <2fbc5945-4f00-3104-f490-2d8d87d78fc9@ashroe.eu> Date: Tue, 23 Mar 2021 09:33:31 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210323023239.2687be4e@sovereign> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-AuthUser: mdr@ashroe.eu Subject: Re: [dpdk-dev] [PATCH] eal: update all buses default scan mode 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 Sender: "dev" On 22/03/2021 23:32, Dmitry Kozlyuk wrote: > 2021-03-16 20:45 (UTC+0800), Xueming Li: > [...] >> diff --git a/lib/librte_eal/common/eal_common_bus.c b/lib/librte_eal/common/eal_common_bus.c >> index baa5b532af..ebbb3995f6 100644 >> --- a/lib/librte_eal/common/eal_common_bus.c >> +++ b/lib/librte_eal/common/eal_common_bus.c >> @@ -277,3 +277,19 @@ rte_bus_sigbus_handler(const void *failure_addr) >> >> return ret; >> } >> + >> +static bool mode_set; > > Could be function-local if we really want to save list traversals. > >> + >> +void >> +rte_bus_scan_mode_update(enum rte_bus_scan_mode mode) >> +{ >> + struct rte_bus *bus; >> + >> + if (mode_set) >> + return; >> + TAILQ_FOREACH(bus, &rte_bus_list, next) { >> + if (bus->conf.scan_mode == RTE_BUS_SCAN_UNDEFINED) >> + bus->conf.scan_mode = mode; >> + } >> + mode_set = true; >> +} > > [...] >> /** >> * Create the unix channel for primary/secondary communication. >> * >> diff --git a/lib/librte_eal/rte_eal_exports.def b/lib/librte_eal/rte_eal_exports.def >> index 474cf123fa..2757f31461 100644 >> --- a/lib/librte_eal/rte_eal_exports.def >> +++ b/lib/librte_eal/rte_eal_exports.def >> @@ -11,6 +11,7 @@ EXPORTS >> rte_bus_probe >> rte_bus_register >> rte_bus_scan >> + rte_bus_scan_mode_update >> rte_bus_unregister >> rte_calloc >> rte_calloc_socket >> diff --git a/lib/librte_eal/version.map b/lib/librte_eal/version.map >> index fce90a112f..171bca478d 100644 >> --- a/lib/librte_eal/version.map >> +++ b/lib/librte_eal/version.map >> @@ -417,6 +417,8 @@ EXPERIMENTAL { >> INTERNAL { >> global: >> >> + rte_bus_scan_mode_update; >> + >> rte_mem_lock; >> rte_mem_map; >> rte_mem_page_size; > > New function is private to EAL, so it doesn't need exporting. > Right - it is annotated as INTERNAL.