Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Mar 2019 10:26:05 -0700
From:      John Baldwin <jhb@FreeBSD.org>
To:        Ian Lepore <ian@freebsd.org>, "Hongxiong Xian (Wicresoft North America Ltd)" <v-hoxian@microsoft.com>, "freebsd-current@freebsd.org" <freebsd-current@freebsd.org>
Subject:   Re: How to hotplug a PCI device (such as VF) on FreeBSD
Message-ID:  <8a09064c-2792-ddd7-197e-8b9023ed5a57@FreeBSD.org>
In-Reply-To: <870b2d47aa83dafac107fb32e25afe26f3295208.camel@freebsd.org>
References:  <HK0P153MB0130D768D53BF1FBE68C5AA1835E0@HK0P153MB0130.APCP153.PROD.OUTLOOK.COM> <870b2d47aa83dafac107fb32e25afe26f3295208.camel@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 3/25/19 7:05 AM, Ian Lepore wrote:
> On Mon, 2019-03-25 at 08:49 +0000, Hongxiong Xian (Wicresoft North
> America Ltd) wrote:
>> Hi,
>>
>> I'm looking for a way to refresh the pci device list.
>> In Linux, we can remove a particular pci device, and then after
>> preforming a "rescan" the device will appear again.
>> For example, disable/rescind PCI (such as VF) :
>> echo 1 >  /sys/bus/pci/devices/0001\:00\:02.0/remove
>> # Get the device back
>> echo 1 > /sys/bus/pci/rescan
>>
>> I'm looking for a similar way in FreeBSD. Does the FreeBSD support
>> the hotplug of a PCI device?  Thanks in advance!
>>
>>
> 
> I think 'devctl rescan' will do that, 'man devctl' for details.

For VFs you can create/remote them using iovctl on the PF device.

You can also use 'devctl rescan' to force a rescan of a PCI bus as
Ian noted.  For native PCI-express hotplug you should not need to
do manual rescans (though FreeBSD does not support PCI-e hotplug
via Thunderbolt).

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8a09064c-2792-ddd7-197e-8b9023ed5a57>