summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gpxe/errfile.h1
-rw-r--r--src/include/gpxe/ib_sma.h63
2 files changed, 64 insertions, 0 deletions
diff --git a/src/include/gpxe/errfile.h b/src/include/gpxe/errfile.h
index 31826a86f..c314ceed8 100644
--- a/src/include/gpxe/errfile.h
+++ b/src/include/gpxe/errfile.h
@@ -135,6 +135,7 @@
#define ERRFILE_netdev_settings ( ERRFILE_NET | 0x00140000 )
#define ERRFILE_dhcppkt ( ERRFILE_NET | 0x00150000 )
#define ERRFILE_slam ( ERRFILE_NET | 0x00160000 )
+#define ERRFILE_ib_sma ( ERRFILE_NET | 0x00170000 )
#define ERRFILE_image ( ERRFILE_IMAGE | 0x00000000 )
#define ERRFILE_elf ( ERRFILE_IMAGE | 0x00010000 )
diff --git a/src/include/gpxe/ib_sma.h b/src/include/gpxe/ib_sma.h
new file mode 100644
index 000000000..835ed4ead
--- /dev/null
+++ b/src/include/gpxe/ib_sma.h
@@ -0,0 +1,63 @@
+#ifndef _GPXE_IB_SMA_H
+#define _GPXE_IB_SMA_H
+
+/** @file
+ *
+ * Infiniband Subnet Management Agent
+ *
+ */
+
+#include <gpxe/infiniband.h>
+#include <gpxe/process.h>
+
+/** Infiniband Subnet Management Agent operations */
+struct ib_sma_operations {
+ /** Set port information
+ *
+ * @v ibdev Infiniband device
+ * @v port_info New port information
+ */
+ int ( * set_port_info ) ( struct ib_device *ibdev,
+ const struct ib_port_info *port_info );
+};
+
+/** An Infiniband Subnet Management Agent */
+struct ib_sma {
+ /** Infiniband device */
+ struct ib_device *ibdev;
+ /** SMA operations */
+ struct ib_sma_operations *op;
+ /** SMA completion queue */
+ struct ib_completion_queue *cq;
+ /** SMA queue pair */
+ struct ib_queue_pair *qp;
+ /** Poll process */
+ struct process poll;
+};
+
+/** SMA payload size allocated for received packets */
+#define IB_SMA_PAYLOAD_LEN 2048
+
+/** SMA number of send WQEs
+ *
+ * This is a policy decision.
+ */
+#define IB_SMA_NUM_SEND_WQES 4
+
+/** SMA number of receive WQEs
+ *
+ * This is a policy decision.
+ */
+#define IB_SMA_NUM_RECV_WQES 2
+
+/** SMA number of completion queue entries
+ *
+ * This is a policy decision
+ */
+#define IB_SMA_NUM_CQES 8
+
+extern int ib_create_sma ( struct ib_sma *sma, struct ib_device *ibdev,
+ struct ib_sma_operations *op );
+extern void ib_destroy_sma ( struct ib_sma *sma );
+
+#endif /* _GPXE_IB_SMA_H */