Skip to content

Add support for AddIPv4Entry and DeleteIPv4Entry#18

Merged
robshakir merged 3 commits intomainfrom
rib1
Jun 10, 2021
Merged

Add support for AddIPv4Entry and DeleteIPv4Entry#18
robshakir merged 3 commits intomainfrom
rib1

Conversation

@robshakir
Copy link
Copy Markdown
Member

commit 74a88d6358c178f19181b14e38c67299c3c14f47
Author: Rob Shakir <robjs@google.com>
Date:   Tue Jun 8 18:57:02 2021 -0700

    Add support for different network instances in the RIB.
    
      * (M) go.mod
      * (M) go.sum
        -  Tidy up modules.
      * (M) rib/rib.go
      * (M) rib/rib_test.go
        -  Add support for network instances in the RIB rather than
           a single RIB.

commit c9606fd887624cea58cda5c927cf4841b3ec12db
Author: Rob Shakir <robjs@google.com>
Date:   Tue Jun 8 14:49:35 2021 -0700

    Add initial RIB management.
    
      * (M) aft/oc.go
      * (M) aft/update.sh
        - Update generated code.
      * (M) go.mod
      * (M) go.sum
        - Go mod tidying.
      * (M) rib/rib.go
      * (M) rib/rib_test.go
        - Add IPv4 entry add and delete.

robshakir added 2 commits June 8, 2021 14:49
  * (M) aft/oc.go
  * (M) aft/update.sh
    - Update generated code.
  * (M) go.mod
  * (M) go.sum
    - Go mod tidying.
  * (M) rib/rib.go
  * (M) rib/rib_test.go
    - Add IPv4 entry add and delete.
  * (M) go.mod
  * (M) go.sum
    -  Tidy up modules.
  * (M) rib/rib.go
  * (M) rib/rib_test.go
    -  Add support for network instances in the RIB rather than
       a single RIB.
@robshakir robshakir requested a review from sthesayi June 9, 2021 01:59
Copy link
Copy Markdown
Contributor

@sthesayi sthesayi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just minor comments, so approving.

}

// ribHolder is a container for a set of RIBs.
type ribHolder struct {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for my understanding... will this eventually become an array of RIBs? I would have thought a network instance will have exactly one RIB table. If so then is ribHolder struct necessary?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are two reasons to have ribHolder exist:

  1. There are likely to be some things that the ygot structs don't have in them that we need, for example, mutexes around the different maps that make up the RIB. We probably need to put these somewhere - either by changing the generated code to include them (not that easy to do today), or by putting them outside of the generated datastructure. I'd propose that they go here.

  2. I'd like the option to be able to have per-protocol RIBs at some point in the future - today this RIB is really the gRIBI RIB - but one thing that I have in mind is maybe we can create an "on-box protocol" RIB alongside this gRIBI one. The reason we would do is that if we're doing replay of routes from another source (e.g., by capturing updates from our BGP daemon in the controller), then we could replay them into the device using gRIBI as the API to do so - in this case, there might be >1 set of RIBs per NI.

// AddIPv4 adds the IPv4 entry described by e to the RIB. It returns an error
// if the entry cannot be added.
func (r *ribHolder) AddIPv4(e *aftpb.Afts_Ipv4EntryKey) error {
// This is a hack, since ygot does not know that the field that we
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we check e != nil ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM, added. Thanks.

@robshakir robshakir merged commit 4a350b0 into main Jun 10, 2021
@robshakir robshakir deleted the rib1 branch June 10, 2021 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants