# how do I know a PCI device (NIC) is active?



## mrjayviper (Jun 14, 2022)

setup info and other related info


I'm using vmware with FreeBSD running as a guest OS
I have an Emulex 10G card and have enabled SR-IOV inside Vmware
I have added one of the "virtual" Emulex ports to the FreeBSD guest OS
I can see Emulex in `dmesg` (see screenshot below)
I can see the emulex kernel module is getting loaded (`kldstat`)
The oce0 interface is NOT listed in `ifconfig`

How do I make it appear in ifconfig so I can configure its IP/etc?

Thanks!






EDIT: more info (based on the suggested commands below)

`pciconf -lv`


```
none0@pci0:11:0:0:      class=0x020000 rev=0x01 hdr=0x00 vendor=0x19a2 device=0x0710 subvendor=0x103c subdevice=0x3340
    vendor     = 'Emulex Corporation'
    device     = 'OneConnect 10Gb NIC (be3)'
    class      = network
    subclass   = ethernet

vmx0@pci0:19:0:0:       class=0x020000 rev=0x01 hdr=0x00 vendor=0x15ad device=0x07b0 subvendor=0x15ad subdevice=0x07b0
    vendor     = 'VMware'
    device     = 'VMXNET3 Ethernet Controller'
    class      = network
    subclass   = etherne
```

`sysctl dev.oce`


```
dev.oce.%parent:
```

`kldload -v if_oce`


```
kldload: can't load if_oce: module already loaded or in kernel
```


----------



## msplsh (Jun 14, 2022)

So it says there's no such interface when you use `ifconfig oce0`?  Does it show up in sysctl?

If you can load the kernel module from the install media booted live and have it show up, it might be a VMWare issue.


----------



## Alain De Vos (Jun 14, 2022)

If found this from broadcom,


			https://docs.broadcom.com/doc/12356125
		

Try

```
ifconfig -m oce0
ifconfig oce0 up
```


----------



## Phishfry (Jun 14, 2022)

When the card is used as with SR-IOV then the interface can show up different.

For example see Chelsio:





						cxgbe(4)
					






					www.freebsd.org
				



So regular interface is cxl and the virtualized version is vcxl

Same with Intel 10G VF interfaces:





						iavf(4)
					






					www.freebsd.org
				




The manpage is not much help:





						oce(4)
					






					www.freebsd.org
				




/boot/loader.conf
if_oce_load="YES"


----------



## Phishfry (Jun 14, 2022)

It does look like the oce driver is different.


> The same driver supports both the PF and VF devices








						oce -  man pages section 7: Device and Network Interfaces
					

The oce 10 GBit ethernet adapter driver is a STREAMS based GLD (NIC driver) for 10G Ethernet functions present on the Emulex OneConnect cards.



					docs.oracle.com


----------



## Phishfry (Jun 14, 2022)

Please show us these from FreeBSD VM:

`pciconf -lv`

`sysctl dev.oce`


----------



## mrjayviper (Jun 15, 2022)

Phishfry said:


> Please show us these from FreeBSD VM:
> 
> `pciconf -lv`
> 
> `sysctl dev.oce`


edited my original post to show the results of those commands. thanks


----------



## Phishfry (Jun 15, 2022)

What happens if you try and load oce manually in the VM?
`kldload -v if_oce`


----------



## mrjayviper (Jun 15, 2022)

Phishfry said:


> What happens if you try and load oce manually in the VM?
> `kldload -v if_oce`


kldload -v if_oce

kldload: can't load if_oce: module already loaded or in kernel


----------



## Phishfry (Jun 15, 2022)

OK well it appears everything is OK and loading correctly.
The Emulex people maintain the driver.
Try and email them asking if they support VF on FreeBSD.
_freebsd-drivers@emulex.com_.
It is not mentioned in the manpage so I would not assume so much.


----------



## Phishfry (Jun 15, 2022)

I was wondering why Alain De Vos was leaving a Broadcom link.
They bought Emulex.
That is not good news.


----------



## msplsh (Jun 15, 2022)

mrjayviper said:


> dev.oce.%parent:


Hm, that looks like it's not presenting part of the device to FreeBSD



mrjayviper said:


> none0


This also looks like something is missing.



mrjayviper said:


> I have added one of the "virtual" Emulex ports to the FreeBSD guest OS


Maybe something went wrong here.


----------



## Phishfry (Jun 15, 2022)

msplsh said:


> Maybe something went wrong here.


Actually his pciconf looks like the VF device is passed thru. Just nothing attached inside VM.
That does not mean that it works. But it is mostly there. So maybe it is WIP and not done yet?



mrjayviper said:


> none0@pci0:11:0:0: class=0x020000 rev=0x01 hdr=0x00 vendor=0x19a2 device=0x0710 subvendor=0x103c subdevice=0x3340 vendor = 'Emulex Corporation' device = 'OneConnect 10Gb NIC (be3)' class = network subclass = ethernet



What I wonder if the oce firmware is loading inside the VM.


----------

