> -----Original Message----- > From: Ananyev, Konstantin > Sent: Sunday, December 3, 2017 7:20 PM > To: Dai, Wei <wei....@intel.com>; Wu, Jingjing <jingjing...@intel.com>; > Xing, Beilei <beilei.x...@intel.com> > Cc: dev@dpdk.org > Subject: RE: [PATCH v6] net/i40e: determine number of queues per VF during > run time > > Hi Wei, > > > -----Original Message----- > > From: Dai, Wei > > Sent: Monday, November 27, 2017 8:09 AM > > To: Wu, Jingjing <jingjing...@intel.com>; Xing, Beilei > > <beilei.x...@intel.com>; Ananyev, Konstantin > > <konstantin.anan...@intel.com> > > Cc: dev@dpdk.org; Dai, Wei <wei....@intel.com> > > Subject: [PATCH v6] net/i40e: determine number of queues per VF during > > run time > > > > Without this patch, the number of queues per i40e VF is defined as 4 > > by CONFIG_RTE_LIBRTE_I40E_QUEUE_NUM_PER_VF=4 in > config/common_base. > > It is fixed value determined in building time and can't be changed > > during run time. > > With this patch, the number of queues per i40e VF can be determinated > > during run time. For example, if the PCI address of an i40e VF is Here it should be 'if the PCI address of an i40e PF is' I will correct it in my v7 patch.
> > aaaa:bb.cc, with the EAL parameter -w aaaa:bb.cc,queue-num-per-vf=8, > > the number of queues per VF is 8. > > If there is no "queue-num-per-vf" setting in EAL parameters, it is 4 > > by default as before. And if the value after the "queue-num-per-vf" > > is invalid, it is set as 4 forcibly. The valid values include 1, 2, 4, > > 8, 16 . > > > > Signed-off-by: Wei Dai <wei....@intel.com> > > > > --- > > v6: > > fix a small bug when detecting end character of strtoul > > v5: > > fix git log message and WARNING of coding stype > > v4: > > use rte_kvargs instead of pervious parsing function; > > use malloc/free instead of rte_zmalloc/rte_free. > > v3: > > fix WARNING of coding style issues from checkpa...@dpdk.org > > v2: > > fix WARNING of coding style issues from checkpa...@dpdk.org > > --- > > config/common_base | 1 - > > drivers/net/i40e/i40e_ethdev.c | 67 > > ++++++++++++++++++++++++++++++++++++++++-- > > 2 files changed, 65 insertions(+), 3 deletions(-) > > > > + if (errno != 0 || end == value || *end != 0) { > > + PMD_DRV_LOG(WARNING, "Wrong VF queue number = %s, Now it > is " > > + "kept the value = %hu", value, pf->vf_nb_qp_max); > > + return -(EINVAL); > > + } > > + > > + if (num <= 16 && rte_is_power_of_2(num)) > > As a nit - better to use some macro instead of '16' here. > Apart from that - looks good to me. > Acked-by: Konstantin Ananyev <konstantin.anan...@intel.com> Thanks for your Ack, Konstantin. I will use the macro I40E_MAX_QP_NUM_PER_VF instead of 16 in my v7 patch. This macro is already defined as 16 in i40e_ethdev.h > > > + pf->vf_nb_qp_max = (uint16_t)num; > > + else > > + /* here return 0 to make next valid same argument work */ > > + PMD_DRV_LOG(WARNING, "Wrong VF queue number = %lu, it > must be " > > + "power of 2 and equal or less than 16 !, Now it is " > > + "kept the value = %hu", num, pf->vf_nb_qp_max); > > + > > + return 0; > > +}