https://github.com/yj8023xx/librdma
A powerful library designed to simplify the development process of RDMA applications
https://github.com/yj8023xx/librdma
c library rdma
Last synced: 8 months ago
JSON representation
A powerful library designed to simplify the development process of RDMA applications
- Host: GitHub
- URL: https://github.com/yj8023xx/librdma
- Owner: yj8023xx
- Created: 2023-06-27T08:44:40.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-21T14:29:10.000Z (about 2 years ago)
- Last Synced: 2025-03-04T04:44:23.838Z (over 1 year ago)
- Topics: c, library, rdma
- Language: C
- Homepage:
- Size: 152 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# librdma
## Overview
**librdma** is a powerful library designed to simplify the development process of Remote Direct Memory Access (RDMA) applications. It abstracts away the complexities of underlying implementation details, providing a straightforward and user-friendly interface for RDMA development. This library aims to streamline the RDMA development experience, making it accessible to a broader audience and facilitating the creation of high-performance, low-latency networking applications.
## Getting Started
To start using librdma in your project, follow these simple steps:
1. **Clone the Repository:**
```bash
git clone https://github.com/yj8023xx/librdma.git
```
2. **Build the Library:**
```bash
cd librdma
make
```
3. **Integrate into Your Project:**
Link against the librdma library in your project and include the necessary headers
If you want to generate debug information, please add a flag in the Makefile: `RDMA_FLAGS += -DDEBUG`
## Example
**Server Side**
```c
// setup server accept conn param
struct conn_param accept_options = {
.poll_mode = CQ_POLL_MODE_POLLING,
.on_pre_connect_cb = app_on_pre_connect_cb,
.on_connect_cb = app_on_connect_cb};
struct agent_context *server = create_server(1, 1, &accept_options);
// sockfd for listening
char *src_addr = "10.10.10.2";
char *port = "12345";
struct conn_context *listen_ctx = server_listen(server, src_addr, port);
// start listening
start_listen(listen_ctx);
```
**Client Side**
```c
// create client
struct agent_context *client = create_client(1, 1);
char *dst_addr = "10.10.10.2";
char *port = "12345";
struct conn_param rc_options = {.poll_mode = CQ_POLL_MODE_POLLING,
.on_pre_connect_cb = app_on_pre_connect_cb,
.on_connect_cb = app_on_connect_cb};
struct conn_context *rc_ctx =
add_connection_rc(client, dst_addr, port, &rc_options);
// connect to server
start_connect(rc_ctx);
// free resources
destroy_agent(client);
```
**Callback**
```c
void app_on_pre_connect_cb(struct conn_context *ctx) {
// write your code, e.g, register mr
}
void app_on_connect_cb(struct conn_context *ctx) {
// write your code
}
void app_on_complete_cb(struct conn_context *ctx) {
// write your code to handle complete events
}
void app_on_disconnect_cb(struct conn_context *ctx) {
// write your code
}
```
## Contact
For any inquiries or feedback, please contact the maintainers of librdma at [913660289@qq.com](mailto:913660289@qq.com). We appreciate your input and participation in making librdma a valuable tool for RDMA development.