[dpdk-dev] [PATCH 6/9] net/ifc: add devarg for LM mode

Wang, Xiao W xiao.w.wang at intel.com
Wed Dec 12 07:53:05 CET 2018


Hi,

> -----Original Message-----
> From: Bie, Tiwei
> Sent: Monday, December 3, 2018 10:32 PM
> To: Wang, Xiao W <xiao.w.wang at intel.com>
> Cc: maxime.coquelin at redhat.com; dev at dpdk.org; Wang, Zhihong
> <zhihong.wang at intel.com>; Ye, Xiaolong <xiaolong.ye at intel.com>
> Subject: Re: [PATCH 6/9] net/ifc: add devarg for LM mode
> 
> 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;
> 

Yeah, shorter lines of code, will have an update.

BRs,
Xiao

> 
> >  	internal->did = rte_vdpa_register_device(&internal->dev_addr,
> >  				&ifcvf_ops);
> >  	if (internal->did < 0) {
> > --
> > 2.15.1
> >


More information about the dev mailing list