From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2] eal_pci: Fix max_vfs missing for none igb_uio driver Date: Thu, 12 Feb 2015 17:25:05 +0100 Message-ID: <1893948.saDpN2FujX@xps13> References: <1423653001-11660-1-git-send-email-michael.qiu@intel.com> <1423661155-16645-1-git-send-email-michael.qiu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Michael Qiu Return-path: In-Reply-To: <1423661155-16645-1-git-send-email-michael.qiu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 2015-02-11 21:25, Michael Qiu: > max_vfs will only be created by igb_uio driver, for other > drivers like vfio or pci_uio_generic, max_vfs will miss. > > But sriov_numvfs is not driver related, just get the vf numbers > from that field. > > Signed-off-by: Michael Qiu [...] > snprintf(filename, sizeof(filename), "%s/max_vfs", dirname); > if (!access(filename, F_OK) && > - eal_parse_sysfs_value(filename, &tmp) == 0) { > + eal_parse_sysfs_value(filename, &tmp) == 0) > dev->max_vfs = (uint16_t)tmp; > + else { > + /* for none igb_uio driver, need kernel I think it's a typo. Do you mean "for non igb_uio driver"? > + * version greater than 3.8 */ > + snprintf(filename, sizeof(filename), > + "%s/sriov_numvfs", dirname); > + if (!access(filename, F_OK) && > + eal_parse_sysfs_value(filename, &tmp) == 0) > + dev->max_vfs = (uint16_t)tmp; > } > > /* get numa node */ >