Hi,Andrey > -----Original Message----- > From: Chilikin, Andrey > Sent: Friday, October 13, 2017 6:07 PM > To: Zhao1, Wei <wei.zh...@intel.com>; dev@dpdk.org > Cc: Zhao1, Wei <wei.zh...@intel.com>; Yigit, Ferruh > <ferruh.yi...@intel.com>; Xing, Beilei <beilei.x...@intel.com>; Wu, Jingjing > <jingjing...@intel.com> > Subject: RE: [dpdk-dev] [PATCH v8 1/2] net/i40e: queue region set and flush > > Hi Wei > > Sorry for the late comment, but I was not included to the patchset CC list and > just found this new version. > > > -----Original Message----- > > From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Wei Zhao > > Sent: Wednesday, October 11, 2017 9:56 AM > > To: dev@dpdk.org > > Cc: Zhao1, Wei <wei.zh...@intel.com> > > Subject: [dpdk-dev] [PATCH v8 1/2] net/i40e: queue region set and > > flush > > > <snip> > > > +int > > +i40e_flush_queue_region_all_conf(struct rte_eth_dev *dev, > > + struct i40e_hw *hw, struct i40e_pf *pf, uint16_t on) { > > + int32_t ret = -EINVAL; > > + struct i40e_queue_regions *info = &pf->queue_region; > > + > > + if (on) { > > + i40e_queue_region_pf_flowtype_conf(hw, pf); > > + > > + ret = i40e_vsi_update_queue_region_mapping(hw, pf); > > + if (ret != I40E_SUCCESS) { > > + PMD_DRV_LOG(INFO, "Failed to flush queue region > > mapping."); > > + return ret; > > + } > > + > > + ret = i40e_queue_region_dcb_configure(hw, pf); > > + if (ret != I40E_SUCCESS) { > > + PMD_DRV_LOG(INFO, "Failed to flush dcb."); > > + return ret; > > + } > > + > > + return 0; > > + } > > + > > + info->queue_region_number = 1; > > + info->region[0].queue_num = 64; > > Why number of queues is hardcoded to a magic number 64? How it will work > if VSI is enabled with smaller number of queues, for example, 1 or 6? 64 is > the maximum number of queues that can be used for RSS, but VSI might be > created with only few queues.
Yes, I know what is your mean, may be it should be change to struct i40e_vsi *main_vsi = pf->main_vsi; info->region[0].queue_num = main_vsi->nb_used_qps; Do you think so? > > > + info->region[0].queue_start_index = 0; > > + > > + ret = i40e_vsi_update_queue_region_mapping(hw, pf); > > + if (ret != I40E_SUCCESS) > > + PMD_DRV_LOG(INFO, "Failed to flush queue region > > mapping."); > > + > > + ret = i40e_dcb_init_configure(dev, TRUE); > > + if (ret != I40E_SUCCESS) { > > + PMD_DRV_LOG(INFO, "Failed to flush dcb."); > > + pf->flags &= ~I40E_FLAG_DCB; > > + } > > + > > + i40e_init_queue_region_conf(dev); > > + > > + return 0; > > +}