Skip to content

Commit

Permalink
Make vxlan port configurable (networkservicemesh#341)
Browse files Browse the repository at this point in the history
networkservicemesh/sdk-vpp commit message:
Make vxlan port configurable (see networkservicemesh/sdk-vpp#394)

networkservicemesh/sdk commit message:
Make vxlan port configurable (see networkservicemesh/sdk#1091)

Signed-off-by: Zoltan Lugossy <zoltan.lugossy@est.tech>
  • Loading branch information
zolug committed Sep 29, 2021
1 parent f07927e commit 12e0a0a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type Config struct {
LogLevel string `default:"INFO" desc:"Log level" split_words:"true"`

TunnelIP net.IP `desc:"IP to use for tunnels" split_words:"true"`
VxlanPort uint16 `default:"0" desc:"VXLAN port to use" split_words:"true"`
VppAPISocket string `default:"" desc:"filename of socket to connect to existing VPP instance. If empty a VPP instance is run in forwarder" split_words:"true"`
VppInit vppinit.Func `default:"AF_PACKET" desc:"type of VPP initialization. Must be AF_PACKET or NONE" split_words:"true"`

Expand Down
4 changes: 2 additions & 2 deletions internal/tests/suite_vxlan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func newVxlanVerifiableEndpoint(ctx context.Context,
connectioncontext.NewServer(vppConn),
pinhole.NewServer(vppConn),
mechanisms.NewServer(map[string]networkservice.NetworkServiceServer{
vxlan.MECHANISM: vxlan.NewServer(vppConn, net.ParseIP(serverIP)),
vxlan.MECHANISM: vxlan.NewServer(vppConn, net.ParseIP(serverIP), uint16(0)),
}),
),
)
Expand Down Expand Up @@ -105,7 +105,7 @@ func newVxlanVerifiableClient(
client.WithAdditionalFunctionality(
connectioncontext.NewClient(vppConn),
pinhole.NewClient(vppConn),
vxlan.NewClient(vppConn, net.ParseIP(clientIP)),
vxlan.NewClient(vppConn, net.ParseIP(clientIP), uint16(0)),
),
)(ctx, sutCC),
}
Expand Down
3 changes: 2 additions & 1 deletion internal/xconnectns/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,15 @@ func NewServer(
tokenGenerator token.GeneratorFunc,
vppConn vppxconnectns.Connection,
tunnelIP net.IP,
tunnelPort uint16,
pciPool resourcepool.PCIPool,
resourcePool resourcepool.ResourcePool,
sriovConfig *sriovconfig.Config,
vfioDir, cgroupBaseDir string,
clientURL *url.URL,
clientDialOptions ...grpc.DialOption,
) endpoint.Endpoint {
vppForwarder := vppxconnectns.NewServer(ctx, name, authzServer, tokenGenerator, clientURL, vppConn, tunnelIP, clientDialOptions...)
vppForwarder := vppxconnectns.NewServer(ctx, name, authzServer, tokenGenerator, clientURL, vppConn, tunnelIP, tunnelPort, clientDialOptions...)
if sriovConfig == nil {
return vppForwarder
}
Expand Down
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ func main() {
spiffejwt.TokenGeneratorFunc(source, cfg.MaxTokenLifetime),
vppConn,
vppinit.Must(cfg.VppInit.Execute(ctx, vppConn, cfg.TunnelIP)),
cfg.VxlanPort,
pciPool,
resourcePool,
sriovConfig,
Expand Down

0 comments on commit 12e0a0a

Please sign in to comment.