-
Notifications
You must be signed in to change notification settings - Fork 5.5k
udp: support forwarding packets between workers #13086
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
Changes from 4 commits
7fe3b1d
f7f0899
da80953
4c85ce4
e4a1d6b
decfdd0
5ef79ae
3c1485a
b1f030e
b3588c3
3641fd2
8ad53b6
21a86f0
d863caf
2380204
e410196
04e72b3
1b7aa1d
1ef9c69
659897e
d812e3c
9c3f054
61ff426
970dd33
dfb32b4
a0ec03e
f83f8d5
f62d7b8
419db25
cc1630a
8037892
f22abc2
adffbb1
e5d6ce0
c6d2d99
e7e1f14
c012882
1d57d02
e2437b4
0faba2e
f8d27af
efc73e0
155459d
fc4ba9d
5bf2394
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,6 +52,13 @@ class ConnectionHandler { | |
| */ | ||
| virtual void removeListeners(uint64_t listener_tag) PURE; | ||
|
|
||
| /** | ||
| * Get the ``UdpListenerCallbacks`` associated with ``listener_tag``. This will be | ||
| * nullptr for non-UDP listeners and for ``listener_tag`` values that have already been | ||
| * removed. | ||
| */ | ||
| virtual UdpListenerCallbacks* getUdpListenerCallbacks(uint64_t listener_tag) PURE; | ||
|
ggreenway marked this conversation as resolved.
Outdated
|
||
|
|
||
| /** | ||
| * Remove the filter chains and the connections in the listener. All connections owned | ||
| * by the filter chains will be closed. Once all the connections are destroyed(connections | ||
|
|
@@ -147,8 +154,8 @@ class ActiveUdpListenerFactory { | |
| * @return the ActiveUdpListener created. | ||
| */ | ||
| virtual ConnectionHandler::ActiveListenerPtr | ||
| createActiveUdpListener(ConnectionHandler& parent, Event::Dispatcher& disptacher, | ||
| Network::ListenerConfig& config) PURE; | ||
| createActiveUdpListener(uint32_t worker_id, ConnectionHandler& parent, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: worker_index, here and anywhere else we still have id. Also needs doc comment update. |
||
| Event::Dispatcher& dispatcher, Network::ListenerConfig& config) PURE; | ||
|
|
||
| /** | ||
| * @return true if the UDP passing through listener doesn't form stateful connections. | ||
|
|
@@ -159,4 +166,4 @@ class ActiveUdpListenerFactory { | |
| using ActiveUdpListenerFactoryPtr = std::unique_ptr<ActiveUdpListenerFactory>; | ||
|
|
||
| } // namespace Network | ||
| } // namespace Envoy | ||
| } // namespace Envoy | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,5 +61,18 @@ class UdpListenerImpl : public BaseListenerImpl, | |
| Event::FileEventPtr file_event_; | ||
| }; | ||
|
|
||
| class UdpListenerWorkerRouterImpl : public UdpListenerWorkerRouter { | ||
| public: | ||
| UdpListenerWorkerRouterImpl(uint32_t concurrency); | ||
|
|
||
| void registerWorker(UdpListenerCallbacks& listener) override; | ||
| void unregisterWorker(UdpListenerCallbacks& listener) override; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nits: rename to (un)registerListenerAtWorker()
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I renamed to |
||
| void deliver(UdpListenerCallbacks& current, UdpRecvData&& data) override; | ||
|
|
||
| private: | ||
| absl::Mutex mutex_; | ||
| std::vector<UdpListenerCallbacks*> workers_ ABSL_GUARDED_BY(mutex_); | ||
|
mattklein123 marked this conversation as resolved.
|
||
| }; | ||
|
|
||
| } // namespace Network | ||
| } // namespace Envoy | ||
Uh oh!
There was an error while loading. Please reload this page.