From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id B1EF21B3A9 for ; Tue, 4 Dec 2018 07:33:45 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Dec 2018 22:33:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,312,1539673200"; d="scan'208";a="98451295" Received: from btwcube1.sh.intel.com (HELO btwcube1) ([10.67.104.173]) by orsmga008.jf.intel.com with ESMTP; 03 Dec 2018 22:33:43 -0800 Date: Tue, 4 Dec 2018 14:31:51 +0800 From: Tiwei Bie To: Xiao Wang Cc: maxime.coquelin@redhat.com, dev@dpdk.org, zhihong.wang@intel.com, xiaolong.ye@intel.com Message-ID: <20181204063150.GA20433@btwcube1> References: <20181128094607.106173-1-xiao.w.wang@intel.com> <20181128094607.106173-7-xiao.w.wang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20181128094607.106173-7-xiao.w.wang@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH 6/9] net/ifc: add devarg for LM mode 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: Tue, 04 Dec 2018 06:33:46 -0000 On Wed, Nov 28, 2018 at 05:46:04PM +0800, Xiao Wang wrote: [...] > @@ -767,6 +771,7 @@ ifcvf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, > struct ifcvf_internal *internal = NULL; > struct internal_list *list = NULL; > int vdpa_mode = 0; > + int sw_fallback_lm = 0; > struct rte_kvargs *kvlist = NULL; > int ret = 0; > > @@ -826,6 +831,16 @@ ifcvf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, > internal->dev_addr.type = PCI_ADDR; > list->internal = internal; > > + if (rte_kvargs_count(kvlist, IFCVF_SW_FALLBACK_LM)) { > + ret = rte_kvargs_process(kvlist, IFCVF_SW_FALLBACK_LM, > + &open_int, &sw_fallback_lm); > + if (ret < 0) > + goto error; > + internal->sw_lm = sw_fallback_lm ? true : false; > + } else { > + internal->sw_lm = false; > + } Something like this would be better: if (rte_kvargs_count(kvlist, IFCVF_SW_FALLBACK_LM)) { ret = rte_kvargs_process(kvlist, IFCVF_SW_FALLBACK_LM, &open_int, &sw_fallback_lm); if (ret < 0) goto error; } internal->sw_lm = sw_fallback_lm; > internal->did = rte_vdpa_register_device(&internal->dev_addr, > &ifcvf_ops); > if (internal->did < 0) { > -- > 2.15.1 >