Skip to content

Commit

Permalink
Fix RDMA support in sample apps
Browse files Browse the repository at this point in the history
Commit a4f5e3d ("Refactor MCM Data Plane SDK API + upgrade FFmpeg plugins and sample apps (#213)")
introduced a new MCM SDK API but occassionally removed RDMA
support from sample apps.

Add support of RDMA in sample apps with the new API.

Fixes: a4f5e3d ("Refactor MCM Data Plane SDK API + upgrade FFmpeg plugins and sample apps (#213)")
Signed-off-by: Konstantin Ilichev <konstantin.ilichev@intel.com>
Change-type: DefectResolution
  • Loading branch information
ko80 committed Oct 29, 2024
1 parent a4f5e3d commit dffddf8
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 46 deletions.
63 changes: 40 additions & 23 deletions sdk/samples/recver_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,35 +217,52 @@ int main(int argc, char** argv)
goto error_delete_conn;
}
} else {
MeshConfig_ST2110 cfg;

strlcpy(cfg.remote_ip_addr, send_addr, sizeof(cfg.remote_ip_addr));
cfg.remote_port = atoi(send_port);
strlcpy(cfg.local_ip_addr, recv_addr, sizeof(cfg.local_ip_addr));
cfg.local_port = atoi(recv_port);

/* transport type */
if (!strcmp(payload_type, "st20")) {
cfg.transport = MESH_CONN_TRANSPORT_ST2110_20;
} else if (!strcmp(payload_type, "st22")) {
cfg.transport = MESH_CONN_TRANSPORT_ST2110_22;
} else if (!strcmp(payload_type, "st30")) {
cfg.transport = MESH_CONN_TRANSPORT_ST2110_30;
if (!strcmp(payload_type, "rdma")) {
MeshConfig_RDMA cfg;

strlcpy(cfg.remote_ip_addr, send_addr, sizeof(cfg.remote_ip_addr));
cfg.remote_port = atoi(send_port);
strlcpy(cfg.local_ip_addr, recv_addr, sizeof(cfg.local_ip_addr));
cfg.local_port = atoi(recv_port);

err = mesh_apply_connection_config_rdma(conn, &cfg);
if (err) {
printf("Failed to apply RDMA configuration: %s (%d)\n",
mesh_err2str(err), err);
goto error_delete_conn;
}
} else {
printf("Unknown SMPTE ST2110 transport type: %s\n", payload_type);
goto error_delete_conn;
}
MeshConfig_ST2110 cfg;

strlcpy(cfg.remote_ip_addr, send_addr, sizeof(cfg.remote_ip_addr));
cfg.remote_port = atoi(send_port);
strlcpy(cfg.local_ip_addr, recv_addr, sizeof(cfg.local_ip_addr));
cfg.local_port = atoi(recv_port);

/* transport type */
if (!strcmp(payload_type, "st20")) {
cfg.transport = MESH_CONN_TRANSPORT_ST2110_20;
} else if (!strcmp(payload_type, "st22")) {
cfg.transport = MESH_CONN_TRANSPORT_ST2110_22;
} else if (!strcmp(payload_type, "st30")) {
cfg.transport = MESH_CONN_TRANSPORT_ST2110_30;
} else {
printf("Unknown SMPTE ST2110 transport type: %s\n", payload_type);
goto error_delete_conn;
}

err = mesh_apply_connection_config_st2110(conn, &cfg);
if (err) {
printf("Failed to apply SMPTE ST2110 configuration: %s (%d)\n",
mesh_err2str(err), err);
goto error_delete_conn;
err = mesh_apply_connection_config_st2110(conn, &cfg);
if (err) {
printf("Failed to apply SMPTE ST2110 configuration: %s (%d)\n",
mesh_err2str(err), err);
goto error_delete_conn;
}
}
}

/* payload type */
if (!strcmp(payload_type, "st20") || !strcmp(payload_type, "st22")) {
if (!strcmp(payload_type, "st20") || !strcmp(payload_type, "st22") ||
!strcmp(payload_type, "rdma")) {
/* video */
MeshConfig_Video cfg;

Expand Down
63 changes: 40 additions & 23 deletions sdk/samples/sender_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,35 +257,52 @@ int main(int argc, char** argv)
goto error_delete_conn;
}
} else {
MeshConfig_ST2110 cfg;

strlcpy(cfg.remote_ip_addr, send_addr, sizeof(cfg.remote_ip_addr));
cfg.remote_port = atoi(send_port);
strlcpy(cfg.local_ip_addr, recv_addr, sizeof(cfg.local_ip_addr));
cfg.local_port = atoi(recv_port);

/* transport type */
if (!strcmp(payload_type, "st20")) {
cfg.transport = MESH_CONN_TRANSPORT_ST2110_20;
} else if (!strcmp(payload_type, "st22")) {
cfg.transport = MESH_CONN_TRANSPORT_ST2110_22;
} else if (!strcmp(payload_type, "st30")) {
cfg.transport = MESH_CONN_TRANSPORT_ST2110_30;
if (!strcmp(payload_type, "rdma")) {
MeshConfig_RDMA cfg;

strlcpy(cfg.remote_ip_addr, send_addr, sizeof(cfg.remote_ip_addr));
cfg.remote_port = atoi(send_port);
strlcpy(cfg.local_ip_addr, recv_addr, sizeof(cfg.local_ip_addr));
cfg.local_port = atoi(recv_port);

err = mesh_apply_connection_config_rdma(conn, &cfg);
if (err) {
printf("Failed to apply RDMA configuration: %s (%d)\n",
mesh_err2str(err), err);
goto error_delete_conn;
}
} else {
printf("Unknown SMPTE ST2110 transport type: %s\n", payload_type);
goto error_delete_conn;
}
MeshConfig_ST2110 cfg;

strlcpy(cfg.remote_ip_addr, send_addr, sizeof(cfg.remote_ip_addr));
cfg.remote_port = atoi(send_port);
strlcpy(cfg.local_ip_addr, recv_addr, sizeof(cfg.local_ip_addr));
cfg.local_port = atoi(recv_port);

/* transport type */
if (!strcmp(payload_type, "st20")) {
cfg.transport = MESH_CONN_TRANSPORT_ST2110_20;
} else if (!strcmp(payload_type, "st22")) {
cfg.transport = MESH_CONN_TRANSPORT_ST2110_22;
} else if (!strcmp(payload_type, "st30")) {
cfg.transport = MESH_CONN_TRANSPORT_ST2110_30;
} else {
printf("Unknown SMPTE ST2110 transport type: %s\n", payload_type);
goto error_delete_conn;
}

err = mesh_apply_connection_config_st2110(conn, &cfg);
if (err) {
printf("Failed to apply SMPTE ST2110 configuration: %s (%d)\n",
mesh_err2str(err), err);
goto error_delete_conn;
err = mesh_apply_connection_config_st2110(conn, &cfg);
if (err) {
printf("Failed to apply SMPTE ST2110 configuration: %s (%d)\n",
mesh_err2str(err), err);
goto error_delete_conn;
}
}
}

/* payload type */
if (!strcmp(payload_type, "st20") || !strcmp(payload_type, "st22")) {
if (!strcmp(payload_type, "st20") || !strcmp(payload_type, "st22") ||
!strcmp(payload_type, "rdma")) {
/* video */
MeshConfig_Video cfg;

Expand Down

0 comments on commit dffddf8

Please sign in to comment.