Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions dataplane/saiserver/tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func (t *tunnel) CreateTunnel(ctx context.Context, req *saipb.CreateTunnelReques
id := t.mgr.NextID()

tunType := req.GetType()

switch tunType {
case saipb.TunnelType_TUNNEL_TYPE_IPINIP:
default:
Expand All @@ -62,17 +63,12 @@ func (t *tunnel) CreateTunnel(ctx context.Context, req *saipb.CreateTunnelReques
if ecnMode == saipb.TunnelEncapEcnMode_TUNNEL_ENCAP_ECN_MODE_STANDARD && dscpMode == saipb.TunnelDscpMode_TUNNEL_DSCP_MODE_UNIFORM_MODEL { // Copy the QOS bits from the inner IP header.
actions = append(actions, fwdconfig.Action(fwdconfig.UpdateAction(fwdpb.UpdateType_UPDATE_TYPE_COPY, fwdpb.PacketFieldNum_PACKET_FIELD_NUM_IP_QOS).
WithFieldSrc(fwdpb.PacketFieldNum_PACKET_FIELD_NUM_IP_QOS).WithFieldSrcInstance(1)).Build())
} else {
return nil, status.Errorf(codes.InvalidArgument, "unsupported encap ecn mode %v and dscp mode: %v", ecnMode, dscpMode)
}
Comment thread
sonikajindal marked this conversation as resolved.

ttlMode := req.GetEncapTtlMode()
switch ttlMode {
case saipb.TunnelTtlMode_TUNNEL_TTL_MODE_UNIFORM_MODEL: // Copy the TTL from the inner IP header.
if ttlMode == saipb.TunnelTtlMode_TUNNEL_TTL_MODE_UNIFORM_MODEL { // Copy the TTL from the inner IP header.
Comment thread
sonikajindal marked this conversation as resolved.
actions = append(actions, fwdconfig.Action(fwdconfig.UpdateAction(fwdpb.UpdateType_UPDATE_TYPE_COPY, fwdpb.PacketFieldNum_PACKET_FIELD_NUM_IP_HOP).
WithFieldSrc(fwdpb.PacketFieldNum_PACKET_FIELD_NUM_IP_HOP).WithFieldSrcInstance(1)).Build())
default:
return nil, status.Errorf(codes.InvalidArgument, "unsupported ttl mode: %v", ttlMode)
}

if req.GetEncapSrcIp() != nil {
Expand Down
4 changes: 2 additions & 2 deletions dataplane/standalone/sai/tunnel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,8 @@ sai_status_t l_create_tunnel(sai_object_id_t *tunnel_id, sai_object_id_t switch_
lemming::dataplane::sai::CreateTunnelRequest req = convert_create_tunnel(switch_id, attr_count, attr_list);
lemming::dataplane::sai::CreateTunnelResponse resp;
grpc::ClientContext context;
req.set_switch_(switch_id);
req.set_switch_(switch_id);

grpc::Status status = tunnel->CreateTunnel(&context, req, &resp);
if (!status.ok()) {
auto it = context.GetServerTrailingMetadata().find("traceparent");
Expand Down
Loading