Merge pull request #1763 from abhijitG-xlnx/manpage

ionic: Add man pages for ionic direct verbs API
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 520fffd..68168f3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -809,6 +809,7 @@
 add_subdirectory(providers/hns)
 add_subdirectory(providers/hns/man)
 add_subdirectory(providers/ionic)
+add_subdirectory(providers/ionic/man)
 add_subdirectory(providers/irdma)
 add_subdirectory(providers/mana)
 add_subdirectory(providers/mana/man)
diff --git a/debian/libibverbs-dev.install b/debian/libibverbs-dev.install
index 523c37d..141ad79 100644
--- a/debian/libibverbs-dev.install
+++ b/debian/libibverbs-dev.install
@@ -39,6 +39,7 @@
 usr/share/man/man3/efadv_*.3
 usr/share/man/man3/hnsdv_*.3
 usr/share/man/man3/ibv_*
+usr/share/man/man3/ionic_dv_*.3
 usr/share/man/man3/manadv_*.3
 usr/share/man/man3/mbps_to_ibv_rate.3
 usr/share/man/man3/mlx4dv_*.3
@@ -46,6 +47,7 @@
 usr/share/man/man3/mult_to_ibv_rate.3
 usr/share/man/man7/efadv.7
 usr/share/man/man7/hnsdv.7
+usr/share/man/man7/ionicdv.7
 usr/share/man/man7/manadv.7
 usr/share/man/man7/mlx4dv.7
 usr/share/man/man7/mlx5dv.7
