This is an automated email from the ASF dual-hosted git repository.
mochen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 0704455388 Fix build for io_uring (#12242)
0704455388 is described below
commit 0704455388b3a25366c5ac8212f60b9a1a5e7c6a
Author: Mo Chen <[email protected]>
AuthorDate: Mon May 19 20:54:10 2025 -0500
Fix build for io_uring (#12242)
---
src/iocore/aio/AIO.cc | 10 +++++-----
src/iocore/aio/test_AIO.cc | 9 +++++----
src/traffic_server/traffic_server.cc | 10 +++++-----
3 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/src/iocore/aio/AIO.cc b/src/iocore/aio/AIO.cc
index 3708ed3706..0f69f51d3e 100644
--- a/src/iocore/aio/AIO.cc
+++ b/src/iocore/aio/AIO.cc
@@ -200,17 +200,17 @@ ink_aio_init(ts::ModuleVersion v, [[maybe_unused]]
AIOBackend backend)
// If the caller specified auto backend, check for config to force a backend
if (backend == AIOBackend::AIO_BACKEND_AUTO) {
auto aio_mode{RecGetRecordStringAlloc("proxy.config.aio.mode")};
- if (aio_mode && !aio_mode.empty()) {
- if (strcasecmp(aio_mode, "auto") == 0) {
+ if (aio_mode && !aio_mode->empty()) {
+ if (strcasecmp(*aio_mode, "auto") == 0) {
backend = AIOBackend::AIO_BACKEND_AUTO;
- } else if (strcasecmp(aio_mode, "thread") == 0) {
+ } else if (strcasecmp(*aio_mode, "thread") == 0) {
// force thread mode
backend = AIOBackend::AIO_BACKEND_THREAD;
- } else if (strcasecmp(aio_mode, "io_uring") == 0) {
+ } else if (strcasecmp(*aio_mode, "io_uring") == 0) {
// force io_uring mode
backend = AIOBackend::AIO_BACKEND_IO_URING;
} else {
- Warning("Invalid value '%s' for proxy.config.aio.mode.
autodetecting", aio_mode.c_str());
+ Warning("Invalid value '%s' for proxy.config.aio.mode.
autodetecting", aio_mode->c_str());
}
}
}
diff --git a/src/iocore/aio/test_AIO.cc b/src/iocore/aio/test_AIO.cc
index 79a1e9c8aa..45f1b65a48 100644
--- a/src/iocore/aio/test_AIO.cc
+++ b/src/iocore/aio/test_AIO.cc
@@ -23,6 +23,7 @@
#include "iocore/aio/AIO.h"
#include "iocore/eventsystem/EventSystem.h"
+#include "iocore/net/Net.h"
#include "tscore/ink_atomic.h"
#include "tscore/ink_hw.h"
#include "tscore/Layout.h"
@@ -221,11 +222,11 @@ dump_summary()
printf("IO_URING results\n");
printf("-----------------\n");
- auto completed =
Metrics::Counter::lookup("proxy.process.io_uring.completed", nullptr);
- auto submitted =
Metrics::Counter::lookup("proxy.process.io_uring.submitted", nullptr);
+ auto completed =
ts::Metrics::Counter::lookup("proxy.process.io_uring.completed", nullptr);
+ auto submitted =
ts::Metrics::Counter::lookup("proxy.process.io_uring.submitted", nullptr);
- printf("submissions: %lu\n", Metrics::Counter::load(submitted));
- printf("completions: %lu\n", Metrics::Counter::load(completed));
+ printf("submissions: %lu\n", ts::Metrics::Counter::load(submitted));
+ printf("completions: %lu\n", ts::Metrics::Counter::load(completed));
#endif
if (delete_disks) {
diff --git a/src/traffic_server/traffic_server.cc
b/src/traffic_server/traffic_server.cc
index 02ae8ba44f..c7133ca6b8 100644
--- a/src/traffic_server/traffic_server.cc
+++ b/src/traffic_server/traffic_server.cc
@@ -1750,11 +1750,11 @@ configure_io_uring()
RecInt aio_io_uring_wq_bounded = cfg.wq_bounded;
RecInt aio_io_uring_wq_unbounded = cfg.wq_unbounded;
- RecGetRecordInteger("proxy.config.io_uring.entries",
&aio_io_uring_queue_entries);
- RecGetRecordInteger("proxy.config.io_uring.sq_poll_ms",
&aio_io_uring_sq_poll_ms);
- RecGetRecordInteger("proxy.config.io_uring.attach_wq",
&aio_io_uring_attach_wq);
- RecGetRecordInteger("proxy.config.io_uring.wq_workers_bounded",
&aio_io_uring_wq_bounded);
- RecGetRecordInteger("proxy.config.io_uring.wq_workers_unbounded",
&aio_io_uring_wq_unbounded);
+ aio_io_uring_queue_entries =
RecGetRecordInt("proxy.config.io_uring.entries").value_or(0);
+ aio_io_uring_sq_poll_ms =
RecGetRecordInt("proxy.config.io_uring.sq_poll_ms").value_or(0);
+ aio_io_uring_attach_wq =
RecGetRecordInt("proxy.config.io_uring.attach_wq").value_or(0);
+ aio_io_uring_wq_bounded =
RecGetRecordInt("proxy.config.io_uring.wq_workers_bounded").value_or(0);
+ aio_io_uring_wq_unbounded =
RecGetRecordInt("proxy.config.io_uring.wq_workers_unbounded").value_or(0);
cfg.queue_entries = aio_io_uring_queue_entries;
cfg.sq_poll_ms = aio_io_uring_sq_poll_ms;