netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next V3 0/8] devlink: Add port function attribute to enable/disable Roce and migratable
@ 2022-12-04 14:16 Shay Drory
  2022-12-04 14:16 ` [PATCH net-next V3 1/8] net/mlx5: Introduce IFC bits for migratable Shay Drory
                   ` (7 more replies)
  0 siblings, 8 replies; 17+ messages in thread
From: Shay Drory @ 2022-12-04 14:16 UTC (permalink / raw)
  To: netdev, kuba, davem; +Cc: danielj, yishaih, jiri, saeedm, parav, Shay Drory

This series is a complete rewrite of the series "devlink: Add port
function attribute to enable/disable roce"
link:
https://lore.kernel.org/netdev/20221102163954.279266-1-danielj@nvidia.com/

Currently mlx5 PCI VF and SF are enabled by default for RoCE
functionality. And mlx5 PCI VF is disable by dafault for migratable
functionality.

Currently a user does not have the ability to disable RoCE for a PCI
VF/SF device before such device is enumerated by the driver.

User is also incapable to do such setting from smartnic scenario for a
VF from the smartnic.

Current 'enable_roce' device knob is limited to do setting only at
driverinit time. By this time device is already created and firmware has
already allocated necessary system memory for supporting RoCE.

Also, Currently a user does not have the ability to enable migratable
for a PCI VF.

The above are a hyper visor level control, to set the functionality of
devices passed through to guests.

This is achieved by extending existing 'port function' object to control
capabilities of a function. This enables users to control capability of
the device before enumeration.

Examples when user prefers to disable RoCE for a VF when using switchdev
mode:

$ devlink port show pci/0000:06:00.0/1
pci/0000:06:00.0/1: type eth netdev pf0vf0 flavour pcivf controller 0
pfnum 0 vfnum 0 external false splittable false
  function:
    hw_addr 00:00:00:00:00:00 roce enable

$ devlink port function set pci/0000:06:00.0/1 roce disable
  
$ devlink port show pci/0000:06:00.0/1
pci/0000:06:00.0/1: type eth netdev pf0vf0 flavour pcivf controller 0
pfnum 0 vfnum 0 external false splittable false
  function:
    hw_addr 00:00:00:00:00:00 roce disable

FAQs:
-----
1. What does roce enable/disable do?
Ans: It disables RoCE capability of the function before its enumerated,
so when driver reads the capability from the device firmware, it is
disabled.
At this point RDMA stack will not be able to create UD, QP1, RC, XRC
type of QPs. When RoCE is disabled, the GID table of all ports of the
device is disabled in the device and software stack.

2. How is the roce 'port function' option different from existing
devlink param?
Ans: RoCE attribute at the port function level disables the RoCE
capability at the specific function level; while enable_roce only does
at the software level.

3. Why is this option for disabling only RoCE and not the whole RDMA
device?
Ans: Because user still wants to use the RDMA device for non RoCE
commands in more memory efficient way.

Patch summary:
Patch-1 introduce ifc bits for migratable command
Patch-2 avoid partial port function request processing
Patch-3 move devlink hw_addr attribute doc to devlink file
Patch-4 adds devlink attribute to control roce
Patch-5 add generic setters/getters for other functions caps 
Patch-6 implements mlx5 callbacks for roce control
Patch-7 adds devlink attribute to control migratable
Patch-8 implements mlx5 callbacks for migratable control

---
v2->v3:
 - see patches 2,4,7 for a changelog.
v1->v2:
 - see patch 7 for a changelog.

Shay Drory (6):
  devlink: Validate port function request
  devlink: Move devlink port function hw_addr attr documentation
  devlink: Expose port function commands to control RoCE
  net/mlx5: Add generic getters for other functions caps
  devlink: Expose port function commands to control migratable
  net/mlx5: E-Switch, Implement devlink port function cmds to control
    migratable

Yishai Hadas (2):
  net/mlx5: Introduce IFC bits for migratable
  net/mlx5: E-Switch, Implement devlink port function cmds to control
    RoCE

 .../device_drivers/ethernet/mellanox/mlx5.rst |  46 ++--
 .../networking/devlink/devlink-port.rst       | 122 +++++++++-
 .../net/ethernet/mellanox/mlx5/core/devlink.c |   4 +
 .../net/ethernet/mellanox/mlx5/core/eswitch.c |  43 ++++
 .../net/ethernet/mellanox/mlx5/core/eswitch.h |  11 +-
 .../mellanox/mlx5/core/eswitch_offloads.c     | 210 +++++++++++++++++-
 .../ethernet/mellanox/mlx5/core/mlx5_core.h   |   5 +-
 .../net/ethernet/mellanox/mlx5/core/pci_irq.c |   3 +-
 .../net/ethernet/mellanox/mlx5/core/vport.c   |  30 ++-
 include/linux/mlx5/mlx5_ifc.h                 |   6 +-
 include/linux/mlx5/vport.h                    |   2 +
 include/net/devlink.h                         |  40 ++++
 include/uapi/linux/devlink.h                  |  13 ++
 net/core/devlink.c                            | 198 ++++++++++++++++-
 14 files changed, 685 insertions(+), 48 deletions(-)

-- 
2.38.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-12-06 17:52 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-04 14:16 [PATCH net-next V3 0/8] devlink: Add port function attribute to enable/disable Roce and migratable Shay Drory
2022-12-04 14:16 ` [PATCH net-next V3 1/8] net/mlx5: Introduce IFC bits for migratable Shay Drory
2022-12-04 14:16 ` [PATCH net-next V3 2/8] devlink: Validate port function request Shay Drory
2022-12-04 14:16 ` [PATCH net-next V3 3/8] devlink: Move devlink port function hw_addr attr documentation Shay Drory
2022-12-04 14:16 ` [PATCH net-next V3 4/8] devlink: Expose port function commands to control RoCE Shay Drory
2022-12-05 10:12   ` Jiri Pirko
2022-12-05 23:37   ` Shannon Nelson
2022-12-06  2:02     ` Jakub Kicinski
2022-12-06  8:52       ` Jiri Pirko
2022-12-04 14:16 ` [PATCH net-next V3 5/8] net/mlx5: Add generic getters for other functions caps Shay Drory
2022-12-04 14:16 ` [PATCH net-next V3 6/8] net/mlx5: E-Switch, Implement devlink port function cmds to control RoCE Shay Drory
2022-12-04 14:16 ` [PATCH net-next V3 7/8] devlink: Expose port function commands to control migratable Shay Drory
2022-12-05 23:37   ` Shannon Nelson
2022-12-06  1:56     ` Jakub Kicinski
2022-12-06  8:55     ` Jiri Pirko
2022-12-06 17:52       ` Shannon Nelson
2022-12-04 14:16 ` [PATCH net-next V3 8/8] net/mlx5: E-Switch, Implement devlink port function cmds " Shay Drory

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).