-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Abstract sockets #470
Abstract sockets #470
Changes from 5 commits
8037a7a
0f5bf22
e87be57
e6df795
3c68e61
78e713d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,6 +79,7 @@ func NewServer(ctx context.Context, name string, authzServer networkservice.Netw | |
) | ||
nsClient := registryclient.NewNetworkServiceRegistryClient(ctx, clientURL, registryclient.WithDialOptions(clientDialOptions...)) | ||
|
||
netNsInfo := memif.NewNetNSInfo() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Mixaster995 Why are we doing this outside the memif.NewServer() ? If this can be safely done inside memif.NewServer it vastly simplifies the use of memif.NewServer... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @edwarnicke i was under impression that it was required for some logic, but was mistaken. Made some refactoring and tested all changes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Mixaster995 Its all good. When reworking someone else's work, its sometimes hard to figure out if something that looks weird is essential or not. |
||
rv := &xconnectNSServer{} | ||
additionalFunctionality := []networkservice.NetworkServiceServer{ | ||
recvfd.NewServer(), | ||
|
@@ -93,7 +94,10 @@ func NewServer(ctx context.Context, name string, authzServer networkservice.Netw | |
tag.NewServer(ctx, vppConn), | ||
mtu.NewServer(vppConn), | ||
mechanisms.NewServer(map[string]networkservice.NetworkServiceServer{ | ||
memif.MECHANISM: memif.NewServer(vppConn, memif.WithDirectMemif()), | ||
memif.MECHANISM: memif.NewServer(ctx, vppConn, netNsInfo, | ||
memif.WithDirectMemif(), | ||
memif.WithChangeNetNS(), | ||
memif.WithExternalVPP()), | ||
kernel.MECHANISM: kernel.NewServer(vppConn), | ||
vxlan.MECHANISM: vxlan.NewServer(vppConn, tunnelIP, vxlan.WithVniPort(tunnelPort)), | ||
wireguard.MECHANISM: wireguard.NewServer(vppConn, tunnelIP), | ||
|
@@ -113,7 +117,10 @@ func NewServer(ctx context.Context, name string, authzServer networkservice.Netw | |
mtu.NewClient(vppConn), | ||
tag.NewClient(ctx, vppConn), | ||
// mechanisms | ||
memif.NewClient(vppConn), | ||
memif.NewClient(vppConn, netNsInfo, | ||
memif.WithChangeNetNS(), | ||
memif.WithExternalVPP(), | ||
), | ||
kernel.NewClient(vppConn), | ||
vxlan.NewClient(vppConn, tunnelIP, vxlan.WithVniPort(tunnelPort)), | ||
wireguard.NewClient(vppConn, tunnelIP), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test https://github.com/Mixaster995/sdk-vpp/blob/abstract-sockets/pkg/tools/proxy/proxy_test.go#L44
failes without these lines
The reason is creation of a new network namespace throws
operation not permitted
on linux, so we have to use sudo, and this construction in ci passes correct envs to it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it :)