linux-stable/net/core
Shay Drory a8ce7b26a5 devlink: Expose port function commands to control migratable
Expose port function commands to enable / disable migratable
capability, this is used to set the port function as migratable.

Live migration is the process of transferring a live virtual machine
from one physical host to another without disrupting its normal
operation.

In order for a VM to be able to perform LM, all the VM components must
be able to perform migration. e.g.: to be migratable.
In order for VF to be migratable, VF must be bound to VFIO driver with
migration support.

When migratable capability is enabled for a function of the port, the
device is making the necessary preparations for the function to be
migratable, which might include disabling features which cannot be
migrated.

Example of LM with migratable function configuration:
Set migratable of the VF's port function.

$ devlink port show pci/0000:06:00.0/2
pci/0000:06:00.0/2: type eth netdev enp6s0pf0vf1 flavour pcivf pfnum 0
vfnum 1
    function:
        hw_addr 00:00:00:00:00:00 migratable disable

$ devlink port function set pci/0000:06:00.0/2 migratable enable

$ devlink port show pci/0000:06:00.0/2
pci/0000:06:00.0/2: type eth netdev enp6s0pf0vf1 flavour pcivf pfnum 0
vfnum 1
    function:
        hw_addr 00:00:00:00:00:00 migratable enable

Bind VF to VFIO driver with migration support:
$ echo <pci_id> > /sys/bus/pci/devices/0000:08:00.0/driver/unbind
$ echo mlx5_vfio_pci > /sys/bus/pci/devices/0000:08:00.0/driver_override
$ echo <pci_id> > /sys/bus/pci/devices/0000:08:00.0/driver/bind

Attach VF to the VM.
Start the VM.
Perform LM.

Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Acked-by: Shannon Nelson <shannon.nelson@amd.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-12-07 20:09:18 -08:00
..
bpf_sk_storage.c bpf: Consolidate spin_lock, timer management into btf_record 2022-11-03 22:19:40 -07:00
datagram.c
dev.c net: add netdev_sw_irq_coalesce_default_on() 2022-12-03 21:48:36 +00:00
dev.h net: add new helper unregister_netdevice_many_notify 2022-10-31 18:10:21 -07:00
dev_addr_lists.c
dev_addr_lists_test.c
dev_ioctl.c net: dev: Convert sa_data to flexible array in struct sockaddr 2022-10-25 11:44:20 -07:00
devlink.c devlink: Expose port function commands to control migratable 2022-12-07 20:09:18 -08:00
drop_monitor.c genetlink: introduce split op representation 2022-11-07 12:30:16 +00:00
dst.c
dst_cache.c
failover.c net/core: Allow live renaming when an interface is up 2022-11-09 13:08:12 +00:00
fib_notifier.c
fib_rules.c
filter.c bpf-next-for-netdev 2022-11-28 19:42:17 -08:00
flow_dissector.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-11-29 13:04:52 -08:00
flow_offload.c net: flow_offload: add support for ARP frame matching 2022-11-14 11:24:16 +00:00
gen_estimator.c
gen_stats.c net: Remove the obsolte u64_stats_fetch_*_irq() users (net). 2022-10-28 20:13:54 -07:00
gro.c net: gro: no longer use skb_vlan_tag_present() 2022-11-11 18:18:05 -08:00
gro_cells.c net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
hwbm.c
link_watch.c net: linkwatch: only report IF_OPER_LOWERLAYERDOWN if iflink is actually down 2022-11-16 09:45:00 +00:00
lwt_bpf.c
lwtunnel.c xfrm: lwtunnel: squelch kernel warning in case XFRM encap type is not available 2022-10-12 10:45:51 +02:00
Makefile
neighbour.c net: neigh: decrement the family specific qlen 2022-11-18 10:29:50 +00:00
net-procfs.c
net-sysfs.c net: devlink: use devlink_port pointer instead of ndo_get_devlink_port 2022-11-03 20:48:36 -07:00
net-sysfs.h
net-traces.c
net_namespace.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-10-24 13:44:11 -07:00
netclassid_cgroup.c
netevent.c
netpoll.c
netprio_cgroup.c
of_net.c of: net: export of_get_mac_address_nvmem() 2022-11-29 10:45:53 +01:00
page_pool.c
pktgen.c treewide: use get_random_u32() when possible 2022-10-11 17:42:58 -06:00
ptp_classifier.c
request_sock.c
rtnetlink.c net: expose devlink port over rtnetlink 2022-11-03 20:48:37 -07:00
scm.c
secure_seq.c
selftests.c
skbuff.c net: mm_account_pinned_pages() optimization 2022-11-16 12:42:00 +00:00
skmsg.c bpf, sock_map: Move cancel_work_sync() out of sock lock 2022-11-03 13:51:06 +01:00
sock.c soreuseport: Fix socket selection for SO_INCOMING_CPU. 2022-10-25 11:35:16 +02:00
sock_destructor.h
sock_diag.c net: fix __sock_gen_cookie() 2022-11-21 20:36:30 -08:00
sock_map.c bpf, sock_map: Move cancel_work_sync() out of sock lock 2022-11-03 13:51:06 +01:00
sock_reuseport.c soreuseport: Fix socket selection for SO_INCOMING_CPU. 2022-10-25 11:35:16 +02:00
stream.c treewide: use prandom_u32_max() when possible, part 1 2022-10-11 17:42:55 -06:00
sysctl_net_core.c
timestamping.c
tso.c
utils.c net: core: inet[46]_pton strlen len types 2022-11-01 21:14:39 -07:00
xdp.c xdp: improve page_pool xdp_return performance 2022-09-26 11:28:19 -07:00