aboutsummaryrefslogtreecommitdiffstats
path: root/include/rdma
diff options
context:
space:
mode:
authorMichael Wang <yun.wang@profitbricks.com>2015-05-18 04:41:45 -0400
committerDoug Ledford <dledford@redhat.com>2015-05-18 13:35:06 -0400
commit296ec00995fb28c4e34b41f80b5a876f3a25c134 (patch)
tree98f94bb1df59b5ebbb36b69406e9f6726536a14a /include/rdma
parent227128fc68401d8e36b660ffeef4320c5fb492d7 (diff)
IB/Verbs: Improve docs for rdma-helpers
Increase the level of documentation for the rdma_cap_* helpers introduced by Michael Wang <yun.wang@profitbricks.com>. This patch is loosely based on a patch Michael wrote to enhance the documentation of these functions, but has been significantly modified in terms of verbiage. In addition, the comments were moved from a kernel Documentation/infiniband/ file to being inline in the header file itself for the functions in question. Finally, the documentation was formated in proper kdoc format. Signed-off-by: Michael Wang <yun.wang@profitbricks.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'include/rdma')
-rw-r--r--include/rdma/ib_verbs.h132
1 files changed, 92 insertions, 40 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 8d59479eea4d..81740c14fdb1 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -1775,14 +1775,16 @@ static inline bool rdma_ib_or_iboe(struct ib_device *device, u8 port_num)
1775} 1775}
1776 1776
1777/** 1777/**
1778 * rdma_cap_ib_mad - Check if the port of device has the capability Infiniband 1778 * rdma_cap_ib_mad - Check if the port of a device supports Infiniband
1779 * Management Datagrams. 1779 * Management Datagrams.
1780 * @device: Device to check
1781 * @port_num: Port number to check
1780 * 1782 *
1781 * @device: Device to be checked 1783 * Management Datagrams (MAD) are a required part of the InfiniBand
1782 * @port_num: Port number of the device 1784 * specification and are supported on all InfiniBand devices. A slightly
1785 * extended version are also supported on OPA interfaces.
1783 * 1786 *
1784 * Return false when port of the device don't support Infiniband 1787 * Return: true if the port supports sending/receiving of MAD packets.
1785 * Management Datagrams.
1786 */ 1788 */
1787static inline bool rdma_cap_ib_mad(struct ib_device *device, u8 port_num) 1789static inline bool rdma_cap_ib_mad(struct ib_device *device, u8 port_num)
1788{ 1790{
@@ -1790,14 +1792,24 @@ static inline bool rdma_cap_ib_mad(struct ib_device *device, u8 port_num)
1790} 1792}
1791 1793
1792/** 1794/**
1793 * rdma_cap_ib_smi - Check if the port of device has the capability Infiniband 1795 * rdma_cap_ib_smi - Check if the port of a device provides an Infiniband
1794 * Subnet Management Interface. 1796 * Subnet Management Agent (SMA) on the Subnet Management Interface (SMI).
1797 * @device: Device to check
1798 * @port_num: Port number to check
1795 * 1799 *
1796 * @device: Device to be checked 1800 * Each InfiniBand node is required to provide a Subnet Management Agent
1797 * @port_num: Port number of the device 1801 * that the subnet manager can access. Prior to the fabric being fully
1802 * configured by the subnet manager, the SMA is accessed via a well known
1803 * interface called the Subnet Management Interface (SMI). This interface
1804 * uses directed route packets to communicate with the SM to get around the
1805 * chicken and egg problem of the SM needing to know what's on the fabric
1806 * in order to configure the fabric, and needing to configure the fabric in
1807 * order to send packets to the devices on the fabric. These directed
1808 * route packets do not need the fabric fully configured in order to reach
1809 * their destination. The SMI is the only method allowed to send
1810 * directed route packets on an InfiniBand fabric.
1798 * 1811 *
1799 * Return false when port of the device don't support Infiniband 1812 * Return: true if the port provides an SMI.
1800 * Subnet Management Interface.
1801 */ 1813 */
1802static inline bool rdma_cap_ib_smi(struct ib_device *device, u8 port_num) 1814static inline bool rdma_cap_ib_smi(struct ib_device *device, u8 port_num)
1803{ 1815{
@@ -1807,12 +1819,17 @@ static inline bool rdma_cap_ib_smi(struct ib_device *device, u8 port_num)
1807/** 1819/**
1808 * rdma_cap_ib_cm - Check if the port of device has the capability Infiniband 1820 * rdma_cap_ib_cm - Check if the port of device has the capability Infiniband
1809 * Communication Manager. 1821 * Communication Manager.
1822 * @device: Device to check
1823 * @port_num: Port number to check
1810 * 1824 *
1811 * @device: Device to be checked 1825 * The InfiniBand Communication Manager is one of many pre-defined General
1812 * @port_num: Port number of the device 1826 * Service Agents (GSA) that are accessed via the General Service
1827 * Interface (GSI). It's role is to facilitate establishment of connections
1828 * between nodes as well as other management related tasks for established
1829 * connections.
1813 * 1830 *
1814 * Return false when port of the device don't support Infiniband 1831 * Return: true if the port supports an IB CM (this does not guarantee that
1815 * Communication Manager. 1832 * a CM is actually running however).
1816 */ 1833 */
1817static inline bool rdma_cap_ib_cm(struct ib_device *device, u8 port_num) 1834static inline bool rdma_cap_ib_cm(struct ib_device *device, u8 port_num)
1818{ 1835{
@@ -1822,12 +1839,14 @@ static inline bool rdma_cap_ib_cm(struct ib_device *device, u8 port_num)
1822/** 1839/**
1823 * rdma_cap_iw_cm - Check if the port of device has the capability IWARP 1840 * rdma_cap_iw_cm - Check if the port of device has the capability IWARP
1824 * Communication Manager. 1841 * Communication Manager.
1842 * @device: Device to check
1843 * @port_num: Port number to check
1825 * 1844 *
1826 * @device: Device to be checked 1845 * Similar to above, but specific to iWARP connections which have a different
1827 * @port_num: Port number of the device 1846 * managment protocol than InfiniBand.
1828 * 1847 *
1829 * Return false when port of the device don't support IWARP 1848 * Return: true if the port supports an iWARP CM (this does not guarantee that
1830 * Communication Manager. 1849 * a CM is actually running however).
1831 */ 1850 */
1832static inline bool rdma_cap_iw_cm(struct ib_device *device, u8 port_num) 1851static inline bool rdma_cap_iw_cm(struct ib_device *device, u8 port_num)
1833{ 1852{
@@ -1837,12 +1856,17 @@ static inline bool rdma_cap_iw_cm(struct ib_device *device, u8 port_num)
1837/** 1856/**
1838 * rdma_cap_ib_sa - Check if the port of device has the capability Infiniband 1857 * rdma_cap_ib_sa - Check if the port of device has the capability Infiniband
1839 * Subnet Administration. 1858 * Subnet Administration.
1859 * @device: Device to check
1860 * @port_num: Port number to check
1840 * 1861 *
1841 * @device: Device to be checked 1862 * An InfiniBand Subnet Administration (SA) service is a pre-defined General
1842 * @port_num: Port number of the device 1863 * Service Agent (GSA) provided by the Subnet Manager (SM). On InfiniBand
1864 * fabrics, devices should resolve routes to other hosts by contacting the
1865 * SA to query the proper route.
1843 * 1866 *
1844 * Return false when port of the device don't support Infiniband 1867 * Return: true if the port should act as a client to the fabric Subnet
1845 * Subnet Administration. 1868 * Administration interface. This does not imply that the SA service is
1869 * running locally.
1846 */ 1870 */
1847static inline bool rdma_cap_ib_sa(struct ib_device *device, u8 port_num) 1871static inline bool rdma_cap_ib_sa(struct ib_device *device, u8 port_num)
1848{ 1872{
@@ -1852,12 +1876,19 @@ static inline bool rdma_cap_ib_sa(struct ib_device *device, u8 port_num)
1852/** 1876/**
1853 * rdma_cap_ib_mcast - Check if the port of device has the capability Infiniband 1877 * rdma_cap_ib_mcast - Check if the port of device has the capability Infiniband
1854 * Multicast. 1878 * Multicast.
1879 * @device: Device to check
1880 * @port_num: Port number to check
1855 * 1881 *
1856 * @device: Device to be checked 1882 * InfiniBand multicast registration is more complex than normal IPv4 or
1857 * @port_num: Port number of the device 1883 * IPv6 multicast registration. Each Host Channel Adapter must register
1884 * with the Subnet Manager when it wishes to join a multicast group. It
1885 * should do so only once regardless of how many queue pairs it subscribes
1886 * to this group. And it should leave the group only after all queue pairs
1887 * attached to the group have been detached.
1858 * 1888 *
1859 * Return false when port of the device don't support Infiniband 1889 * Return: true if the port must undertake the additional adminstrative
1860 * Multicast. 1890 * overhead of registering/unregistering with the SM and tracking of the
1891 * total number of queue pairs attached to the multicast group.
1861 */ 1892 */
1862static inline bool rdma_cap_ib_mcast(struct ib_device *device, u8 port_num) 1893static inline bool rdma_cap_ib_mcast(struct ib_device *device, u8 port_num)
1863{ 1894{
@@ -1867,12 +1898,15 @@ static inline bool rdma_cap_ib_mcast(struct ib_device *device, u8 port_num)
1867/** 1898/**
1868 * rdma_cap_af_ib - Check if the port of device has the capability 1899 * rdma_cap_af_ib - Check if the port of device has the capability
1869 * Native Infiniband Address. 1900 * Native Infiniband Address.
1901 * @device: Device to check
1902 * @port_num: Port number to check
1870 * 1903 *
1871 * @device: Device to be checked 1904 * InfiniBand addressing uses a port's GUID + Subnet Prefix to make a default
1872 * @port_num: Port number of the device 1905 * GID. RoCE uses a different mechanism, but still generates a GID via
1906 * a prescribed mechanism and port specific data.
1873 * 1907 *
1874 * Return false when port of the device don't support 1908 * Return: true if the port uses a GID address to identify devices on the
1875 * Native Infiniband Address. 1909 * network.
1876 */ 1910 */
1877static inline bool rdma_cap_af_ib(struct ib_device *device, u8 port_num) 1911static inline bool rdma_cap_af_ib(struct ib_device *device, u8 port_num)
1878{ 1912{
@@ -1881,13 +1915,19 @@ static inline bool rdma_cap_af_ib(struct ib_device *device, u8 port_num)
1881 1915
1882/** 1916/**
1883 * rdma_cap_eth_ah - Check if the port of device has the capability 1917 * rdma_cap_eth_ah - Check if the port of device has the capability
1884 * Ethernet Address Handler. 1918 * Ethernet Address Handle.
1919 * @device: Device to check
1920 * @port_num: Port number to check
1885 * 1921 *
1886 * @device: Device to be checked 1922 * RoCE is InfiniBand over Ethernet, and it uses a well defined technique
1887 * @port_num: Port number of the device 1923 * to fabricate GIDs over Ethernet/IP specific addresses native to the
1924 * port. Normally, packet headers are generated by the sending host
1925 * adapter, but when sending connectionless datagrams, we must manually
1926 * inject the proper headers for the fabric we are communicating over.
1888 * 1927 *
1889 * Return false when port of the device don't support 1928 * Return: true if we are running as a RoCE port and must force the
1890 * Ethernet Address Handler. 1929 * addition of a Global Route Header built from our Ethernet Address
1930 * Handle into our header list for connectionless packets.
1891 */ 1931 */
1892static inline bool rdma_cap_eth_ah(struct ib_device *device, u8 port_num) 1932static inline bool rdma_cap_eth_ah(struct ib_device *device, u8 port_num)
1893{ 1933{
@@ -1897,12 +1937,24 @@ static inline bool rdma_cap_eth_ah(struct ib_device *device, u8 port_num)
1897/** 1937/**
1898 * rdma_cap_read_multi_sge - Check if the port of device has the capability 1938 * rdma_cap_read_multi_sge - Check if the port of device has the capability
1899 * RDMA Read Multiple Scatter-Gather Entries. 1939 * RDMA Read Multiple Scatter-Gather Entries.
1940 * @device: Device to check
1941 * @port_num: Port number to check
1900 * 1942 *
1901 * @device: Device to be checked 1943 * iWARP has a restriction that RDMA READ requests may only have a single
1902 * @port_num: Port number of the device 1944 * Scatter/Gather Entry (SGE) in the work request.
1903 * 1945 *
1904 * Return false when port of the device don't support 1946 * NOTE: although the linux kernel currently assumes all devices are either
1905 * RDMA Read Multiple Scatter-Gather Entries. 1947 * single SGE RDMA READ devices or identical SGE maximums for RDMA READs and
1948 * WRITEs, according to Tom Talpey, this is not accurate. There are some
1949 * devices out there that support more than a single SGE on RDMA READ
1950 * requests, but do not support the same number of SGEs as they do on
1951 * RDMA WRITE requests. The linux kernel would need rearchitecting to
1952 * support these imbalanced READ/WRITE SGEs allowed devices. So, for now,
1953 * suffice with either the device supports the same READ/WRITE SGEs, or
1954 * it only gets one READ sge.
1955 *
1956 * Return: true for any device that allows more than one SGE in RDMA READ
1957 * requests.
1906 */ 1958 */
1907static inline bool rdma_cap_read_multi_sge(struct ib_device *device, 1959static inline bool rdma_cap_read_multi_sge(struct ib_device *device,
1908 u8 port_num) 1960 u8 port_num)