Skip to content

Commit

Permalink
gRPC light removal (#234)
Browse files Browse the repository at this point in the history
Light gRPC removal

Signed-off-by: Tomasz Szumski <tomasz.szumski@intel.com>
  • Loading branch information
tszumski authored Oct 18, 2024
1 parent ab85760 commit 04ac9f1
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 367 deletions.
20 changes: 0 additions & 20 deletions media-proxy/include/proxy_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <string_view>
#include <vector>

#include "controller.grpc.pb.h"
#include "mtl.h"
#include "libfabric_dev.h"
#include "rdma_session.h"
Expand All @@ -25,16 +24,6 @@
#define ST_APP_PAYLOAD_TYPE_ST22 (114)
#endif

using controller::MemIFOps;
using controller::RxControlRequest;
using controller::St20pRxOps;
using controller::St20pTxOps;
using controller::StInit;
using controller::StopControlRequest;
using controller::StRxPort;
using controller::StTxPort;
using controller::TxControlRequest;

#pragma once

class ProxyContext {
Expand Down Expand Up @@ -81,16 +70,10 @@ class ProxyContext {
std::string getTCPListenAddress(void);
int getTCPListenPort(void);

void ParseStInitParam(const TxControlRequest* request, struct mtl_init_params* init_param);
void ParseStInitParam(const RxControlRequest* request, struct mtl_init_params* init_param);
void ParseStInitParam(const mcm_conn_param* request, struct mtl_init_params* init_param);

void ParseMemIFParam(const TxControlRequest* request, memif_ops_t& memif_ops);
void ParseMemIFParam(const RxControlRequest* request, memif_ops_t& memif_ops);
void ParseMemIFParam(const mcm_conn_param* request, memif_ops_t& memif_ops);

void ParseSt20TxOps(const TxControlRequest* request, struct st20p_tx_ops* opts);
void ParseSt20RxOps(const RxControlRequest* request, struct st20p_rx_ops* opts);
void ParseSt20TxOps(const mcm_conn_param* request, struct st20p_tx_ops* opts);
void ParseSt20RxOps(const mcm_conn_param* request, struct st20p_rx_ops* opts);
void ParseSt22TxOps(const mcm_conn_param* request, struct st22p_tx_ops* opts);
Expand All @@ -99,13 +82,10 @@ class ProxyContext {
void ParseSt30RxOps(const mcm_conn_param* request, struct st30_rx_ops* opts);
void ParseSt40TxOps(const mcm_conn_param* request, struct st40_tx_ops* opts);
void ParseSt40RxOps(const mcm_conn_param* request, struct st40_rx_ops* opts);
int TxStart(const TxControlRequest* request);
int RxStart(const RxControlRequest* request);
int TxStart(const mcm_conn_param* request);
int RxStart(const mcm_conn_param* request);
void TxStop(const int32_t session_id);
void RxStop(const int32_t session_id);
void Stop();

private:
std::atomic<std::uint32_t> mSessionCount;
Expand Down
36 changes: 0 additions & 36 deletions media-proxy/src/api_server_grpc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,67 +13,31 @@ ConfigureServiceImpl::ConfigureServiceImpl(ProxyContext* ctx)

Status ConfigureServiceImpl::TxStart(ServerContext* context, const TxControlRequest* request, ControlReply* reply)
{
int session_id = 0;
std::string ret_msg = "";

std::cout << "\nReceived command: TxStart." << std::endl;

session_id = m_ctx->TxStart(request);
if (session_id >= 0) {
ret_msg = std::to_string(session_id);
} else {
ret_msg = "Failed";
}
reply->set_message("Create MTL TX session: " + ret_msg);

return Status::OK;
}

Status ConfigureServiceImpl::RxStart(ServerContext* context, const RxControlRequest* request, ControlReply* reply)
{
int session_id = 0;
std::string ret_msg = "";

std::cout << "\nReceived command: RxStart." << std::endl;

session_id = m_ctx->RxStart(request);
if (session_id >= 0) {
ret_msg = std::to_string(session_id);
} else {
ret_msg = "Failed";
}
reply->set_message("Create MTL RX session: " + ret_msg);

return Status::OK;
}

Status ConfigureServiceImpl::TxStop(ServerContext* context, const StopControlRequest* request, ControlReply* reply)
{
std::cout << "\nReceived command: Stop." << std::endl;

m_ctx->TxStop(request->session_id());
reply->set_message("gPRC reply: well received.");

return Status::OK;
}

Status ConfigureServiceImpl::RxStop(ServerContext* context, const StopControlRequest* request, ControlReply* reply)
{
std::cout << "\nReceived command: Stop." << std::endl;

m_ctx->RxStop(request->session_id());
reply->set_message("gPRC reply: well received.");

return Status::OK;
}

Status ConfigureServiceImpl::Stop(ServerContext* context, const StopControlRequest* request, ControlReply* reply)
{
std::cout << "\nReceived command: Stop." << std::endl;

m_ctx->Stop();
reply->set_message("gPRC reply: well received.");

return Status::OK;
}

Expand Down
5 changes: 0 additions & 5 deletions media-proxy/src/media_proxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,8 @@ int main(int argc, char* argv[])
ctx->setDevicePort(dev_port);
ctx->setDataPlaneAddress(dp_ip);

/* start gRPC server */
std::thread rpcThread(RunRPCServer, ctx);

/* start TCP server */
std::thread tcpThread(RunTCPServer, ctx);

rpcThread.join();
tcpThread.join();

delete (ctx);
Expand Down
Loading

0 comments on commit 04ac9f1

Please sign in to comment.