Skip to content

Commit

Permalink
Use updated P4Runtime server C API in simple_switch_grpc
Browse files Browse the repository at this point in the history
DeviceMgr::init is now called by PIGrpcServerInit (new API function) and
DeviceMgr::destroy is called by PIGrpcServerCleanup.

See p4lang/PI#513
  • Loading branch information
antoninbas committed Jun 2, 2020
1 parent 5bb6075 commit 00b8e4a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions targets/simple_switch_grpc/switch_runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

#include <bm/PI/pi.h>

#include <PI/frontends/proto/device_mgr.h>
#include <PI/frontends/proto/logging.h>

#include <PI/proto/pi_server.h>
Expand Down Expand Up @@ -64,8 +63,6 @@ namespace sswitch_runtime {

namespace sswitch_grpc {

using pi::fe::proto::DeviceMgr;

using grpc::ServerContext;
using grpc::Status;
using grpc::StatusCode;
Expand Down Expand Up @@ -506,7 +503,7 @@ SimpleSwitchGrpcRunner::SimpleSwitchGrpcRunner(
dp_grpc_server_addr(dp_grpc_server_addr),
dp_service(nullptr),
dp_grpc_server(nullptr) {
DeviceMgr::init();
PIGrpcServerInit();
}

int
Expand Down Expand Up @@ -680,7 +677,6 @@ SimpleSwitchGrpcRunner::is_dp_service_active() {

SimpleSwitchGrpcRunner::~SimpleSwitchGrpcRunner() {
PIGrpcServerCleanup();
DeviceMgr::destroy();
}

void
Expand Down

0 comments on commit 00b8e4a

Please sign in to comment.