[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260118135440.1958279-22-den@valinux.co.jp>
Date: Sun, 18 Jan 2026 22:54:23 +0900
From: Koichiro Den <den@...inux.co.jp>
To: Frank.Li@....com,
dave.jiang@...el.com,
cassel@...nel.org,
mani@...nel.org,
kwilczynski@...nel.org,
kishon@...nel.org,
bhelgaas@...gle.com,
geert+renesas@...der.be,
robh@...nel.org,
vkoul@...nel.org,
jdmason@...zu.us,
allenbh@...il.com,
jingoohan1@...il.com,
lpieralisi@...nel.org
Cc: linux-pci@...r.kernel.org,
linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-renesas-soc@...r.kernel.org,
devicetree@...r.kernel.org,
dmaengine@...r.kernel.org,
iommu@...ts.linux.dev,
ntb@...ts.linux.dev,
netdev@...r.kernel.org,
linux-kselftest@...r.kernel.org,
arnd@...db.de,
gregkh@...uxfoundation.org,
joro@...tes.org,
will@...nel.org,
robin.murphy@....com,
magnus.damm@...il.com,
krzk+dt@...nel.org,
conor+dt@...nel.org,
corbet@....net,
skhan@...uxfoundation.org,
andriy.shevchenko@...ux.intel.com,
jbrunet@...libre.com,
utkarsh02t@...il.com
Subject: [RFC PATCH v4 21/38] NTB: ntb_transport: Export common helpers for modularization
Upcoming changes introduce multiple ntb_client drivers and transport
backends that share common list/queue helpers.
Export the shared helper functions and declare them in the internal
header so they can be reused by split-out code.
No functional change.
Signed-off-by: Koichiro Den <den@...inux.co.jp>
---
drivers/ntb/ntb_transport_core.c | 17 +++++++++--------
drivers/ntb/ntb_transport_internal.h | 7 +++++++
2 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/drivers/ntb/ntb_transport_core.c b/drivers/ntb/ntb_transport_core.c
index 71f01fa0ff05..04a13fdce71c 100644
--- a/drivers/ntb/ntb_transport_core.c
+++ b/drivers/ntb/ntb_transport_core.c
@@ -371,8 +371,7 @@ static int ntb_qp_debugfs_stats_show(struct seq_file *s, void *v)
}
DEFINE_SHOW_ATTRIBUTE(ntb_qp_debugfs_stats);
-static void ntb_list_add(spinlock_t *lock, struct list_head *entry,
- struct list_head *list)
+void ntb_list_add(spinlock_t *lock, struct list_head *entry, struct list_head *list)
{
unsigned long flags;
@@ -380,9 +379,9 @@ static void ntb_list_add(spinlock_t *lock, struct list_head *entry,
list_add_tail(entry, list);
spin_unlock_irqrestore(lock, flags);
}
+EXPORT_SYMBOL_GPL(ntb_list_add);
-static struct ntb_queue_entry *ntb_list_rm(spinlock_t *lock,
- struct list_head *list)
+struct ntb_queue_entry *ntb_list_rm(spinlock_t *lock, struct list_head *list)
{
struct ntb_queue_entry *entry;
unsigned long flags;
@@ -400,10 +399,10 @@ static struct ntb_queue_entry *ntb_list_rm(spinlock_t *lock,
return entry;
}
+EXPORT_SYMBOL_GPL(ntb_list_rm);
-static struct ntb_queue_entry *ntb_list_mv(spinlock_t *lock,
- struct list_head *list,
- struct list_head *to_list)
+struct ntb_queue_entry *ntb_list_mv(spinlock_t *lock, struct list_head *list,
+ struct list_head *to_list)
{
struct ntb_queue_entry *entry;
unsigned long flags;
@@ -421,6 +420,7 @@ static struct ntb_queue_entry *ntb_list_mv(spinlock_t *lock,
return entry;
}
+EXPORT_SYMBOL_GPL(ntb_list_mv);
static int ntb_transport_setup_qp_mw(struct ntb_transport_ctx *nt,
unsigned int qp_num)
@@ -820,10 +820,11 @@ static void ntb_qp_link_cleanup_work(struct work_struct *work)
msecs_to_jiffies(NTB_LINK_DOWN_TIMEOUT));
}
-static void ntb_qp_link_down(struct ntb_transport_qp *qp)
+void ntb_qp_link_down(struct ntb_transport_qp *qp)
{
schedule_work(&qp->link_cleanup);
}
+EXPORT_SYMBOL_GPL(ntb_qp_link_down);
static void ntb_transport_link_cleanup(struct ntb_transport_ctx *nt)
{
diff --git a/drivers/ntb/ntb_transport_internal.h b/drivers/ntb/ntb_transport_internal.h
index aff9b70671c6..6b45790cc88e 100644
--- a/drivers/ntb/ntb_transport_internal.h
+++ b/drivers/ntb/ntb_transport_internal.h
@@ -156,4 +156,11 @@ enum {
LINK_DOWN_FLAG = BIT(1),
};
+void ntb_list_add(spinlock_t *lock, struct list_head *entry,
+ struct list_head *list);
+struct ntb_queue_entry *ntb_list_rm(spinlock_t *lock, struct list_head *list);
+struct ntb_queue_entry *ntb_list_mv(spinlock_t *lock, struct list_head *list,
+ struct list_head *to_list);
+void ntb_qp_link_down(struct ntb_transport_qp *qp);
+
#endif /* _NTB_TRANSPORT_INTERNAL_H_ */
--
2.51.0
Powered by blists - more mailing lists