Skip to content

Commit

Permalink
feat: Add L3XC support (#1602)
Browse files Browse the repository at this point in the history
* Add l3xc support (WIP)

Signed-off-by: Ondrej Fabry <[email protected]>

* Fix comments in proto files

Signed-off-by: Ondrej Fabry <[email protected]>

* Use full import path for descriptor-adapter's --import flag

Signed-off-by: Ondrej Fabry <[email protected]>

* Add proto for L3XC model and implement descriptor

Signed-off-by: Ondrej Fabry <[email protected]>

* Fix comment

Signed-off-by: Ondrej Fabry <[email protected]>

* Implement L3XC for all VPP versions

Signed-off-by: Ondrej Fabry <[email protected]>

* Skip L3XC integration tests for VPP<=19.04

Signed-off-by: Ondrej Fabry <[email protected]>

* Address review comments

Signed-off-by: Ondrej Fabry <[email protected]>
  • Loading branch information
ondrej-fabry authored Jan 20, 2020
1 parent c02ccfc commit ed274f1
Show file tree
Hide file tree
Showing 35 changed files with 3,778 additions and 89 deletions.
2 changes: 1 addition & 1 deletion plugins/kvscheduler/internal/graph/node_read.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (node *nodeR) GetLabel() string {
return node.label
}

// GetKey returns the value associated with the node.
// GetValue returns the value associated with the node.
func (node *nodeR) GetValue() proto.Message {
return node.value
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/netalloc/netalloc_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const (
// GWRefAllowed is used when it doesn't matter if reference points to interface
// address or GW address.
GWRefAllowed GwValidityCheck = iota
// GWRefAllowed is used when an IP address reference should point to GW address.
// GWRefRequired is used when an IP address reference should point to GW address.
GWRefRequired
// GwRefUnexpected is used when an IP address reference should not point to GW address.
GwRefUnexpected
Expand Down
6 changes: 3 additions & 3 deletions plugins/vpp/abfplugin/abfidx/abfidx.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ package abfidx
import (
"github.com/ligato/cn-infra/idxmap"
"github.com/ligato/cn-infra/logging"
abf "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/abf"

"go.ligato.io/vpp-agent/v3/pkg/idxvpp"
abf "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/abf"
)

// ABFMetadataIndex provides read-only access to mapping between ABF indexes (generated in the ABF plugin)
// and ABF names.
type ABFMetadataIndex interface {
// LookupIdx looks up previously stored item identified by index in the mapping.
// LookupByName looks up previously stored item identified by name in the mapping.
LookupByName(name string) (metadata *ABFMetadata, exists bool)

// LookupName looks up previously stored item identified by name in the mapping.
// LookupByIndex looks up previously stored item identified by index in the mapping.
LookupByIndex(idx uint32) (name string, metadata *ABFMetadata, exists bool)
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/vpp/abfplugin/abfplugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:generate descriptor-adapter --descriptor-name ABF --value-type *vpp_abf.ABF --meta-type *abfidx.ABFMetadata --import "abfidx" --import "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/abf" --output-dir "descriptor"
//go:generate descriptor-adapter --descriptor-name ABF --value-type *vpp_abf.ABF --meta-type *abfidx.ABFMetadata --import "go.ligato.io/vpp-agent/v3/plugins/vpp/abfplugin/abfidx" --import "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/abf" --output-dir "descriptor"

package abfplugin

Expand Down
15 changes: 15 additions & 0 deletions plugins/vpp/binapi/vpp1908/l3xc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/plugins/vpp/binapi/vpp1908/l3xc/l3xc.ba.go b/plugins/vpp/binapi/vpp1908/l3xc/l3xc.ba.go
index 3bdb5510a..191e53c00 100644
--- a/plugins/vpp/binapi/vpp1908/l3xc/l3xc.ba.go
+++ b/plugins/vpp/binapi/vpp1908/l3xc/l3xc.ba.go
@@ -458,8 +458,8 @@ type FibPath struct {
Flags FibPathFlagsf
Proto FibPathNhProto
Nh FibPathNh
- NLabels uint8
- LabelStack []FibMplsLabel `struc:"[16]FibMplsLabel"`
+ NLabels uint8 `struc:"sizeof=LabelStack"` // MANUALLY FIXED, see https://jira.fd.io/browse/VPP-1261
+ LabelStack []FibMplsLabel
}

func (*FibPath) GetTypeName() string {
Loading

0 comments on commit ed274f1

Please sign in to comment.