linux-stable/drivers/net
Jacob Keller d3da0d4d9f ice: use relative VSI index for VFs instead of PF VSI number
[ Upstream commit 11fbb1bfb5 ]

When initializing over virtchnl, the PF is required to pass a VSI ID to the
VF as part of its capabilities exchange. The VF driver reports this value
back to the PF in a variety of commands. The PF driver validates that this
value matches the value it sent to the VF.

Some hardware families such as the E700 series could use this value when
reading RSS registers or communicating directly with firmware over the
Admin Queue.

However, E800 series hardware does not support any of these interfaces and
the VF's only use for this value is to report it back to the PF. Thus,
there is no requirement that this value be an actual VSI ID value of any
kind.

The PF driver already does not trust that the VF sends it a real VSI ID.
The VSI structure is always looked up from the VF structure. The PF does
validate that the VSI ID provided matches a VSI associated with the VF, but
otherwise does not use the VSI ID for any purpose.

Instead of reporting the VSI number relative to the PF space, report a
fixed value of 1. When communicating with the VF over virtchnl, validate
that the VSI number is returned appropriately.

This avoids leaking information about the firmware of the PF state.
Currently the ice driver only supplies a VF with a single VSI. However, it
appears that virtchnl has some support for allowing multiple VSIs. I did
not attempt to implement this. However, space is left open to allow further
relative indexes if additional VSIs are provided in future feature
development. For this reason, keep the ice_vc_isvalid_vsi_id function in
place to allow extending it for multiple VSIs in the future.

This change will also simplify handling of live migration in a future
series. Since we no longer will provide a real VSI number to the VF, there
will be no need to keep track of this number when migrating to a new host.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-13 13:10:02 +02:00
..
arcnet net: fill in MODULE_DESCRIPTION()s for missing arcnet 2024-02-15 08:03:46 -08:00
bonding xdp, bonding: Fix feature flags when there are no slave devs anymore 2024-03-05 16:19:42 -08:00
caif
can can: m_can: Start/Cancel polling timer together with interrupts 2024-03-26 18:16:43 -04:00
dsa net: dsa: qca8k: put MDIO controller OF node if unavailable 2024-04-13 13:09:57 +02:00
ethernet ice: use relative VSI index for VFs instead of PF VSI number 2024-04-13 13:10:02 +02:00
fddi net: fill in MODULE_DESCRIPTION()s for fddik/skfp 2024-02-15 08:03:46 -08:00
fjes fjes: fix memleaks in fjes_hw_setup 2024-01-24 18:03:53 -08:00
hamradio
hippi
hyperv hv_netvsc: Register VF in netvsc_probe if NET_DEVICE_REGISTER missed 2024-02-04 13:38:08 +00:00
ieee802154 net: fill in MODULE_DESCRIPTION()s for ieee802154/fakelb 2024-02-15 08:03:45 -08:00
ipa net: ipa: don't overrun IPA suspend interrupt registers 2024-02-21 11:25:17 +00:00
ipvlan net: fill in MODULE_DESCRIPTION()s for ipvtap 2024-02-09 14:12:02 -08:00
mctp
mdio net: mdio: mux-bcm-iproc: Use alignment helpers and SZ_4K 2024-01-03 16:40:59 -08:00
netdevsim netdevsim: avoid potential loop in nsim_dev_trap_report_work() 2024-02-02 11:00:38 -08:00
pcs net: pcs: xpcs: Return EINVAL in the internal methods 2024-04-13 13:10:00 +02:00
phy net: phy: phy_device: Prevent nullptr exceptions on ISR 2024-04-13 13:09:57 +02:00
plip net: fill in MODULE_DESCRIPTION()s for plip 2024-02-15 08:03:46 -08:00
ppp net: fill in MODULE_DESCRIPTION()s for ppp 2024-02-15 08:03:46 -08:00
pse-pd
slip net: fill in MODULE_DESCRIPTION()s for SLIP 2024-01-11 16:16:08 -08:00
team
thunderbolt
usb net: usb: ax88179_178a: avoid the interface always configured as random address 2024-04-10 16:38:03 +02:00
vmxnet3 vmxnet3: Fix missing reserved tailroom 2024-03-26 18:17:32 -04:00
vxlan net: add netdev_lockdep_set_classes() to virtual drivers 2024-04-13 13:09:59 +02:00
wan net: fill in MODULE_DESCRIPTION()s for ds26522 module 2024-01-11 16:16:08 -08:00
wireguard wireguard: netlink: access device through ctx instead of peer 2024-04-03 15:32:26 +02:00
wireless wifi: iwlwifi: Add missing MODULE_FIRMWARE() for *.pnvm 2024-04-13 13:10:01 +02:00
wwan net: wwan: t7xx: Split 64bit accesses to fix alignment issues 2024-04-10 16:37:56 +02:00
xen-netback net: fill in MODULE_DESCRIPTION()s for xen-netback 2024-02-15 08:03:45 -08:00
Kconfig
LICENSE.SRC
Makefile
Space.c
amt.c amt: do not use overwrapped cb area 2024-01-11 16:55:17 -08:00
bareudp.c
dummy.c net: add netdev_lockdep_set_classes() to virtual drivers 2024-04-13 13:09:59 +02:00
eql.c
geneve.c net: add netdev_lockdep_set_classes() to virtual drivers 2024-04-13 13:09:59 +02:00
gtp.c gtp: fix use-after-free and null-ptr-deref in gtp_newlink() 2024-02-29 14:14:18 +01:00
ifb.c
loopback.c net: add netdev_lockdep_set_classes() to virtual drivers 2024-04-13 13:09:59 +02:00
macsec.c Revert "net: macsec: use skb_ensure_writable_head_tail to expand the skb" 2024-01-23 17:17:04 -08:00
macvlan.c
macvtap.c
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c
netkit.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tap.c
tun.c tun: Fix xdp_rxq_info's queue_index when detaching 2024-02-23 16:17:41 -08:00
veth.c net: add netdev_lockdep_set_classes() to virtual drivers 2024-04-13 13:09:59 +02:00
virtio_net.c virtio_net: Fix "‘%d’ directive writing between 1 and 11 bytes into a region of size 10" warnings 2024-01-11 16:54:34 -08:00
vrf.c
vsockmon.c
xen-netfront.c xen-netfront: Add missing skb_mark_for_recycle 2024-04-10 16:38:02 +02:00