Skip to content

ice(4): Add host SR-IOV support #1573

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

kgalazka
Copy link
Contributor

Allows creating Virtual Functions on E800 adapters with up to 16 queues.
Changing MAC address and using promiscuous mode for each VF
may be enabled in configuration.

Please be advised that this is still work in progress and may be unstable.

Authored-by: Eric Joyner erj@FreeBSD.org
Signed-off-by: Krzysztof Galazka krzysztof.galazka@intel.com

@concussious
Copy link
Contributor

Changing MAC address and using promiscuous mode for each VF may be enabled in configuration.

Would you be willing to update the manual page for this change?

@ricera
Copy link
Contributor

ricera commented Feb 7, 2025

If I was sufficiently motivated, I could maybe take a crack at it.

@kgalazka have you tried this on E830 devices? The last time I tried it didn't work; I don't know if it's worth calling out somewhere that it doesn't work on those since E830 hasn't been released yet, but I imagine once they are people will expect this to work on those and will be surprised that it mysteriously does not.

@@ -369,6 +369,14 @@ ice_iov_add_vf(struct ice_softc *sc, uint16_t vfnum, const nvlist_t *params)
goto release_imap;
}

/* Add the broadcast address */
error = ice_add_vsi_mac_filter(vsi, broadcastaddr);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing this here might mean that this doesn't get re-added after a reset, right? Though, I want to swear that broadcast promiscuous mode should be getting enabled on this VF VSI already.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing this here might mean that this doesn't get re-added after a reset, right?

Yeah, it's not the best place and I intend to move it.

Though, I want to swear that broadcast promiscuous mode should be getting enabled on this VF VSI already.

Not in ICE as far as I know. We do that in IXL though.

@kgalazka
Copy link
Contributor Author

@kgalazka have you tried this on E830 devices? The last time I tried it didn't work; I don't know if it's worth calling out somewhere that it doesn't work on those since E830 hasn't been released yet, but I imagine once they are people will expect this to work on those and will be surprised that it mysteriously does not.

Not there yet. I'm trying to make it ready for full blown testing on E810 first.

kgalazka and others added 9 commits June 23, 2025 14:06
Enable basic SR-IOV support for E800 adapters.

Authored-by: Eric Joyner <erj@FreeBSD.org>
Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Filter for unicast MAC address is configured
with a virtual channel message, but filter for
a broadcast traffic was missing. It caused
issues with e.g. ARP.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
VF driver may request to configure MSI-X vectors for less
queues than assigned by PF. Don't try to configure
unassigned vectors to avoid panic.

While at that make the loop process whole array of vectors
received in a VIRTCHNL_OP_CFG_IRQ_MAP message from a VF.
It's not guarantied that vector '0', which is used for other
interrupt causes and is not mapped to a queue, will be always
on the last position. Condition inside the loop already
handles that vector correctly.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
PF driver needs to tear down and setup VF configuration after
a reset event, e.g. due to reloading a VF driver. Re-use
ice_reset_vf function for that by adding new parameter,
which decides if new reset has to be triggered.
This most likely does not cover all necessary steps
and will be extended in future commits.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
On receiving a virtual channel request from VF driver tried
to configure and enable Tx and Rx queues without making
sure that they were disabled. It caused issue with reloading
a VF driver without a reset e.g. in case it crashed.
Fix that by always disabling all Rx and Tx queues.

While at that make sure that only queues requested by VF
driver are enabled. VF driver may use less queues than
assigned to the function when it was created.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Remove existing RSS HENA configuration to make sure that
only config requested by VF is applied and allow VFs to
disable RSS completely.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Let VF driver know that HW supports WB_ON_ITR
feature. It allows polling mode driver such
as DPDK to configure an immediate write-back
of completed descriptors.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Adds two new parameters to iovctl config for VLAN filter limits and MAC
filter limits and gives them defaults of 64 and 16, respectively.

These are intended to limit the number of resources that a VF can
consume so that any one VF cannot starve an other VFs or the PF of
filters.

Signed-off-by: Eric Joyner <eric.joyner@intel.com>
Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
MAC address assigned to a Virtual Function using iovctl configuration
was not passed to the VF, but its presence caused ICE to reject random
address generated by the VF. This lead to VF not being able to send
or recieve traffic. Send the administratively assigned MAC address to
a VF in a response to the 'Get VF Resources' virtual channel command.

While at that replace bcopy with memcpy for consistency, and shorten
an over 80 characters line.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants