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 AA804A034F; Tue, 23 Mar 2021 00:32:45 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 63BA64067B; Tue, 23 Mar 2021 00:32:43 +0100 (CET) Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) by mails.dpdk.org (Postfix) with ESMTP id 115CB40151 for ; Tue, 23 Mar 2021 00:32:42 +0100 (CET) Received: by mail-lj1-f169.google.com with SMTP id f26so23239011ljp.8 for ; Mon, 22 Mar 2021 16:32:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9A+c5mKYUVEAzpCfrpp//MD2qdI33oX53wLTBLbuuyg=; b=JKkwsvkqtL3lmWAfHdgYnO7fA0o7laDzy9aUZuBZ/x9h9GffJN+Knfg3S7b5HrzHeo I3+IGOdfyOEdsFbXRklENfaecSydhm8+PhDi5Zcr2kh/FM2FJU9GbJsC0QkWK7t1Dc4/ i8RxwpN4Xslb29KkBvUTWRIT3yY61Riowq0RStByHIPWYeq/eD9ARKXp1UaRpF8aPWLW z0ciCi4o3koLebxkXHak7CKNm+2tRAzQUvfVFj4o/UQnLD91F9Mn+cm8dOEnVGH8ozkL 03NpJhBUpHrgttwpSNF1hbFGAVqqZv+BIxgo/zdR4JXT0m1jrbKD1WYyrW+oqMDWwV9J 1wLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9A+c5mKYUVEAzpCfrpp//MD2qdI33oX53wLTBLbuuyg=; b=DfjrOxjGi/5eAzMysLNvVmjBAwPoO5iDcvhu8O1MEYNUIgywQZLze5OiGdFsF/LGNq oa3yZA3wTRTIBQ7vPVzP8EITj6/nuA3gFBZwxuVWOTfjZ+eiHvN6QeSrN22ZM6yqqRZU Kpi1V32yXfjxP3yJEOOKb5RT0P0ZWC/V6DyH3+yDMO1qkpNAlVW/gUqz0Y8a/g3kgk3L u8IXq+Y75h753JHXzy/CUAc79KvFmldWpoH667IwoInNnF2cjgISWR4Q7e98Fy5cJ1pv UXQ3uATSAGfIHzTBQkIDEnSzYtnc+sJeJ+vJJxUbCMp3qX13l1vuYNmXVQ5uakJUtifg 1z1A== X-Gm-Message-State: AOAM530R9kF+O88fbR+bFHMAlCyqbZLK7Gi4gW8M+8AbRJyIbsCOjXXk ARGbZ+aAWF4QbYHs+WaKxts= X-Google-Smtp-Source: ABdhPJxxB9QJm0rzn9yKU+umrx2faTtMAnvlw0TJAG+O7N+xEM/cA1YedLoniZVSMg0uiQSMjAuqxg== X-Received: by 2002:a2e:581d:: with SMTP id m29mr1191924ljb.97.1616455961562; Mon, 22 Mar 2021 16:32:41 -0700 (PDT) Received: from sovereign (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id e15sm2148497ljg.54.2021.03.22.16.32.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Mar 2021 16:32:40 -0700 (PDT) Date: Tue, 23 Mar 2021 02:32:39 +0300 From: Dmitry Kozlyuk To: Xueming Li Cc: dev@dpdk.org, Narcisa Ana Maria Vasile , Dmitry Malloy , Pallavi Kadam , Ray Kinsella , Neil Horman Message-ID: <20210323023239.2687be4e@sovereign> In-Reply-To: <20210316124520.19726-1-xuemingl@nvidia.com> References: <20210316124520.19726-1-xuemingl@nvidia.com> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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" 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.