Skip to content

Conversation

sustrik
Copy link
Contributor

@sustrik sustrik commented Aug 21, 2019

Ingress API is reduced to 1 function:

  • ingress.Init()

Egress API is reduced to 2 functions:

  • egress.Init()
  • egress.ReloadConfig()

This change is Reviewable

@sustrik sustrik changed the title Gress api2 SIG: Tighten the API between main and ingress/egress Aug 21, 2019
@sustrik sustrik requested a review from scrye August 21, 2019 07:41
@scrye scrye added refactor Change that focuses around reducing tech debt SIG labels Sep 2, 2019
Copy link
Contributor

@scrye scrye left a comment

Choose a reason for hiding this comment

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

Reviewed 6 of 6 files at r1.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @sustrik)


go/sig/egress/api.go, line 36 at r1 (raw file):

	fatal.Check()
	// Ringbuf for unused packets.
	iface.EgressFreePkts = ringbuf.New(iface.EgressFreePktsCap, func() interface{} {

Why not call iface.Init instead?


go/sig/egress/api.go, line 46 at r1 (raw file):

}

func ReloadConfig(cfg *config.Cfg) bool {

This is never called and can be removed.

Ingress API is reduced to 1 function:

* ingress.Init()

Egress API is reduced to 2 functions:

* egress.Init()
* egress.ReloadConfig()
Copy link
Contributor Author

@sustrik sustrik left a comment

Choose a reason for hiding this comment

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

Reviewable status: 2 of 6 files reviewed, 2 unresolved discussions (waiting on @scrye)


go/sig/egress/api.go, line 36 at r1 (raw file):

Previously, scrye (Sergiu Costea) wrote…

Why not call iface.Init instead?

Done.


go/sig/egress/api.go, line 46 at r1 (raw file):

Previously, scrye (Sergiu Costea) wrote…

This is never called and can be removed.

It's called from main.go:198

Copy link
Contributor

@scrye scrye left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 4 of 4 files at r2.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved


go/sig/egress/api.go, line 46 at r1 (raw file):

Previously, sustrik (Martin Sustrik) wrote…

It's called from main.go:198

It didn't use to be 😄

@sustrik sustrik merged commit 7ffd9af into scionproto:master Sep 3, 2019
@sustrik sustrik deleted the gress-api2 branch September 3, 2019 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Change that focuses around reducing tech debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants