Skip to content

Commit

Permalink
Release 2.5.0 (#1574)
Browse files Browse the repository at this point in the history
Release 2.5.0
  • Loading branch information
ondrej-fabry committed Nov 29, 2019
2 parents d0a642b + b76cbed commit 8a416f4
Show file tree
Hide file tree
Showing 30 changed files with 1,161 additions and 596 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

## Release Notes

- [v2.5.0](#v2.5.0)
- [v2.4.0](#v2.4.0)
- [v2.3.0](#v2.3.0)
- [v2.2.0](#v2.2.0)
Expand Down Expand Up @@ -47,6 +48,21 @@ RELEASE CHANGELOG TEMPLATE:
### Documentation
-->

<a name="v2.5.0"></a>
# [2.5.0](https://github.com/ligato/vpp-agent/compare/v2.4.0...v2.5.0) (2019-11-29)
- **VPP 20.01-379** (`20.01-rc0~379-ga6b93eac5`)
- **VPP 20.01-324** (`20.01-rc0~324-g66a332cf1`)
- **VPP 19.08.1** (default)
- **VPP 19.04** (backward compatible)
- cn-infra v2.2

### New Features
* SRv6 global config (encap source address)
* Support for Linux configuration dumping

### Bug Fixes
* Update GoVPP with fix for stats conversion panic

<a name="v2.4.0"></a>
# [2.4.0](https://github.com/ligato/vpp-agent/compare/v2.3.0...v2.4.0) (2019-10-21)
- **VPP 20.01-379** (`20.01-rc0~379-ga6b93eac5`)
Expand Down
74 changes: 57 additions & 17 deletions plugins/configurator/dump.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
// Copyright (c) 2019 Cisco and/or its affiliates.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package configurator

import (
"errors"

linux_interfaces "github.com/ligato/vpp-agent/api/models/linux/interfaces"
linux_l3 "github.com/ligato/vpp-agent/api/models/linux/l3"

"github.com/ligato/cn-infra/logging"
"golang.org/x/net/context"

Expand Down Expand Up @@ -132,8 +149,23 @@ func (svc *dumpService) Dump(context.Context, *rpc.DumpRequest) (*rpc.DumpRespon
return nil, err
}

// FIXME: linux interfaces should return known proto instead of netlink
// state.LinuxData.Interfaces, _ = svc.DumpLinuxInterfaces()
dump.LinuxConfig.Interfaces, err = svc.DumpLinuxInterfaces()
if err != nil {
svc.log.Errorf("DumpLinuxInterfaces failed: %v", err)
return nil, err
}

dump.LinuxConfig.ArpEntries, err = svc.DumpLinuxARPs()
if err != nil {
svc.log.Errorf("DumpLinuxARPs failed: %v", err)
return nil, err
}

dump.LinuxConfig.Routes, err = svc.DumpLinuxRoutes()
if err != nil {
svc.log.Errorf("DumpLinuxRoutes failed: %v", err)
return nil, err
}

return &rpc.DumpResponse{Dump: dump}, nil
}
Expand Down Expand Up @@ -388,38 +420,47 @@ func (svc *dumpService) DumpPuntExceptions() (punts []*vpp_punt.Exception, err e

// DumpLinuxInterfaces reads linux interfaces and returns them as an *LinuxInterfaceResponse. If reading ends up with error,
// only error is send back in response
/*func (svc *dumpService) DumpLinuxInterfaces() ([]*linux_interfaces.Interface, error) {
var linuxIfs []*linux_interfaces.Interface
ifDetails, err := svc.linuxIfHandler.GetLinkList()
func (svc *dumpService) DumpLinuxInterfaces() (linuxIfs []*linux_interfaces.Interface, err error) {
if svc.linuxIfHandler == nil {
return nil, errors.New("linuxIfHandler is not available")
}

ifDetails, err := svc.linuxIfHandler.DumpInterfaces()
if err != nil {
return nil, err
}
for _, iface := range ifDetails {
linuxIfs = append(linuxIfs, )
for _, ifDetail := range ifDetails {
linuxIfs = append(linuxIfs, ifDetail.Interface)
}

return linuxIfs, nil
}

// DumpLinuxARPs reads linux ARPs and returns them as an *LinuxARPsResponse. If reading ends up with error,
// only error is send back in response
func (svc *dumpService) DumpLinuxARPs(ctx context.Context, request *rpc.DumpRequest) (*rpc.LinuxARPsResponse, error) {
var linuxArps []*linuxL3.LinuxStaticArpEntries_ArpEntry
arpDetails, err := svc.linuxL3Handler.DumpArpEntries()
func (svc *dumpService) DumpLinuxARPs() (linuxARPs []*linux_l3.ARPEntry, err error) {
if svc.linuxL3Handler == nil {
return nil, errors.New("linuxL3Handler is not available")
}

arpDetails, err := svc.linuxL3Handler.DumpARPEntries()
if err != nil {
return nil, err
}
for _, arp := range arpDetails {
linuxArps = append(linuxArps, arp.Arp)
for _, arpDetail := range arpDetails {
linuxARPs = append(linuxARPs, arpDetail.ARP)
}

return &rpc.LinuxARPsResponse{LinuxArpEntries: linuxArps}, nil
return linuxARPs, nil
}

// DumpLinuxRoutes reads linux routes and returns them as an *LinuxRoutesResponse. If reading ends up with error,
// only error is send back in response
func (svc *dumpService) DumpLinuxRoutes(ctx context.Context, request *rpc.DumpRequest) (*rpc.LinuxRoutesResponse, error) {
var linuxRoutes []*linuxL3.LinuxStaticRoutes_Route
func (svc *dumpService) DumpLinuxRoutes() (linuxRoutes []*linux_l3.Route, err error) {
if svc.linuxL3Handler == nil {
return nil, errors.New("linuxL3Handler is not available")
}

rtDetails, err := svc.linuxL3Handler.DumpRoutes()
if err != nil {
return nil, err
Expand All @@ -428,6 +469,5 @@ func (svc *dumpService) DumpLinuxRoutes(ctx context.Context, request *rpc.DumpRe
linuxRoutes = append(linuxRoutes, rt.Route)
}

return &rpc.LinuxRoutesResponse{LinuxRoutes: linuxRoutes}, nil
return linuxRoutes, nil
}
*/
7 changes: 7 additions & 0 deletions plugins/configurator/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ package configurator

import (
"github.com/ligato/cn-infra/rpc/grpc"
"github.com/ligato/cn-infra/servicelabel"

"github.com/ligato/vpp-agent/plugins/govppmux"
linuxifplugin "github.com/ligato/vpp-agent/plugins/linux/ifplugin"
"github.com/ligato/vpp-agent/plugins/linux/nsplugin"
"github.com/ligato/vpp-agent/plugins/netalloc"
"github.com/ligato/vpp-agent/plugins/orchestrator"
"github.com/ligato/vpp-agent/plugins/vpp/aclplugin"
Expand All @@ -36,11 +40,14 @@ func NewPlugin(opts ...Option) *Plugin {
p.GRPCServer = &grpc.DefaultPlugin
p.Dispatch = &orchestrator.DefaultPlugin
p.GoVppmux = &govppmux.DefaultPlugin
p.ServiceLabel = &servicelabel.DefaultPlugin
p.AddrAlloc = &netalloc.DefaultPlugin
p.VPPACLPlugin = &aclplugin.DefaultPlugin
p.VPPIfPlugin = &ifplugin.DefaultPlugin
p.VPPL2Plugin = &l2plugin.DefaultPlugin
p.VPPL3Plugin = &l3plugin.DefaultPlugin
p.LinuxIfPlugin = &linuxifplugin.DefaultPlugin
p.NsPlugin = &nsplugin.DefaultPlugin

for _, o := range opts {
o(p)
Expand Down
51 changes: 33 additions & 18 deletions plugins/configurator/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@ import (

"github.com/ligato/cn-infra/infra"
"github.com/ligato/cn-infra/rpc/grpc"
"github.com/ligato/cn-infra/servicelabel"
"github.com/ligato/cn-infra/utils/safeclose"

rpc "github.com/ligato/vpp-agent/api/configurator"
"github.com/ligato/vpp-agent/api/models/vpp"
"github.com/ligato/vpp-agent/plugins/govppmux"
iflinuxplugin "github.com/ligato/vpp-agent/plugins/linux/ifplugin"
iflinuxcalls "github.com/ligato/vpp-agent/plugins/linux/ifplugin/linuxcalls"
l3linuxcalls "github.com/ligato/vpp-agent/plugins/linux/l3plugin/linuxcalls"
"github.com/ligato/vpp-agent/plugins/linux/nsplugin"
"github.com/ligato/vpp-agent/plugins/netalloc"
"github.com/ligato/vpp-agent/plugins/orchestrator"
abfvppcalls "github.com/ligato/vpp-agent/plugins/vpp/abfplugin/vppcalls"
Expand All @@ -42,6 +45,9 @@ import (
puntvppcalls "github.com/ligato/vpp-agent/plugins/vpp/puntplugin/vppcalls"
)

// Default Go routine count for linux configuration retrieval
const defaultGoRoutineCount = 10

// Plugin registers VPP GRPC services in *grpc.Server.
type Plugin struct {
Deps
Expand All @@ -55,14 +61,17 @@ type Plugin struct {
// Deps - dependencies of Plugin
type Deps struct {
infra.PluginDeps
GRPCServer grpc.Server
Dispatch orchestrator.Dispatcher
GoVppmux govppmux.StatsAPI
AddrAlloc netalloc.AddressAllocator
VPPACLPlugin aclplugin.API
VPPIfPlugin ifplugin.API
VPPL2Plugin *l2plugin.L2Plugin
VPPL3Plugin l3plugin.API
GRPCServer grpc.Server
Dispatch orchestrator.Dispatcher
GoVppmux govppmux.StatsAPI
ServiceLabel servicelabel.ReaderAPI
AddrAlloc netalloc.AddressAllocator
VPPACLPlugin aclplugin.API
VPPIfPlugin ifplugin.API
VPPL2Plugin *l2plugin.L2Plugin
VPPL3Plugin l3plugin.API
LinuxIfPlugin iflinuxplugin.API
NsPlugin nsplugin.API
}

// Init sets plugin child loggers
Expand All @@ -82,18 +91,20 @@ func (p *Plugin) Init() error {
}

if p.VPPIfPlugin != nil {
p.VPPIfPlugin.SetNotifyService(func(vppNotification *vpp.Notification) {
p.configurator.notifyService.pushNotification(&rpc.Notification{
Notification: &rpc.Notification_VppNotification{
VppNotification: vppNotification,
},
})
})
p.VPPIfPlugin.SetNotifyService(p.sendVppNotification)
}

return nil
}

func (p *Plugin) sendVppNotification(vppNotification *vpp.Notification) {
p.configurator.notifyService.pushNotification(&rpc.Notification{
Notification: &rpc.Notification_VppNotification{
VppNotification: vppNotification,
},
})
}

// Close does nothing.
func (p *Plugin) Close() error {
return safeclose.Close(p.vppChan)
Expand All @@ -113,6 +124,9 @@ func (p *Plugin) initHandlers() (err error) {
aclIndexes := p.VPPACLPlugin.GetACLIndex() // TODO: make ACL optional
vrfIndexes := p.VPPL3Plugin.GetVRFIndex()

// Linux Indexes
linuxIfIndexes := p.LinuxIfPlugin.GetInterfaceIndex()

// VPP handlers

// core
Expand Down Expand Up @@ -151,9 +165,10 @@ func (p *Plugin) initHandlers() (err error) {
p.Log.Info("VPP Punt handler is not available, it will be skipped")
}

// Linux indexes and handlers
p.configurator.linuxIfHandler = iflinuxcalls.NewNetLinkHandler()
p.configurator.linuxL3Handler = l3linuxcalls.NewNetLinkHandler()
// Linux handlers
p.configurator.linuxIfHandler = iflinuxcalls.NewNetLinkHandler(p.NsPlugin, linuxIfIndexes,
p.ServiceLabel.GetAgentPrefix(), defaultGoRoutineCount, p.Log)
p.configurator.linuxL3Handler = l3linuxcalls.NewNetLinkHandler(p.NsPlugin, linuxIfIndexes, defaultGoRoutineCount, p.Log)

return nil
}

0 comments on commit 8a416f4

Please sign in to comment.