Skip to content

Commit

Permalink
Update chain elements in cmd-forwarder-vpp (#1036)
Browse files Browse the repository at this point in the history
* Update chain elements in cmd-forwarder-vpp

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

* fix linter issues

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

---------

Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>
  • Loading branch information
NikitaSkrynnik authored Jan 17, 2024
1 parent eb6f511 commit 14c21a2
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require (
github.com/networkservicemesh/sdk-k8s v0.0.0-20240111114041-996d3021ed14
github.com/networkservicemesh/sdk-kernel v1.11.2
github.com/networkservicemesh/sdk-sriov v0.0.0-20240116093619-dfb213a67f2b
github.com/networkservicemesh/sdk-vpp v1.11.2
github.com/networkservicemesh/sdk-vpp v0.0.0-20240116093629-ba25c4516e9d
github.com/networkservicemesh/vpphelper v0.0.0-20240115135903-e2b961f768b6
github.com/pkg/errors v0.9.1
github.com/safchain/ethtool v0.3.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ github.com/networkservicemesh/sdk-kernel v1.11.2 h1:txgWevJoaBInZC5cYGZVSpltoBrd
github.com/networkservicemesh/sdk-kernel v1.11.2/go.mod h1:a1AP3RteVHTQ/+/wSDrzsiEkWecveL8BJBrHMYUozbo=
github.com/networkservicemesh/sdk-sriov v0.0.0-20240116093619-dfb213a67f2b h1:mf7DFY6IzRFTS9EhjTiyVB2DacMB7pswZ1sScE2UIpE=
github.com/networkservicemesh/sdk-sriov v0.0.0-20240116093619-dfb213a67f2b/go.mod h1:YxlSacji2lmmGHPX7iVotcUT8GZgd/jIIXLvj5h/x7A=
github.com/networkservicemesh/sdk-vpp v1.11.2 h1:/5NEQ1areHyNW+XyE4lXmxZ9km+6/uXDrgTB/rqMj6I=
github.com/networkservicemesh/sdk-vpp v1.11.2/go.mod h1:7HlvdwrNYaNeYdkTXFg3qYwK1ArgkjqGdDDs+0bV5fA=
github.com/networkservicemesh/sdk-vpp v0.0.0-20240116093629-ba25c4516e9d h1:Y9FZrcHP0M7ATVYOL39hIZRY8F/9VMFfeGrRNM80iC0=
github.com/networkservicemesh/sdk-vpp v0.0.0-20240116093629-ba25c4516e9d/go.mod h1:4DytlENum+hsz8/Deo+7mzXdjdPquy/N1UnuPiaclpA=
github.com/networkservicemesh/vpphelper v0.0.0-20240115135903-e2b961f768b6 h1:o+enN5yCikNXZN+hO+JjE+aLxBWq9+GMVF9GSQtpwMI=
github.com/networkservicemesh/vpphelper v0.0.0-20240115135903-e2b961f768b6/go.mod h1:n6+8PnoDvWj6WMryfU3J8HOCusgysFjQ0kGLfrcsDEM=
github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8=
Expand Down
2 changes: 1 addition & 1 deletion internal/imports/imports_linux.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions internal/xconnectns/options.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2022 Cisco and/or its affiliates.
// Copyright (c) 2022-2024 Cisco and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down Expand Up @@ -26,7 +26,7 @@ import (

"github.com/networkservicemesh/api/pkg/api/networkservice"
"github.com/networkservicemesh/sdk-vpp/pkg/networkservice/mechanisms/vxlan"
"github.com/networkservicemesh/sdk-vpp/pkg/networkservice/stats"
"github.com/networkservicemesh/sdk-vpp/pkg/networkservice/metrics"
"github.com/networkservicemesh/sdk/pkg/networkservice/common/cleanup"
)

Expand All @@ -38,7 +38,7 @@ type xconnOptions struct {
dialTimeout time.Duration
domain2Device map[string]string
mechanismPrioriyList []string
statsOpts []stats.Option
metricsOpts []metrics.Option
cleanupOpts []cleanup.Option
vxlanOpts []vxlan.Option
dialOpts []grpc.DialOption
Expand Down Expand Up @@ -95,10 +95,10 @@ func WithVlanDomain2Device(domain2Device map[string]string) Option {
}
}

// WithStatsOptions sets stats options
func WithStatsOptions(opts ...stats.Option) Option {
// WithMetricsOptions sets metrics options
func WithMetricsOptions(opts ...metrics.Option) Option {
return func(o *xconnOptions) {
o.statsOpts = opts
o.metricsOpts = opts
}
}

Expand Down
4 changes: 2 additions & 2 deletions internal/xconnectns/server.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) 2021-2022 Doc.ai and/or its affiliates.
//
// Copyright (c) 2022 Cisco and/or its affiliates.
// Copyright (c) 2022-2024 Cisco and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down Expand Up @@ -82,7 +82,7 @@ func NewServer(
vppforwarder.WithVlanDomain2Device(xconnOpts.domain2Device),
vppforwarder.WithMechanismPriority(xconnOpts.mechanismPrioriyList),
vppforwarder.WithCleanupOptions(xconnOpts.cleanupOpts...),
vppforwarder.WithStatsOptions(xconnOpts.statsOpts...),
vppforwarder.WithStatsOptions(xconnOpts.metricsOpts...),
vppforwarder.WithVxlanOptions(xconnOpts.vxlanOpts...),
vppforwarder.WithDialOptions(xconnOpts.dialOpts...))
if sriovConfig == nil {
Expand Down
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2023 Cisco and/or its affiliates.
// Copyright (c) 2020-2024 Cisco and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down Expand Up @@ -64,7 +64,7 @@ import (
"github.com/networkservicemesh/sdk/pkg/tools/tracing"

"github.com/networkservicemesh/sdk-vpp/pkg/networkservice/mechanisms/vxlan"
"github.com/networkservicemesh/sdk-vpp/pkg/networkservice/stats"
"github.com/networkservicemesh/sdk-vpp/pkg/networkservice/metrics"

"github.com/networkservicemesh/cmd-forwarder-vpp/internal/config"
"github.com/networkservicemesh/cmd-forwarder-vpp/internal/devicecfg"
Expand Down Expand Up @@ -156,7 +156,7 @@ func main() {

var vppConn vpphelper.Connection
var vppErrCh <-chan error
var statsOpts []stats.Option
var metricsOpts []metrics.Option
cleanupDoneCh := make(chan struct{})
cleanupOpts := []cleanup.Option{
cleanup.WithoutGRPCCall(),
Expand All @@ -168,7 +168,7 @@ func main() {
close(errCh)
vppErrCh = errCh
dir, _ := path.Split(cfg.VppAPISocket)
statsOpts = append(statsOpts, stats.WithSocket(path.Join(dir, "stats.sock")))
metricsOpts = append(metricsOpts, metrics.WithSocket(path.Join(dir, "stats.sock")))
cleanupOpts = append(cleanupOpts, cleanup.WithDoneChan(cleanupDoneCh))
log.FromContext(ctx).Info("external vpp is being used")

Expand Down Expand Up @@ -255,7 +255,7 @@ func main() {
xconnectns.WithMechanismPriority(cfg.MechanismPriority),
xconnectns.WithClientURL(&cfg.ConnectTo),
xconnectns.WithDialTimeout(cfg.DialTimeout),
xconnectns.WithStatsOptions(statsOpts...),
xconnectns.WithMetricsOptions(metricsOpts...),
xconnectns.WithCleanupOptions(cleanupOpts...),
xconnectns.WithVxlanOptions(vxlan.WithPort(cfg.VxlanPort)),
xconnectns.WithDialOptions(dialOptions...),
Expand Down

0 comments on commit 14c21a2

Please sign in to comment.