From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: RES: RES: hw.nic_uio.bdfs Date: Thu, 17 Apr 2014 16:05:46 +0200 Message-ID: <3597800.xQpD0niGsC@xps13> References: <016f01cf48c3$99aedc30$cd0c9490$@hotmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Fred Pedrisa Return-path: In-Reply-To: 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" Hi Fred, 2014-03-26 04:22, Fred Pedrisa: > Here is my fix for probe code : > > static int > nic_uio_probe (device_t dev) > { > int i, len; > char *remaining; > long bus = 0, device = 0, function = 0; > remaining = bdf_str; > len = strlen(remaining); > > for (i = 0; remaining && len >= 5 && i < len;i+=6) { > if ( remaining[i + 1] == ':' && remaining[i + 3] == ':' ) { > bus = strtol(&remaining[i + 0],NULL,0); > device = strtol(&remaining[i + 2],NULL,0); > function = strtol(&remaining[i + 4],NULL,0); > if (dev != NULL) { > if (pci_get_bus(dev) == bus && > pci_get_slot(dev) == device && pci_get_function(dev) == function) { > printf("nic_uio: success blocking > probe of : %ld:%ld:%ld!\n", bus, device, function); > return (ENXIO); > } > } > } > } > > for (i = 0; i < NUM_DEVICES; i++) > if (pci_get_vendor(dev) == devices[i].vend && > pci_get_device(dev) == devices[i].dev) { > > device_set_desc(dev, "Intel(R) DPDK PCI Device"); > return (BUS_PROBE_SPECIFIC); > } > > return (ENXIO); > } > > Now it is working as intended ;) If you think a patch should be applied, please send it with git-send-email as described in http://dpdk.org/dev#send Thank you -- Thomas