summaryrefslogtreecommitdiffhomepage
path: root/pkg/p9
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/p9')
-rw-r--r--pkg/p9/BUILD2
-rw-r--r--pkg/p9/client.go4
-rw-r--r--pkg/p9/client_file.go4
-rw-r--r--pkg/p9/client_test.go2
-rw-r--r--pkg/p9/file.go2
-rw-r--r--pkg/p9/handlers.go4
-rw-r--r--pkg/p9/local_server/local_server.go8
-rw-r--r--pkg/p9/messages.go2
-rw-r--r--pkg/p9/p9test/BUILD4
-rw-r--r--pkg/p9/p9test/client_test.go4
-rw-r--r--pkg/p9/p9test/p9test.go4
-rw-r--r--pkg/p9/server.go4
-rw-r--r--pkg/p9/transport.go6
-rw-r--r--pkg/p9/transport_test.go49
14 files changed, 72 insertions, 27 deletions
diff --git a/pkg/p9/BUILD b/pkg/p9/BUILD
index 36b2ec5f6..c6737bf97 100644
--- a/pkg/p9/BUILD
+++ b/pkg/p9/BUILD
@@ -21,7 +21,7 @@ go_library(
"transport.go",
"version.go",
],
- importpath = "gvisor.googlesource.com/gvisor/pkg/p9",
+ importpath = "gvisor.dev/gvisor/pkg/p9",
deps = [
"//pkg/fd",
"//pkg/log",
diff --git a/pkg/p9/client.go b/pkg/p9/client.go
index 56587e2cf..7dc20aeef 100644
--- a/pkg/p9/client.go
+++ b/pkg/p9/client.go
@@ -20,8 +20,8 @@ import (
"sync"
"syscall"
- "gvisor.googlesource.com/gvisor/pkg/log"
- "gvisor.googlesource.com/gvisor/pkg/unet"
+ "gvisor.dev/gvisor/pkg/log"
+ "gvisor.dev/gvisor/pkg/unet"
)
// ErrOutOfTags indicates no tags are available.
diff --git a/pkg/p9/client_file.go b/pkg/p9/client_file.go
index 258080f67..a6cc0617e 100644
--- a/pkg/p9/client_file.go
+++ b/pkg/p9/client_file.go
@@ -21,8 +21,8 @@ import (
"sync/atomic"
"syscall"
- "gvisor.googlesource.com/gvisor/pkg/fd"
- "gvisor.googlesource.com/gvisor/pkg/log"
+ "gvisor.dev/gvisor/pkg/fd"
+ "gvisor.dev/gvisor/pkg/log"
)
// Attach attaches to a server.
diff --git a/pkg/p9/client_test.go b/pkg/p9/client_test.go
index fc49729d8..87b2dd61e 100644
--- a/pkg/p9/client_test.go
+++ b/pkg/p9/client_test.go
@@ -18,7 +18,7 @@ import (
"syscall"
"testing"
- "gvisor.googlesource.com/gvisor/pkg/unet"
+ "gvisor.dev/gvisor/pkg/unet"
)
// TestVersion tests the version negotiation.
diff --git a/pkg/p9/file.go b/pkg/p9/file.go
index a456e8b3d..907445e15 100644
--- a/pkg/p9/file.go
+++ b/pkg/p9/file.go
@@ -17,7 +17,7 @@ package p9
import (
"syscall"
- "gvisor.googlesource.com/gvisor/pkg/fd"
+ "gvisor.dev/gvisor/pkg/fd"
)
// Attacher is provided by the server.
diff --git a/pkg/p9/handlers.go b/pkg/p9/handlers.go
index f32368763..1a976bd13 100644
--- a/pkg/p9/handlers.go
+++ b/pkg/p9/handlers.go
@@ -23,8 +23,8 @@ import (
"sync/atomic"
"syscall"
- "gvisor.googlesource.com/gvisor/pkg/fd"
- "gvisor.googlesource.com/gvisor/pkg/log"
+ "gvisor.dev/gvisor/pkg/fd"
+ "gvisor.dev/gvisor/pkg/log"
)
// ExtractErrno extracts a syscall.Errno from a error, best effort.
diff --git a/pkg/p9/local_server/local_server.go b/pkg/p9/local_server/local_server.go
index 9546b3de5..905188aaa 100644
--- a/pkg/p9/local_server/local_server.go
+++ b/pkg/p9/local_server/local_server.go
@@ -28,10 +28,10 @@ import (
"path"
"syscall"
- "gvisor.googlesource.com/gvisor/pkg/fd"
- "gvisor.googlesource.com/gvisor/pkg/log"
- "gvisor.googlesource.com/gvisor/pkg/p9"
- "gvisor.googlesource.com/gvisor/pkg/unet"
+ "gvisor.dev/gvisor/pkg/fd"
+ "gvisor.dev/gvisor/pkg/log"
+ "gvisor.dev/gvisor/pkg/p9"
+ "gvisor.dev/gvisor/pkg/unet"
)
// local wraps a local file.
diff --git a/pkg/p9/messages.go b/pkg/p9/messages.go
index 75d6bc832..fd9eb1c5d 100644
--- a/pkg/p9/messages.go
+++ b/pkg/p9/messages.go
@@ -18,7 +18,7 @@ import (
"fmt"
"math"
- "gvisor.googlesource.com/gvisor/pkg/fd"
+ "gvisor.dev/gvisor/pkg/fd"
)
// ErrInvalidMsgType is returned when an unsupported message type is found.
diff --git a/pkg/p9/p9test/BUILD b/pkg/p9/p9test/BUILD
index cf22edde8..6e939a49a 100644
--- a/pkg/p9/p9test/BUILD
+++ b/pkg/p9/p9test/BUILD
@@ -8,7 +8,7 @@ alias(
actual = "@com_github_golang_mock//mockgen:mockgen",
)
-MOCK_SRC_PACKAGE = "gvisor.googlesource.com/gvisor/pkg/p9"
+MOCK_SRC_PACKAGE = "gvisor.dev/gvisor/pkg/p9"
# mockgen_reflect is a source file that contains mock generation code that
# imports the p9 package and generates a specification via reflection. The
@@ -64,7 +64,7 @@ go_library(
"mocks.go",
"p9test.go",
],
- importpath = "gvisor.googlesource.com/gvisor/pkg/p9/p9test",
+ importpath = "gvisor.dev/gvisor/pkg/p9/p9test",
visibility = ["//:sandbox"],
deps = [
"//pkg/fd",
diff --git a/pkg/p9/p9test/client_test.go b/pkg/p9/p9test/client_test.go
index e00dd03ab..16799a790 100644
--- a/pkg/p9/p9test/client_test.go
+++ b/pkg/p9/p9test/client_test.go
@@ -28,8 +28,8 @@ import (
"time"
"github.com/golang/mock/gomock"
- "gvisor.googlesource.com/gvisor/pkg/fd"
- "gvisor.googlesource.com/gvisor/pkg/p9"
+ "gvisor.dev/gvisor/pkg/fd"
+ "gvisor.dev/gvisor/pkg/p9"
)
func TestPanic(t *testing.T) {
diff --git a/pkg/p9/p9test/p9test.go b/pkg/p9/p9test/p9test.go
index 1c8eff200..95846e5f7 100644
--- a/pkg/p9/p9test/p9test.go
+++ b/pkg/p9/p9test/p9test.go
@@ -23,8 +23,8 @@ import (
"testing"
"github.com/golang/mock/gomock"
- "gvisor.googlesource.com/gvisor/pkg/p9"
- "gvisor.googlesource.com/gvisor/pkg/unet"
+ "gvisor.dev/gvisor/pkg/p9"
+ "gvisor.dev/gvisor/pkg/unet"
)
// Harness is an attacher mock.
diff --git a/pkg/p9/server.go b/pkg/p9/server.go
index f377a6557..c3ab7dad1 100644
--- a/pkg/p9/server.go
+++ b/pkg/p9/server.go
@@ -21,8 +21,8 @@ import (
"sync/atomic"
"syscall"
- "gvisor.googlesource.com/gvisor/pkg/log"
- "gvisor.googlesource.com/gvisor/pkg/unet"
+ "gvisor.dev/gvisor/pkg/log"
+ "gvisor.dev/gvisor/pkg/unet"
)
// Server is a 9p2000.L server.
diff --git a/pkg/p9/transport.go b/pkg/p9/transport.go
index ef59077ff..5648df589 100644
--- a/pkg/p9/transport.go
+++ b/pkg/p9/transport.go
@@ -22,9 +22,9 @@ import (
"sync"
"syscall"
- "gvisor.googlesource.com/gvisor/pkg/fd"
- "gvisor.googlesource.com/gvisor/pkg/log"
- "gvisor.googlesource.com/gvisor/pkg/unet"
+ "gvisor.dev/gvisor/pkg/fd"
+ "gvisor.dev/gvisor/pkg/log"
+ "gvisor.dev/gvisor/pkg/unet"
)
// ErrSocket is returned in cases of a socket issue.
diff --git a/pkg/p9/transport_test.go b/pkg/p9/transport_test.go
index 0f88ff249..cdb3bc841 100644
--- a/pkg/p9/transport_test.go
+++ b/pkg/p9/transport_test.go
@@ -19,8 +19,8 @@ import (
"os"
"testing"
- "gvisor.googlesource.com/gvisor/pkg/fd"
- "gvisor.googlesource.com/gvisor/pkg/unet"
+ "gvisor.dev/gvisor/pkg/fd"
+ "gvisor.dev/gvisor/pkg/unet"
)
const (
@@ -179,6 +179,51 @@ func TestSendClosed(t *testing.T) {
}
}
+func BenchmarkSendRecv(b *testing.B) {
+ server, client, err := unet.SocketPair(false)
+ if err != nil {
+ b.Fatalf("socketpair got err %v expected nil", err)
+ }
+ defer server.Close()
+ defer client.Close()
+
+ // Exchange Rflush messages since these contain no data and therefore incur
+ // no additional marshaling overhead.
+ go func() {
+ for i := 0; i < b.N; i++ {
+ tag, m, err := recv(server, maximumLength, msgRegistry.get)
+ if err != nil {
+ b.Fatalf("recv got err %v expected nil", err)
+ }
+ if tag != Tag(1) {
+ b.Fatalf("got tag %v expected 1", tag)
+ }
+ if _, ok := m.(*Rflush); !ok {
+ b.Fatalf("got message %T expected *Rflush", m)
+ }
+ if err := send(server, Tag(2), &Rflush{}); err != nil {
+ b.Fatalf("send got err %v expected nil", err)
+ }
+ }
+ }()
+ b.ResetTimer()
+ for i := 0; i < b.N; i++ {
+ if err := send(client, Tag(1), &Rflush{}); err != nil {
+ b.Fatalf("send got err %v expected nil", err)
+ }
+ tag, m, err := recv(client, maximumLength, msgRegistry.get)
+ if err != nil {
+ b.Fatalf("recv got err %v expected nil", err)
+ }
+ if tag != Tag(2) {
+ b.Fatalf("got tag %v expected 2", tag)
+ }
+ if _, ok := m.(*Rflush); !ok {
+ b.Fatalf("got message %v expected *Rflush", m)
+ }
+ }
+}
+
func init() {
msgRegistry.register(MsgTypeBadDecode, func() message { return &badDecode{} })
}