diff --git a/pkg/networkservice/mechanisms/kernel/kerneltap/common.go b/pkg/networkservice/mechanisms/kernel/kerneltap/common.go index 2dc43aec..67058ccb 100644 --- a/pkg/networkservice/mechanisms/kernel/kerneltap/common.go +++ b/pkg/networkservice/mechanisms/kernel/kerneltap/common.go @@ -21,6 +21,7 @@ package kerneltap import ( "context" + "runtime/debug" "time" interfaces "github.com/networkservicemesh/govpp/binapi/interface" @@ -77,6 +78,13 @@ func create(ctx context.Context, conn *networkservice.Connection, vppConn api.Co tapCreate.TapFlags ^= tapv2.TAP_API_FLAG_TUN } + deadline, ok := ctx.Deadline() + if ok { + timeout := time.Until(deadline) + log.FromContext(ctx).Infof("timeout before creating tap inteface: %v", timeout) + log.FromContext(ctx).Infof("stack trace: %s", string(debug.Stack())) + } + rsp, err := tapv2.NewServiceClient(vppConn).TapCreateV3(ctx, tapCreate) if err != nil { return errors.Wrap(err, "vppapi TapCreateV3 returned error") @@ -147,6 +155,13 @@ func del(ctx context.Context, conn *networkservice.Connection, vppConn api.Conne return nil } now := time.Now() + + deadline, ok := ctx.Deadline() + if ok { + timeout := time.Until(deadline) + log.FromContext(ctx).Infof("timeout before deleting tap inteface: %v", timeout) + log.FromContext(ctx).Infof("stack trace: %s", string(debug.Stack())) + } _, err := tapv2.NewServiceClient(vppConn).TapDeleteV2(ctx, &tapv2.TapDeleteV2{ SwIfIndex: swIfIndex, })