From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 3A42D7CF0 for ; Mon, 4 Sep 2017 18:23:54 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2017 09:23:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,475,1498546800"; d="scan'208";a="125449840" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.57]) ([10.237.220.57]) by orsmga004.jf.intel.com with ESMTP; 04 Sep 2017 09:23:51 -0700 To: Jan Blunck , dev@dpdk.org References: <20170711232512.54641-1-jblunck@infradead.org> <20170714211213.34436-1-jblunck@infradead.org> <20170714211213.34436-7-jblunck@infradead.org> From: Ferruh Yigit Message-ID: <81444c40-7fc3-5b51-8c15-58f04019d116@intel.com> Date: Mon, 4 Sep 2017 17:23:50 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20170714211213.34436-7-jblunck@infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v2 06/15] bus: add configuration interface for buses 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: , X-List-Received-Date: Mon, 04 Sep 2017 16:23:54 -0000 On 7/14/2017 10:12 PM, Jan Blunck wrote: > Signed-off-by: Jan Blunck > --- > lib/librte_eal/bsdapp/eal/rte_eal_version.map | 1 + > lib/librte_eal/common/eal_common_bus.c | 16 ++++++++++++++++ > lib/librte_eal/common/include/rte_bus.h | 9 +++++++++ > lib/librte_eal/linuxapp/eal/rte_eal_version.map | 1 + > 4 files changed, 27 insertions(+) > <...> > > +int rte_bus_configure(struct rte_bus *bus, const struct rte_bus_conf *conf) > +{ > + if (bus == NULL) > + return -1; > + > + /* only set bus scan policy if it was unset before */ > + if (bus->conf.scan_mode == RTE_BUS_SCAN_UNDEFINED) { > + RTE_LOG(DEBUG, EAL, "Bus [%s] scan_mode=%d\n", bus->name, > + conf->scan_mode); > + bus->conf.scan_mode = conf->scan_mode; > + } else if (bus->conf.scan_mode != conf->scan_mode) > + return -1; Right now "struct rte_bus_conf" has only field "scan_mode", so this function implemented as set scan_mode is no issue. But if in the future, "struct rte_bus_conf" extended to have another field, this same function will be used and this will be confusing. What do you think make this function rte_bus_configure_scan_mode(), is it overkill? > + > + return 0; > +} > + <...>