- 01 Nov, 2019 1 commit
-
-
Aya Levin authored
When setting number of VFs to 0 (disable SRIOV), clear VF's configuration. Signed-off-by:
Aya Levin <ayal@mellanox.com> Signed-off-by:
Saeed Mahameed <saeedm@mellanox.com>
-
- 03 Jul, 2019 1 commit
-
-
Parav Pandit authored
Functions change event output data size changes when functions other than VFs will be enabled in HCA CAP. With current API, multiple callers needs to align, calculate accurate size of the output data depending on number on non VF functions enabled in the device. Instead of duplicating such math at multiple places, refactor mlx5_esw_query_functions() to return raw output allocated by itself. Caller must free the allocated memory using kvfree() as described in the function comment section. This hides calcuation within mlx5_esw_query_functions() and provides simpler API. Signed-off-by:
Parav Pandit <parav@mellanox.com> Signed-off-by:
Saeed Mahameed <saeedm@mellanox.com>
-
- 01 Jul, 2019 3 commits
-
-
Bodong Wang authored
Enabled number of VFs is key for eswich manager to do flow steering initialization and vport configurations. However, the number of enabled VFs may come from two sources as below. PF: num of VFs is provided by enabled SR-IOV of itself. ECPF: num of VFs is provided by enabled SR-IOV from its peer PF. And SR-IOV can't be enabled from ECPF itself. Current driver handles the two cases in different stages and passing the number of enabled VFs among a large scope of internal functions. It is usually hard to find out where is the real number of VFs from due to layers of argument pass-in. This patch consolidated that number from the entry point of doing eswitch setup, and maintained a copy so that eswitch functions can refer to it directly. Eswitch driver shall always use this number when referring to enabled number of VFs, don't use other numbers such as from SR-IOV. Signed-off-by:
Bodong Wang <bodong@mellanox.com> Signed-off-by:
Saeed Mahameed <saeedm@mellanox.com>
-
Bodong Wang authored
Devlink eswitch mode is not necessarily related to SR-IOV, e.g, ECPF can be at offload mode when SR-IOV is not enabled. Rename the interface and eswitch mode names to decouple from SR-IOV, and cleanup eswitch messages accordingly. Signed-off-by:
Bodong Wang <bodong@mellanox.com> Signed-off-by:
Saeed Mahameed <saeedm@mellanox.com>
-
Parav Pandit authored
While enabling SR-IOV, PCI core already checks that if SR-IOV is already enabled, it returns failure error code. Hence, remove such duplicate check from mlx5_core driver. While at it, make mlx5_device_disable_sriov() to perform cleanup of VFs in reverse order of mlx5_device_enable_sriov(). Signed-off-by:
Parav Pandit <parav@mellanox.com> Signed-off-by:
Saeed Mahameed <saeedm@mellanox.com>
-
- 13 Jun, 2019 1 commit
-
-
Bodong Wang authored
For ECPF with eswitch manager privilege, query the host max VF count by querying the device using query_functions command. With this enhancement: 1. flow steering entries are created only for valid vports based on the max VF count of the PF. 2. Driver only queries cap of valid vport. Eswitch requires the max VFs when doing initialization, so do sr-iov init before eswitch init. Signed-off-by:
Bodong Wang <bodong@mellanox.com> Reviewed-by:
Parav Pandit <parav@mellanox.com> Signed-off-by:
Saeed Mahameed <saeedm@mellanox.com>
-
- 22 Mar, 2019 2 commits
-
-
Parav Pandit authored
It is desired to get rid of num_vfs stored inside mlx5_core_sriov to safely support vports more than vfs. To reduce dependency on mlx5_core_sriov num_vfs, start using pci_num_vf() from pci core. Signed-off-by:
Parav Pandit <parav@mellanox.com> Reviewed-by:
Bodong Wang <bodong@mellanox.com> Signed-off-by:
Saeed Mahameed <saeedm@mellanox.com>
-
Parav Pandit authored
Simplify sriov enable/disable flow for below two checks. 1. PCI core driver allows sriov configuration only on a PF. This is done in drivers/pci/pci-sysfs.c sriov_attrs_are_visible(). 2. PCI core driver allow sriov enablement if the sriov is currently disabled for for a PF. This is done in drivers/pci/pci-sysfs.c sriov_numvfs_store(). Hence there is no need for mlx5 driver to duplicate such checks. Signed-off-by:
Parav Pandit <parav@mellanox.com> Reviewed-by:
Bodong Wang <bodong@mellanox.com> Signed-off-by:
Saeed Mahameed <saeedm@mellanox.com>
-
- 14 Feb, 2019 1 commit
-
-
Bodong Wang authored
Mellanox's SmartNIC combines embedded CPU(e.g, ARM) processing power with advanced network offloads to accelerate a multitude of security, networking and storage applications. With the introduction of the SmartNIC, there is a new PCI function called Embedded CPU Physical Function(ECPF). And it's possible for a PF to get its ICM pages from the ECPF PCI function. Driver shall identify if it is running on such a function by reading a bit in the initialization segment. When firmware asks for pages, it would issue a page request event specifying how many pages it requests and for which function. That driver responds with a manage_pages command providing the requested pages along with an indication for which function it is providing these pages. The encoding before this patch was as follows: function_id == 0: pages are requested for the function receiving the EQE. function_id != 0: pages are requested for VF identified by the function_id value A new one bit field in the EQE identifies that pages are requested for the ECPF. The notion of page_supplier can be introduced here and to support that, manage pages and query pages were modified so firmware can distinguish the following cases: 1. Function provides pages for itself 2. PF provides pages for its VF 3. ECPF provides pages to itself 4. ECPF provides pages for another function This distinction is possible through the introduction of the bit "embedded_cpu_function" in query_pages, manage_pages and page request EQE. Signed-off-by:
Bodong Wang <bodong@mellanox.com> Signed-off-by:
Eli Cohen <eli@mellanox.com> Signed-off-by:
Saeed Mahameed <saeedm@mellanox.com>
-
- 14 Dec, 2018 1 commit
-
-
Rabie Loulou authored
Remove the lag forbid/allow functions, change the lag prereq check to run in the do-bond logic, so every change in the prereq state will cause LAG to be disabled/enabled accordingly after the next do-bond run. Add lag update function, so every component which changes the prereq state and want the LAG to re-calc the conditions can call the update function. Signed-off-by:
Rabie Loulou <rabiel@mellanox.com> Signed-off-by:
Aviv Heller <avivh@mellanox.com> Signed-off-by:
Saeed Mahameed <saeedm@mellanox.com>
-
- 26 Jun, 2018 1 commit
-
-
Or Gerlitz authored
In smartnic env, the host (PF) driver might not be an e-switch manager, hence the FW will err on driver attempts to deal with setting/unsetting the eswitch and as a result the overall setup of sriov will fail. Fix that by avoiding the operation if e-switch management is not allowed for this driver instance. While here, move to use the correct name for the esw manager capability name. Fixes: 81848731 ('net/mlx5: E-Switch, Add SR-IOV (FDB) support') Signed-off-by:
Or Gerlitz <ogerlitz@mellanox.com> Reported-by:
Guy Kushnir <guyk@mellanox.com> Reviewed-by:
Eli Cohen <eli@melloanox.com> Tested-by:
Eli Cohen <eli@melloanox.com> Signed-off-by:
Saeed Mahameed <saeedm@mellanox.com>
-
- 28 Sep, 2017 1 commit
-
-
Or Gerlitz authored
Smatch is screaming: drivers/net/ethernet/mellanox/mlx5/core/sriov.c:112 mlx5_device_enable_sriov() warn: inconsistent indenting fix that. Fixes: 7ecf6d8f ('IB/mlx5: Restore IB guid/policy for virtual functions') Signed-off-by:
Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by:
Saeed Mahameed <saeedm@mellanox.com>
-
- 20 Aug, 2017 1 commit
-
-
Or Gerlitz authored
To fix these checkpatch complaints: CHECK: Blank lines aren't necessary after an open brace '{' CHECK: Blank lines aren't necessary before a close brace '}' Signed-off-by:
Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by:
Saeed Mahameed <saeedm@mellanox.com>
-
- 07 Aug, 2017 1 commit
-
-
Saeed Mahameed authored
Allow to selectively build the driver with or without sriov eswitch, VF representors and TC offloads. Also remove the need of two ndo ops structures (sriov & basic) and keep only one unified ndo ops, compile out VF SRIOV ndos when not needed (MLX5_ESWITCH=n), and for VF netdev calling those ndos will result in returning -EPERM. Signed-off-by:
Saeed Mahameed <saeedm@mellanox.com> Reviewed-by:
Or Gerlitz <ogerlitz@mellanox.com> Cc: Jes Sorensen <jsorensen@fb.com> Cc: kernel-team@fb.com
-
- 27 Jul, 2017 1 commit
-
-
Eran Ben Elisha authored
Upon sriov enable, eswitch is always enabled. Currently, if enable hca failed over all VFs, we would skip eswitch disable as part of sriov disable, which will lead to resources leak. Fix it by disabling eswitch if it was enabled (use indication from eswitch mode). Fixes: 6b6adee3 ('net/mlx5: SRIOV core code refactoring') Signed-off-by:
Eran Ben Elisha <eranbe@mellanox.com> Signed-off-by:
Noa Osherovich <noaos@mellanox.com> Signed-off-by:
Saeed Mahameed <saeedm@mellanox.com>
-
- 24 Jul, 2017 1 commit
-
-
Bodong Wang authored
When a user sets port_guid, node_guid or policy of an IB virtual function, save this information in "struct mlx5_vf_context". This information will be restored later when pci_resume is called. To make sure this works, one can use aer-inject to generate PCI errors on mlx5 devices and verify if relevant fields are restored after PCI resume. Signed-off-by:
Bodong Wang <bodong@mellanox.com> Reviewed-by:
Eli Cohen <eli@mellanox.com> Signed-off-by:
Leon Romanovsky <leon@kernel.org> Signed-off-by:
Doug Ledford <dledford@redhat.com>
-
- 15 Jun, 2017 1 commit
-
-
Moni Shoua authored
LAG cannot work if virtual functions are present. Therefore, if LAG is configured, the attempt to create virtual functions will fail. This gives precedence to LAG over SRIOV which is not the desired behavior as users might want to use the bonding/teaming driver also want to work with SRIOV. In that case we don't want to force an order of actions, first create virtual functions and only than configure a bonding/teaming net device. To fix, if LAG is configured during a request to create virtual functions, remove it and continue. We ignore ENODEV when trying to forbid lag. This makes sense because "No such device" means that lag is forbidden anyway. Signed-off-by:
Moni Shoua <monis@mellanox.com> Reviewed-by:
Aviv Heller <avivh@mellanox.com> Signed-off-by:
Saeed Mahameed <saeedm@mellanox.com>
-
- 11 Sep, 2016 3 commits
-
-
Mohamad Haj Yahia authored
Init/cleanup sriov/eswitch in the core software context init/cleanup flows. Attach/detach sriov/eswitch in the core load/unload flows. Signed-off-by:
Mohamad Haj Yahia <mohamad@mellanox.com> Signed-off-by:
Saeed Mahameed <saeedm@mellanox.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Mohamad Haj Yahia authored
Needed for lightweight and modular internal/pci error handling. Implement sriov attach function which enables pre-saved number of vfs on the device side. Implement sriov detach function which disable the current vfs on the device side. Init/cleanup function only handles sriov software context allocation and destruction. Signed-off-by:
Mohamad Haj Yahia <mohamad@mellanox.com> Signed-off-by:
Saeed Mahameed <saeedm@mellanox.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Mohamad Haj Yahia authored
Simplify the code and makes it look modular and symmetric. Split sriov enable/disable to two levels: device level and pci level. When user enable/disable sriov (via sriov_configure driver callback) we will enable/disable both device and pci sriov. When driver load/unload we will enable/disable (on demand) only device sriov while keeping the PCI sriov enabled for next driver load. On internal/pci error, VFs will be kept enabled on PCI and the reset is done only in device level. Signed-off-by:
Mohamad Haj Yahia <mohamad@mellanox.com> Signed-off-by:
Saeed Mahameed <saeedm@mellanox.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- 18 Aug, 2016 1 commit
-
-
Aviv Heller authored
Until support will be added for RoCE LAG SRIOV. Signed-off-by:
Aviv Heller <avivh@mellanox.com> Signed-off-by:
Saeed Mahameed <saeedm@mellanox.com> Signed-off-by:
Leon Romanovsky <leon@kernel.org>
-
- 17 Aug, 2016 1 commit
-
-
Saeed Mahameed authored
Remove duplicate pci dev name printing in mlx5_core_err. Use mlx5_core_{warn,info,err} where possible to have the pci info in the driver log messages. Signed-off-by:
Saeed Mahameed <saeedm@mellanox.com> Signed-off-by:
Parvi Kaustubhi <parvik@mellanox.com> Signed-off-by:
Leon Romanovsky <leon@kernel.org>
-
- 02 Jul, 2016 1 commit
-
-
Or Gerlitz authored
Define three modes for the SRIOV e-switch operation, none (SRIOV_NONE, none of the VF vports are enabled), legacy (SRIOV_LEGACY, the current mode) and sriov offloads (SRIOV_OFFLOADS). Currently, when in SRIOV, only the legacy mode is supported, where steering rules are of the form: destination mac --> VF vport This patch does not change any functionality. Signed-off-by:
Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by:
Saeed Mahameed <saeedm@mellanox.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- 18 Apr, 2016 1 commit
-
-
Masanari Iida authored
This patch fix spelling typos found in printk within various part of the kernel sources. Signed-off-by:
Masanari Iida <standby24x7@gmail.com> Acked-by:
Randy Dunlap <rdunlap@infradead.org> Signed-off-by:
Jiri Kosina <jkosina@suse.cz>
-
- 03 Dec, 2015 2 commits
-
-
Saeed Mahameed authored
Enabling E-Switch SRIOV for nvfs+1 vports. Create E-Switch FDB for L2 UC/MC mac steering between VFs/PF and external vport (Uplink). FDB contains forwarding rules such as: UC MAC0 -> vport0(PF). UC MAC1 -> vport1. UC MAC2 -> vport2. MC MACX -> vport0, vport2, Uplink. MC MACY -> vport1, Uplink. For unmatched traffic FDB has the following default rules: Unmached Traffic (src vport != Uplink) -> Uplink. Unmached Traffic (src vport == Uplink) -> vport0(PF). FDB rules population: Each NIC vport (VF) will notify E-Switch manager of its UC/MC vport context changes via modify vport context command, which will be translated to an event that will be handled by E-Switch manager (PF) which will update FDB table accordingly. Signed-off-by:
Saeed Mahameed <saeedm@mellanox.com> Signed-off-by:
Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Eli Cohen authored
This patch adds SRIOV base support for mlx5 supported devices. The same driver is used for both PFs and VFs; VFs are identified by the driver through the flag MLX5_PCI_DEV_IS_VF added to the pci table entries. Virtual functions are created as usual through writing a value to the sriov_numvs sysfs file of the PF device. Upon instantiating VFs, they will all be probed by the driver on the hypervisor. One can gracefully unbind them through /sys/bus/pci/drivers/mlx5_core/unbind. mlx5_wait_for_vf_pages() was added to ensure that when a VF dies without executing proper teardown, the hypervisor driver waits till all of the pages that were allocated at the hypervisor to maintain its operation are returned. In order for the VF to be operational, the PF needs to call enable_hca for it. This can be done before the VFs are created through a call to pci_enable_sriov. If the there are VFs assigned to a VMs when the driver of the PF is unloaded, all the VF will experience system error and PF driver unloads cleanly; in this case pci_disable_sriov is not called and the devices will show when running lspci. Once the PF driver is reloaded, it will sync its data structures which maintain state on its VFs. Signed-off-by:
Eli Cohen <eli@mellanox.com> Signed-off-by:
Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-