diff options
| author | Alexandra Winter <wintera@linux.ibm.com> | 2025-09-18 13:04:52 +0200 |
|---|---|---|
| committer | Paolo Abeni <pabeni@redhat.com> | 2025-09-23 11:13:21 +0200 |
| commit | cb990a45d7f6eb6dc495d2226a3005b284a5ee4f (patch) | |
| tree | 11e5bb587125f20d1675c37618f2b7792f83de1e /drivers/dibs/dibs_main.c | |
| parent | 269726968f95ebc00e3a47f91eebd6818991d6fa (diff) | |
dibs: Define dibs loopback
The first stage of loopback-ism was implemented as part of the
SMC module [1]. Now that we have the dibs layer, provide access to a
dibs_loopback device to all dibs clients.
This is the first step of moving loopback-ism from net/smc/smc_loopback.*
to drivers/dibs/dibs_loopback.*. One global structure lo_dev is allocated
and added to the dibs devices. Follow-on patches will move functionality.
Same as smc_loopback, dibs_loopback is provided by a config option.
Note that there is no way to dynamically add or remove the loopback
device. That could be a future improvement.
When moving code to drivers/dibs, replace ism_ prefix with dibs_ prefix.
As this is mostly a move of existing code, copyright and authors are
unchanged.
Link: https://lore.kernel.org/lkml/20240428060738.60843-1-guwen@linux.alibaba.com/ [1]
Signed-off-by: Alexandra Winter <wintera@linux.ibm.com>
Link: https://patch.msgid.link/20250918110500.1731261-7-wintera@linux.ibm.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/dibs/dibs_main.c')
| -rw-r--r-- | drivers/dibs/dibs_main.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/dibs/dibs_main.c b/drivers/dibs/dibs_main.c index 2f420e077417..a7e33be36158 100644 --- a/drivers/dibs/dibs_main.c +++ b/drivers/dibs/dibs_main.c @@ -15,6 +15,8 @@ #include <linux/err.h> #include <linux/dibs.h> +#include "dibs_loopback.h" + MODULE_DESCRIPTION("Direct Internal Buffer Sharing class"); MODULE_LICENSE("GPL"); @@ -96,14 +98,21 @@ EXPORT_SYMBOL_GPL(dibs_dev_del); static int __init dibs_init(void) { + int rc; + memset(clients, 0, sizeof(clients)); max_client = 0; - return 0; + rc = dibs_loopback_init(); + if (rc) + pr_err("%s fails with %d\n", __func__, rc); + + return rc; } static void __exit dibs_exit(void) { + dibs_loopback_exit(); } module_init(dibs_init); |
