New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auth use signalmap #25284
Auth use signalmap #25284
Conversation
1645664
to
90d5e49
Compare
90d5e49
to
1b1d397
Compare
1b1d397
to
a4e65b5
Compare
Commit a4e65b5e26948f65e5c887e4e5ec58face823bbb does not contain "Signed-off-by". Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin |
a4e65b5
to
b1b563d
Compare
b1b563d
to
22ef3c6
Compare
/test-1.26-net-next |
|
||
var ( | ||
log = logging.DefaultLogger.WithField(logfields.LogSubsys, "signalmap") | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will drop this log
in favour of logrus.FieldLogger
provided by Hive in a forthcoming update.
/test-1.26-net-next |
net-next did not trigger, tried again. |
/test-1.26-net-next |
1 similar comment
/test-1.26-net-next |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, just some non-blocking nits. 💯
const ( | ||
// SignalProtoV4 denotes IPv4 protocol | ||
SignalProtoV4 SignalData = iota | ||
// SignalProtoV6 denotes IPv6 protocol | ||
SignalProtoV6 | ||
SignalProtoMax | ||
) | ||
|
||
var signalProto = [SignalProtoMax]string{ | ||
SignalProtoV4: "ipv4", | ||
SignalProtoV6: "ipv6", | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: we can get rid of the SignalProtoMax
constant by letting the compiler calculate the size of the signalProto
array with
var signalProto = [...]string{
SignalProtoV4: "ipv4",
SignalProtoV6: "ipv6",
}
if ch == nil { | ||
return "", ErrNilChannel | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to move this out of the returned func, since ch
is not gonna change after the call to ChannelHandler
. Doing that we can also avoid generating a func that always returns "", ErrNilChannel
.
|
||
func newManager(params authManagerParams) (Manager, error) { | ||
mgr, err := newAuthManager(params.AuthHandlers, params.DatapathAuthenticator, params.IPCache) | ||
func newManager(params authManagerParams) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: we usually call functions to be invoked as registerX
, leaving newX
for the ones that provide API to the hive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ipsec changes lgtm 👍
Add GetNodeIP(nodeID uint16) that returns the node IP for which the given nodeID was allocated for. This will be used for authentication handshake in later commits. Check for 0 (== local node) explicitly and return local node address from pkg/node in that case, as local node IPs are not in the maps. Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
Maximum nunber of entries in both eventsmap and signalmap is the number of possible CPUs, which never changes, is a low number, and is not adding any real information to the status report. Remove them to reduce direct dependencies to these maps. Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
Move definition of the signal data to the signal handlers to limit go dependencies. Signal delivery channel is now buffered so that signal manager will not get blocked by any one of the signal handlers. Pause/Unpause is generalized so that the perf events are paused only when all the signals have been paused. Current implementation uses bit mask (64 bits) which limits the max number of signals to 64. Signal registration is to be done only from init or cell OnStart functions, so that no locking is needed for managing signal handlers. Mute/Unmute calls can happen concurrently. Manage dependencies via Hive/Cell. Add a fake signalmap so that controlplane tests may depend on it. Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
Use signalmap instead of monitor events to notify userspace of missing authentication. Execute authentications concurrently and check for pending or completed authentications before starting a new one with the same key. Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
050d639
to
b4d31dc
Compare
Rebased to resolve conflict |
/ci-e2e |
/ci-l4lb |
/ci-multicluster |
/ci-awscni |
/ci-eks |
/ci-verifier |
/ci-external-workloads |
[ upstream commit 8294624 ] [ backporter notes: conflicts due to moved files, #25284 not yet backported, hence no GetNodeIP() to move.] The NodeHandler interface is too large, as can be seen in various implementations which are only implementing a subset of methods. This patch splits off the NodeID handling part, and removes the stub methods from noop implementations. Signed-off-by: David Bimmler <david.bimmler@isovalent.com>
[ upstream commit 8294624 ] [ backporter notes: conflicts due to moved files, #25284 not yet backported, hence no GetNodeIP() to move.] The NodeHandler interface is too large, as can be seen in various implementations which are only implementing a subset of methods. This patch splits off the NodeID handling part, and removes the stub methods from noop implementations. Signed-off-by: David Bimmler <david.bimmler@isovalent.com>
cilium/cilium has ignored MACRO_ARG_REUSE since cilium/cilium#25284, update the default ignores so that this does not need to be explicitly added in cilium/cilium any more. Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
[ upstream commit 8294624 ] [ backporter notes: conflicts due to moved files, #25284 not yet backported, hence no GetNodeIP() to move.] The NodeHandler interface is too large, as can be seen in various implementations which are only implementing a subset of methods. This patch splits off the NodeID handling part, and removes the stub methods from noop implementations. Signed-off-by: David Bimmler <david.bimmler@isovalent.com> Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
Agent implementation of
pkg/signalmap
is generalized from a single target (conntrack GC) to allow for multiple targets. This is then used for passing policy notifications for required authentication from datapath to the agent instead of using the monitor perf ring buffer. This should reduce CPU overhead when monitoring is otherwise not used.