diff --git a/providers/ionic/man/CMakeLists.txt b/providers/ionic/man/CMakeLists.txt
new file mode 100644
index 0000000..2827560
--- /dev/null
+++ b/providers/ionic/man/CMakeLists.txt
@@ -0,0 +1,9 @@
+rdma_man_pages(
+  ionicdv.7.md
+  ionic_dv_ctx_get_udma_count.3.md
+  ionic_dv_ctx_get_udma_mask.3.md
+  ionic_dv_pd_get_udma_mask.3.md
+  ionic_dv_pd_set_udma_mask.3.md
+  ionic_dv_pd_set_sqcmb.3.md
+  ionic_dv_pd_set_rqcmb.3.md
+)
diff --git a/providers/ionic/man/ionic_dv_ctx_get_udma_count.3.md b/providers/ionic/man/ionic_dv_ctx_get_udma_count.3.md
new file mode 100644
index 0000000..0dbbe80
--- /dev/null
+++ b/providers/ionic/man/ionic_dv_ctx_get_udma_count.3.md
@@ -0,0 +1,51 @@
+---
+layout: page
+title: IONIC_DV_CTX_GET_UDMA_COUNT
+section: 3
+tagline: Verbs
+date: 2025-06-23
+header: "Ionic Programmer's Manual"
+footer: ionic
+---
+
+# NAME
+
+ionic_dv_ctx_get_udma_count - Get number of UDMA pipelines
+
+# SYNOPSIS
+
+```c
+#include <infiniband/ionic_dv.h>
+
+uint8_t ionic_dv_ctx_get_udma_count(struct ibv_context *ibctx);
+```
+
+# DESCRIPTION
+
+**ionic_dv_ctx_get_udma_count()** returns the number of UDMA pipelines
+available on the ionic device associated with *ibctx*.
+
+UDMA pipelines are independent data paths through the device. Queues can be
+assigned to specific pipelines using **ionic_dv_pd_set_udma_mask**(3) on a
+protection domain before creating the queues.
+
+# ARGUMENTS
+
+*ibctx*
+:	The device context to query. Must be an ionic device context.
+
+# RETURN VALUE
+
+Returns the number of UDMA pipelines available on the device. Returns 0 if
+*ibctx* is not an ionic device context.
+
+# SEE ALSO
+
+**ionicdv**(7),
+**ionic_dv_ctx_get_udma_mask**(3),
+**ionic_dv_pd_get_udma_mask**(3),
+**ionic_dv_pd_set_udma_mask**(3)
+
+# AUTHORS
+
+Advanced Micro Devices, Inc.
diff --git a/providers/ionic/man/ionic_dv_ctx_get_udma_mask.3.md b/providers/ionic/man/ionic_dv_ctx_get_udma_mask.3.md
new file mode 100644
index 0000000..30e2094
--- /dev/null
+++ b/providers/ionic/man/ionic_dv_ctx_get_udma_mask.3.md
@@ -0,0 +1,52 @@
+---
+layout: page
+title: IONIC_DV_CTX_GET_UDMA_MASK
+section: 3
+tagline: Verbs
+date: 2025-06-23
+header: "Ionic Programmer's Manual"
+footer: ionic
+---
+
+# NAME
+
+ionic_dv_ctx_get_udma_mask - Get mask of UDMA pipeline IDs
+
+# SYNOPSIS
+
+```c
+#include <infiniband/ionic_dv.h>
+
+uint8_t ionic_dv_ctx_get_udma_mask(struct ibv_context *ibctx);
+```
+
+# DESCRIPTION
+
+**ionic_dv_ctx_get_udma_mask()** returns a bitmask of all UDMA pipeline IDs
+available on the ionic device associated with *ibctx*. Each set bit
+represents an available pipeline.
+
+The returned mask represents the full set of pipelines supported by the
+device. A protection domain's UDMA mask (set via
+**ionic_dv_pd_set_udma_mask**(3)) must be a subset of this device mask.
+
+# ARGUMENTS
+
+*ibctx*
+:	The device context to query. Must be an ionic device context.
+
+# RETURN VALUE
+
+Returns a bitmask of available UDMA pipeline IDs. Returns 0 if *ibctx* is
+not an ionic device context.
+
+# SEE ALSO
+
+**ionicdv**(7),
+**ionic_dv_ctx_get_udma_count**(3),
+**ionic_dv_pd_get_udma_mask**(3),
+**ionic_dv_pd_set_udma_mask**(3)
+
+# AUTHORS
+
+Advanced Micro Devices, Inc.
diff --git a/providers/ionic/man/ionic_dv_pd_get_udma_mask.3.md b/providers/ionic/man/ionic_dv_pd_get_udma_mask.3.md
new file mode 100644
index 0000000..c11c743
--- /dev/null
+++ b/providers/ionic/man/ionic_dv_pd_get_udma_mask.3.md
@@ -0,0 +1,53 @@
+---
+layout: page
+title: IONIC_DV_PD_GET_UDMA_MASK
+section: 3
+tagline: Verbs
+date: 2025-06-23
+header: "Ionic Programmer's Manual"
+footer: ionic
+---
+
+# NAME
+
+ionic_dv_pd_get_udma_mask - Get UDMA pipeline mask of a protection domain
+
+# SYNOPSIS
+
+```c
+#include <infiniband/ionic_dv.h>
+
+uint8_t ionic_dv_pd_get_udma_mask(struct ibv_pd *ibpd);
+```
+
+# DESCRIPTION
+
+**ionic_dv_pd_get_udma_mask()** returns the current UDMA pipeline mask
+associated with the protection domain or parent domain *ibpd*.
+
+The returned mask indicates which UDMA pipelines are enabled for queues
+created under this protection domain. It may have been set by a prior call
+to **ionic_dv_pd_set_udma_mask**(3), or it may be the default mask
+inherited from the device context.
+
+# ARGUMENTS
+
+*ibpd*
+:	The protection domain or parent domain to query. Must be an ionic
+	protection domain.
+
+# RETURN VALUE
+
+Returns the UDMA pipeline mask of the protection domain. Returns 0 if
+*ibpd* is not an ionic protection domain.
+
+# SEE ALSO
+
+**ionicdv**(7),
+**ionic_dv_pd_set_udma_mask**(3),
+**ionic_dv_ctx_get_udma_mask**(3),
+**ionic_dv_ctx_get_udma_count**(3)
+
+# AUTHORS
+
+Advanced Micro Devices, Inc.
diff --git a/providers/ionic/man/ionic_dv_pd_set_rqcmb.3.md b/providers/ionic/man/ionic_dv_pd_set_rqcmb.3.md
new file mode 100644
index 0000000..211a015
--- /dev/null
+++ b/providers/ionic/man/ionic_dv_pd_set_rqcmb.3.md
@@ -0,0 +1,79 @@
+---
+layout: page
+title: IONIC_DV_PD_SET_RQCMB
+section: 3
+tagline: Verbs
+date: 2025-06-23
+header: "Ionic Programmer's Manual"
+footer: ionic
+---
+
+# NAME
+
+ionic_dv_pd_set_rqcmb - Specify receive queue preference for controller memory bar
+
+# SYNOPSIS
+
+```c
+#include <infiniband/ionic_dv.h>
+
+int ionic_dv_pd_set_rqcmb(struct ibv_pd *ibpd, bool enable, bool expdb,
+                           bool require);
+```
+
+# DESCRIPTION
+
+**ionic_dv_pd_set_rqcmb()** configures the controller memory bar (CMB)
+preferences for receive queues created under the protection domain *ibpd*.
+Receive queues created after this call will use the CMB according to the
+specified preferences.
+
+When CMB is enabled, the receive queue ring buffer is placed in device
+memory (the controller memory bar) instead of host memory, which can reduce
+doorbell latency.
+
+Express doorbell (expdb) is an additional optimization that further reduces
+doorbell overhead when the receive queue is placed in CMB.
+
+The *require* flag controls whether creation should fail if the requested
+CMB preferences cannot be met. When *require* is false, the driver will
+fall back to host memory if CMB is unavailable.
+
+# ARGUMENTS
+
+*ibpd*
+:	The protection domain to configure. Must be an ionic protection
+	domain.
+
+*enable*
+:	Allow the use of the controller memory bar for receive queues.
+
+*expdb*
+:	Allow the use of express doorbell optimizations. Only meaningful when
+	*enable* is true.
+
+*require*
+:	Require that the CMB preferences are met. If true and the preferences
+	cannot be satisfied, queue creation will fail instead of falling back
+	to host memory. Only meaningful when *enable* is true.
+
+# RETURN VALUE
+
+Returns 0 on success, or a positive errno value on failure:
+
+*EPERM*
+:	*ibpd* is not an ionic protection domain.
+
+*EINVAL*
+:	*require* is true with *expdb* true, but the device does not support
+	express doorbell for receive queues.
+
+# SEE ALSO
+
+**ionicdv**(7),
+**ionic_dv_pd_set_sqcmb**(3),
+**ionic_dv_pd_set_udma_mask**(3)
+
+# AUTHORS
+
+Advanced Micro Devices, Inc.
diff --git a/providers/ionic/man/ionic_dv_pd_set_sqcmb.3.md b/providers/ionic/man/ionic_dv_pd_set_sqcmb.3.md
new file mode 100644
index 0000000..f3be583
--- /dev/null
+++ b/providers/ionic/man/ionic_dv_pd_set_sqcmb.3.md
@@ -0,0 +1,79 @@
+---
+layout: page
+title: IONIC_DV_PD_SET_SQCMB
+section: 3
+tagline: Verbs
+date: 2025-06-23
+header: "Ionic Programmer's Manual"
+footer: ionic
+---
+
+# NAME
+
+ionic_dv_pd_set_sqcmb - Specify send queue preference for controller memory bar
+
+# SYNOPSIS
+
+```c
+#include <infiniband/ionic_dv.h>
+
+int ionic_dv_pd_set_sqcmb(struct ibv_pd *ibpd, bool enable, bool expdb,
+                           bool require);
+```
+
+# DESCRIPTION
+
+**ionic_dv_pd_set_sqcmb()** configures the controller memory bar (CMB)
+preferences for send queues created under the protection domain *ibpd*.
+Send queues created after this call will use the CMB according to the
+specified preferences.
+
+When CMB is enabled, the send queue ring buffer is placed in device memory
+(the controller memory bar) instead of host memory, which can reduce
+doorbell latency.
+
+Express doorbell (expdb) is an additional optimization that further reduces
+doorbell overhead when the send queue is placed in CMB.
+
+The *require* flag controls whether creation should fail if the requested
+CMB preferences cannot be met. When *require* is false, the driver will
+fall back to host memory if CMB is unavailable.
+
+# ARGUMENTS
+
+*ibpd*
+:	The protection domain to configure. Must be an ionic protection
+	domain.
+
+*enable*
+:	Allow the use of the controller memory bar for send queues.
+
+*expdb*
+:	Allow the use of express doorbell optimizations. Only meaningful when
+	*enable* is true.
+
+*require*
+:	Require that the CMB preferences are met. If true and the preferences
+	cannot be satisfied, queue creation will fail instead of falling back
+	to host memory. Only meaningful when *enable* is true.
+
+# RETURN VALUE
+
+Returns 0 on success, or a positive errno value on failure:
+
+*EPERM*
+:	*ibpd* is not an ionic protection domain.
+
+*EINVAL*
+:	*require* is true with *expdb* true, but the device does not support
+	express doorbell for send queues.
+
+# SEE ALSO
+
+**ionicdv**(7),
+**ionic_dv_pd_set_rqcmb**(3),
+**ionic_dv_pd_set_udma_mask**(3)
+
+# AUTHORS
+
+Advanced Micro Devices, Inc.
diff --git a/providers/ionic/man/ionic_dv_pd_set_udma_mask.3.md b/providers/ionic/man/ionic_dv_pd_set_udma_mask.3.md
new file mode 100644
index 0000000..5b21741
--- /dev/null
+++ b/providers/ionic/man/ionic_dv_pd_set_udma_mask.3.md
@@ -0,0 +1,79 @@
+---
+layout: page
+title: IONIC_DV_PD_SET_UDMA_MASK
+section: 3
+tagline: Verbs
+date: 2025-06-23
+header: "Ionic Programmer's Manual"
+footer: ionic
+---
+
+# NAME
+
+ionic_dv_pd_set_udma_mask - Restrict UDMA pipeline IDs of a protection domain
+
+# SYNOPSIS
+
+```c
+#include <infiniband/ionic_dv.h>
+
+int ionic_dv_pd_set_udma_mask(struct ibv_pd *ibpd, uint8_t udma_mask);
+```
+
+# DESCRIPTION
+
+**ionic_dv_pd_set_udma_mask()** restricts the UDMA pipelines available for
+queues created under the protection domain or parent domain *ibpd*. Queues
+created after this call will be assigned to one of the pipelines enabled by
+*udma_mask*.
+
+The *udma_mask* must be a subset of the device's available UDMA pipelines,
+as returned by **ionic_dv_ctx_get_udma_mask**(3).
+
+Changing the UDMA mask of a protection domain has no effect on previously
+created queues.
+
+The recommended usage pattern is:
+
+1. Create a protection domain with **ibv_alloc_pd**(3).
+2. Create parent domains of that PD for each desired UDMA mask using
+   **ibv_alloc_parent_domain**(3).
+3. Set the desired UDMA mask on each parent domain with this function.
+4. Create queues associated with the parent domain that has the desired
+   UDMA mask.
+
+An alternative usage is to create a single PD and change its UDMA mask
+before creating each queue.
+
+# ARGUMENTS
+
+*ibpd*
+:	The protection domain or parent domain to modify. Must be an ionic
+	protection domain.
+
+*udma_mask*
+:	A bitmask of UDMA pipeline IDs to enable. Must be a subset of the
+	mask returned by **ionic_dv_ctx_get_udma_mask**(3).
+
+# RETURN VALUE
+
+Returns 0 on success, or a positive errno value on failure:
+
+*EPERM*
+:	*ibpd* is not an ionic protection domain.
+
+*EINVAL*
+:	*udma_mask* contains bits not present in the device's UDMA mask.
+
+# SEE ALSO
+
+**ionicdv**(7),
+**ionic_dv_pd_get_udma_mask**(3),
+**ionic_dv_ctx_get_udma_mask**(3),
+**ionic_dv_ctx_get_udma_count**(3),
+**ibv_alloc_pd**(3),
+**ibv_alloc_parent_domain**(3)
+
+# AUTHORS
+
+Advanced Micro Devices, Inc.
diff --git a/providers/ionic/man/ionicdv.7.md b/providers/ionic/man/ionicdv.7.md
new file mode 100644
index 0000000..faf8006
--- /dev/null
+++ b/providers/ionic/man/ionicdv.7.md
@@ -0,0 +1,60 @@
+---
+layout: page
+title: IONICDV
+section: 7
+tagline: Verbs
+date: 2025-06-23
+header: "Ionic Programmer's Manual"
+footer: ionic
+---
+
+# NAME
+
+ionicdv - Direct verbs for ionic devices
+
+This provides low level access to ionic devices to perform direct operations,
+without general branching performed by libibverbs.
+
+# DESCRIPTION
+
+The libibverbs API is an abstract one. It is agnostic to any underlying
+provider specific implementation. While this abstraction has the advantage
+of user applications portability, it has a performance penalty. For some
+applications optimizing performance is more important than portability.
+
+The ionic direct verbs API is intended for such applications.
+It exposes ionic specific low level operations, allowing the application
+to bypass the libibverbs API.
+
+The direct include of ionic_dv.h together with linkage to the ionic library
+will allow usage of this new interface.
+
+## UDMA Pipelines
+
+Ionic devices expose multiple UDMA pipelines. Queues can be assigned to
+specific pipelines by setting a UDMA mask on the protection domain before
+creating queues. Use **ionic_dv_ctx_get_udma_count**(3) and
+**ionic_dv_ctx_get_udma_mask**(3) to query the available pipelines, and
+**ionic_dv_pd_set_udma_mask**(3) to restrict queue placement.
+
+## Controller Memory Bar (CMB)
+
+Send and receive queues can optionally be placed in the controller memory
+bar for lower latency doorbell operations. Express doorbell optimizations
+may also be enabled. Use **ionic_dv_pd_set_sqcmb**(3) and
+**ionic_dv_pd_set_rqcmb**(3) to configure CMB preferences on a protection
+domain before creating queues.
+
+# SEE ALSO
+
+**ionic_dv_ctx_get_udma_count**(3),
+**ionic_dv_ctx_get_udma_mask**(3),
+**ionic_dv_pd_get_udma_mask**(3),
+**ionic_dv_pd_set_udma_mask**(3),
+**ionic_dv_pd_set_sqcmb**(3),
+**ionic_dv_pd_set_rqcmb**(3),
+**verbs**(7)
+
+# AUTHORS
+
+Advanced Micro Devices, Inc.
diff --git a/redhat/rdma-core.spec b/redhat/rdma-core.spec
index 6be48a5..8cdf460 100644
--- a/redhat/rdma-core.spec
+++ b/redhat/rdma-core.spec
@@ -468,6 +468,7 @@
 %{_mandir}/man3/efadv*
 %{_mandir}/man3/hnsdv*
 %{_mandir}/man3/ibv_*
