dibs - Direct Internal Buffer Sharing
Status from this message: This series was applied to netdev/net-next.git (main)
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest14 patches 5 repliesApplied 14/14
- v214 patches 6 repliesSuperseded
- v114 patches 10 repliesSuperseded
Changes in v3 from the cover letter
- Use kfree() instead of kvfree() for kmalloc()ed dmbs (Paolo Abeni) [13]
Patches in v3 All 14 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/14 | net/smc: Remove error handling of unregister_dmb()drivers/ include/ net/ +1 more | +8 | 0 replies | Applied |
| 2/14 | net/smc: Decouple sf and attached send_buf in smc_loopbacknet/ net/ net/ +1 more | +12 | 0 replies | Applied |
| 3/14 | dibs: Create drivers/dibsMAINTAINERS drivers/ drivers/ +4 more | +107 | 0 replies | Applied |
| 4/14 | dibs: Register smc as dibs_clientarch/ arch/ drivers/ +3 more | +67 | 0 replies | Applied |
| 5/14 | dibs: Register ism as dibs devicedrivers/ drivers/ drivers/ +3 more | +131 | 0 replies | Applied |
| 6/14 | dibs: Define dibs loopbackarch/ arch/ drivers/ +4 more | +140 | 0 replies | Applied |
| 7/14 | dibs: Define dibs_client_ops and dibs_dev_opsarch/ arch/ drivers/ +12 more | +270 | 0 replies | Applied |
| 8/14 | dibs: Move struct device to dibs_devdrivers/ drivers/ drivers/ +8 more | +63 | 0 replies | Applied |
| 9/14 | dibs: Create class dibsdrivers/ drivers/ net/ | +56 | 0 replies | Applied |
| 10/14 | dibs: Local gid for dibs devicesdrivers/ drivers/ drivers/ +10 more | +65 | 0 replies | Applied |
| 11/14 | dibs: Move vlan support to dibs_dev_opsdrivers/ include/ include/ +2 more | +34 | 0 replies | Applied |
| 12/14 | dibs: Move query_remote_gid() to dibs_dev_opsdrivers/ drivers/ include/ +3 more | +48 | 0 replies | Applied |
| 13/14 | dibs: Move data path to dibs layerdrivers/ drivers/ drivers/ +9 more | +591 | 5 replies | Applied |
| 14/14 | dibs: Move event handling to dibs layerMAINTAINERS arch/ arch/ +8 more | +208 | 0 replies | Applied |
Reviews trailers per patch
8 of 14 patches have a Reviewed-by or Acked-by.
| Patch | Julian Ruess | Mahanta Jambigi | Dust Li | Alexandra Winter | Sidraya Jayagond |
|---|---|---|---|---|---|
| 1/14 | R-b | R-b | |||
| 2/14 | R-b | R-b | |||
| 3/14 | |||||
| 4/14 | R-b | ||||
| 5/14 | |||||
| 6/14 | |||||
| 7/14 | R-b | ||||
| 8/14 | R-b | ||||
| 9/14 | |||||
| 10/14 | R-b | R-b | |||
| 11/14 | |||||
| 12/14 | R-b | ||||
| 13/14 | A-b | A-b | |||
| 14/14 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.
Cover letter [PATCH net-next v3 00/14] dibs - Direct Internal Buffer Sharing
This series introduces a generic abstraction of existing components like:
- the s390 specific ISM device (Internal Shared Memory),
- the SMC-D loopback mechanism (Shared Memory Communication - Direct)
- the client interface of the SMC-D module to the transport devices This generic shim layer can be extended with more devices, more clients and more features in the future.
This layer is called 'dibs' for Direct Internal Buffer Sharing based on the common scheme that these mechanisms enable controlled sharing of memory buffers within some containing entity such as a hypervisor or a Linux instance.
Benefits:
- Cleaner separation of ISM and SMC-D functionality
- simpler and less module dependencies
- Clear interface definition.
- Extendable for future devices and clients.
An overview was given at the Netdev 0x19 conference, recordings and slides are available [1].
Background / Status quo:
------------------------
Currently s390 hardware provides virtual PCI ISM devices (Internal Shared Memory). Their driver is in drivers/s390/net/ism_drv.c. The main user is SMC-D (net/smc). The ism driver offers a client interface so other users/protocols can also use them, but it is still heavily intermingled with the smc code. Namely, the ism module cannot be used without the smc module, which feels artificial.
There is ongoing work to extend the ISM concept of shared buffers that can be accessed directly by another instance on the same hardware: [2] proposed a loopback interface (ism_lo), that can be used on non-s390 architectures (e.g. between containers or to test SMC-D). A minimal implementation went upstream with [3]: ism_lo currently is a part of the smc protocol and rather hidden.
[4] proposed a virtio definition of ism (ism_virtio) that can be used between kvm guests.
We will shortly send an RFC for an dibs client that uses dibs as transport for TTY.
Concept:
--------
Create a shim layer in net/dibs that contains common definitions and code for all dibs devices and all dibs clients. Any device or client module only needs to depend on this dibs layer module and any device or client code only needs to include the definitions in include/linux/dibs.h.
The name dibs was chosen to clearly distinguish it from the existing s390 ism devices. And to emphasize that it is not about sharing whole memory regions with anybody, but dedicating single buffers for another system.
Implementation:
---------------
The end result of this series is: A dibs shim layer with
- One dibs client: smc-d
- Two dibs device drivers: ism and dibs-loopback
- Everything prepared to add more clients and more device drivers.
Patches 1-2 contain some issues that were found along the way. They make sense on their own, but also enable a better structured dibs series.
There are three components that exist today:
a) smc module (especially SMC-D functionality, which is an ism client today)
b) ism device driver (supports multiple ism clients today)
c) smc-loopback (integrated with smc today)
In order to preserve existing functionality at each step, these are not moved to dibs layer by component, instead:
- the dibs layer is established in parallel to existing code [patches 3-6]
- then some service functions are moved to the dibs layer [patches 7-12]
- the actual data movement is moved to the dibs layer [patch 13]
- and last event handling is moved to the dibs layer [patch 14]
Future:
-------
Items that are not part of this patchset but can be added later:
- dynamically add or remove dibs_loopback. That will be allow for simple testing of add_dev()/del_dev()
- handle_irq(): Call clients without interrupt context. e.g using threaded interrupts. I left this for a follow-on, because it includes conceptual changes for the smcd receive code.
- Any improvements of locking scopes. I mainly moved some of the the existing locks to dibs layer. I have the feeling there is room for improvements.
- The device drivers should not loop through the client array
- dibs_dev_op.*_dmb() functions reveal unnecessary details of the internal dmb struct to the clients
- Check whether client calls to dibs_dev_ops should be replaced by interface functions that provide additional value
- Check whether device driver calls to dibs_client_ops should be replaced by interface functions that provide additional value.
---
Changes in v3:
- Use kfree() instead of kvfree() for kmalloc()ed dmbs (Paolo Abeni) [13]
Changes in v2:
- More fixes of transient scope of IS_ENABLED(CONFIG_ISM) [7,13] (patchwork)
- Delete obsolete net/smc/smc_loopback.* files [13] (Dust Li)
- Fix transient usage of supports_v2() after rebase on top of 091d019adce0 ("net/smc: remove unused function smc_lo_supports_v2") [7]
- Fix CC according to get_maintainer.pl (patchwork)
- Place dibs level code in drivers/dibs/ instead of net/dibs/ (Dust Li, Julian Ruess)
- Link: https://lore.kernel.org/netdev/[email protected]/
Changes in v1:
- Don't change __init in smc_core_init() (was [1]) (Dust Li)
- Split off log message improvements from this series (was [2,5]) (Dust Li)
- Fix arch/s390/[debug_]defconfig [4,6,7,14]
- Helptext of dibs/Kconfig [3,6]
- include linux/slab.h to avoid Wimplicit-function-declaration of kzalloc() and kfree() [5,6] (Simon Horman and
'kernel test robot <[email protected]>')
- Fix transient use of undefined 'ism' pointer [7] (Simon Horman)
- Fix transient scope of IS_ENABLED(CONFIG_ISM) [7,13] (Simon Horman)
- Change position of is_attached in struct smc_buf_desc to reduce gaps [1] (Dust Li)
- Fix SW-pnetid handling for s390 ism devices [9]
- use dibs->dev instead of defining dibs_get_dev() [8]
- add const to uuid_t* parameters [12,14] (Julian Ruess)
- no log message for module load/unload [3] (Jakub Kicinski)
- Link: https://lore.kernel.org/netdev/[email protected]/
RFC:
- Link: https://lore.kernel.org/netdev/[email protected]/
Alexandra Winter (11):
net/smc: Remove error handling of unregister_dmb() net/smc: Decouple sf and attached send_buf in smc_loopback
dibs: Create drivers/dibs
dibs: Register smc as dibs_client
dibs: Register ism as dibs device
dibs: Define dibs loopback
dibs: Define dibs_client_ops and dibs_dev_ops
dibs: Local gid for dibs devices
dibs: Move vlan support to dibs_dev_ops
dibs: Move query_remote_gid() to dibs_dev_ops
dibs: Move data path to dibs layer
Julian Ruess (3):
dibs: Move struct device to dibs_dev
dibs: Create class dibs
dibs: Move event handling to dibs layer
MAINTAINERS | 9 +- arch/s390/configs/debug_defconfig | 4 +- arch/s390/configs/defconfig | 4 +- drivers/Makefile | 1 + drivers/dibs/Kconfig | 23 ++ drivers/dibs/Makefile | 8 + drivers/dibs/dibs_loopback.c | 356 +++++++++++++++++++ drivers/dibs/dibs_loopback.h | 57 +++ drivers/dibs/dibs_main.c | 278 +++++++++++++++ drivers/s390/net/Kconfig | 3 +- drivers/s390/net/ism.h | 53 ++- drivers/s390/net/ism_drv.c | 573 +++++++++++------------------- include/linux/dibs.h | 464 ++++++++++++++++++++++++ include/linux/ism.h | 28 +- include/net/smc.h | 51 +-- net/Kconfig | 1 + net/smc/Kconfig | 16 +- net/smc/Makefile | 1 - net/smc/af_smc.c | 12 +- net/smc/smc_clc.c | 6 +- net/smc/smc_core.c | 6 +- net/smc/smc_core.h | 5 + net/smc/smc_diag.c | 2 +- net/smc/smc_ism.c | 224 ++++++------ net/smc/smc_ism.h | 36 +- net/smc/smc_loopback.c | 421 ---------------------- net/smc/smc_loopback.h | 60 ---- net/smc/smc_pnet.c | 25 +- net/smc/smc_tx.c | 3 + 29 files changed, 1645 insertions(+), 1085 deletions(-) create mode 100644 drivers/dibs/Kconfig create mode 100644 drivers/dibs/Makefile create mode 100644 drivers/dibs/dibs_loopback.c create mode 100644 drivers/dibs/dibs_loopback.h create mode 100644 drivers/dibs/dibs_main.c create mode 100644 include/linux/dibs.h delete mode 100644 net/smc/smc_loopback.c delete mode 100644 net/smc/smc_loopback.h
Signature · 1 line
2.48.1