+%{_mandir}/man3/ionic_dv*
 %{_mandir}/man3/rdma*
 %{_mandir}/man3/umad*
 %{_mandir}/man3/*_to_ibv_rate.*
@@ -477,6 +478,7 @@
 %{_mandir}/man3/mlx4dv*
 %{_mandir}/man7/efadv*
 %{_mandir}/man7/hnsdv*
+%{_mandir}/man7/ionicdv*
 %{_mandir}/man7/manadv*
 %{_mandir}/man7/mlx5dv*
 %{_mandir}/man7/mlx4dv*
diff --git a/suse/rdma-core.spec b/suse/rdma-core.spec
index 03ae7f3..e82ba39 100644
--- a/suse/rdma-core.spec
+++ b/suse/rdma-core.spec
@@ -684,11 +684,13 @@
 %if 0%{?dma_coherent}
 %{_mandir}/man3/efadv*
 %{_mandir}/man3/hnsdv*
+%{_mandir}/man3/ionic_dv*
 %{_mandir}/man3/manadv*
 %{_mandir}/man3/mlx5dv*
 %{_mandir}/man3/mlx4dv*
 %{_mandir}/man7/efadv*
 %{_mandir}/man7/hnsdv*
+%{_mandir}/man7/ionicdv*
 %{_mandir}/man7/manadv*
 %{_mandir}/man7/mlx5dv*
 %{_mandir}/man7/mlx4dv*