Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ set(CMAKE_CXX_STANDARD
)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_SCAN_FOR_MODULES ON)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE -DATS_BUILD)
Expand Down
2 changes: 2 additions & 0 deletions include/iocore/eventsystem/EThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
#include "iocore/eventsystem/ProtectedQueue.h"
#include "tsutil/Histogram.h"

import tscore;

#if TS_USE_HWLOC
struct hwloc_obj;
using hwloc_obj_t = hwloc_obj *;
Expand Down
2 changes: 2 additions & 0 deletions include/iocore/eventsystem/Event.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

#include "iocore/eventsystem/Action.h"

import tscore;

//
// Defines
//
Expand Down
2 changes: 2 additions & 0 deletions include/iocore/eventsystem/EventProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include "iocore/eventsystem/Event.h"
#include <atomic>

import tscore;

#ifdef TS_MAX_THREADS_IN_EACH_THREAD_TYPE
constexpr int MAX_THREADS_IN_EACH_TYPE = TS_MAX_THREADS_IN_EACH_THREAD_TYPE;
#else
Expand Down
2 changes: 2 additions & 0 deletions include/iocore/eventsystem/Freer.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "tscore/ink_platform.h"
#include "iocore/eventsystem/Tasks.h"

import tscore;

// Note that these should not be used for memory that wishes to retain
// NUMA socket affinity. We'll potentially return these on an arbitrarily
// selected processor/socket.
Expand Down
2 changes: 2 additions & 0 deletions include/iocore/eventsystem/Lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "tscore/Diags.h"
#include "iocore/eventsystem/Thread.h"

import tscore;

#define MAX_LOCK_TIME HRTIME_MSECONDS(200)
#define THREAD_MUTEX_THREAD_HOLDING (-1024 * 1024)

Expand Down
4 changes: 3 additions & 1 deletion include/iocore/eventsystem/PriorityEventQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "tscore/ink_platform.h"
#include "iocore/eventsystem/Event.h"

import tscore;

// <5ms, 10, 20, 40, 80, 160, 320, 640, 1280, 2560, 5120
#define N_PQ_LIST 10
#define PQ_BUCKET_TIME(_i) (HRTIME_MSECONDS(5) << (_i))
Expand Down Expand Up @@ -115,7 +117,7 @@ struct PriorityEventQueue {
return last_check_time + (PQ_BUCKET_TIME(i) / 2);
}
}
return last_check_time + HRTIME_FOREVER;
return last_check_time + HRTIME_FOREVERS(1);
}

PriorityEventQueue();
Expand Down
3 changes: 3 additions & 0 deletions include/iocore/eventsystem/ProtectedQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@

#include "tscore/ink_platform.h"
#include "iocore/eventsystem/Event.h"

import tscore;

struct ProtectedQueue {
void enqueue(Event *e);
void signal();
Expand Down
64 changes: 0 additions & 64 deletions include/iocore/io_uring/IO_URING.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,73 +24,9 @@ Linux io_uring helper library
#pragma once

#include <liburing.h>
#include <utility>
#include "tscore/ink_hrtime.h"

struct IOUringConfig {
int queue_entries = 32;
int sq_poll_ms = 0;
int attach_wq = 0;
int wq_bounded = 0;
int wq_unbounded = 0;
};

class IOUringCompletionHandler
{
public:
virtual void handle_complete(io_uring_cqe *) = 0;
};

class IOUringContext
{
public:
IOUringContext();
~IOUringContext();

IOUringContext(const IOUringContext &) = delete;

io_uring_sqe *
next_sqe(IOUringCompletionHandler *handler)
{
io_uring_sqe *result = io_uring_get_sqe(&ring);
if (result == nullptr) {
submit();
result = io_uring_get_sqe(&ring);
}
if (result != nullptr) {
io_uring_sqe_set_data(result, handler);
}
return result;
}

bool supports_op(int op) const;

int set_wq_max_workers(unsigned int bounded, unsigned int unbounded);
std::pair<int, int> get_wq_max_workers();

void submit();
void service();
void submit_and_wait(ink_hrtime ms);

int register_eventfd();

// assigns the global iouring config
static void set_config(const IOUringConfig &);
static IOUringContext *local_context();
static void set_main_queue(IOUringContext *);
static int get_main_queue_fd();

bool
valid()
{
return ring.ring_fd > 0;
}

private:
io_uring ring = {};
io_uring_probe *probe = nullptr;
int evfd = -1;

void handle_cqe(io_uring_cqe *);
static IOUringConfig config;
};
3 changes: 2 additions & 1 deletion include/iocore/net/NetTimeout.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@
#pragma once

#include "tscore/List.h"
#include "tscore/ink_hrtime.h"

#include "iocore/eventsystem/EventSystem.h"

import tscore;

/**
NetTimeout - handle active & inactive timeout
*/
Expand Down
3 changes: 2 additions & 1 deletion include/iocore/net/TLSBasicSupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@

#include <openssl/ssl.h>

#include "tscore/ink_hrtime.h"
#include "iocore/net/SSLTypes.h"

import tscore;

using TLSHandle = SSL *;

class TLSBasicSupport
Expand Down
3 changes: 2 additions & 1 deletion include/iocore/net/quic/QUICTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#pragma once

#include "iocore/net/NetVConnection.h"
#include "tscore/ink_hrtime.h"
#include "tscore/ink_inet.h"

#include <openssl/evp.h>
Expand All @@ -35,6 +34,8 @@
#include <string>
#include <unordered_map>

import tscore;

using QUICPacketNumber = uint64_t;
using QUICVersion = uint32_t;
using QUICStreamId = uint64_t;
Expand Down
4 changes: 2 additions & 2 deletions include/proxy/CacheControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ struct RequestData;

const int CC_UNSET_TIME = -1;

#define CACHE_CONTROL_TIMEOUT (HRTIME_HOUR * 1)
#define CACHE_CONTROL_TIMEOUT (HRTIME_HOURS(1))

// Use 10 second time for purify testing under low
// load to verify memory allocation
// #define CACHE_CONTROL_TIMEOUT (HRTIME_SECOND*10)
// #define CACHE_CONTROL_TIMEOUT (HRTIME_SECONDS(10))

enum class CacheControlType {
INVALID = 0,
Expand Down
3 changes: 2 additions & 1 deletion include/proxy/Milestones.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@
#pragma once

#include "ts/apidefs.h"
#include "tscore/ink_hrtime.h"

#include <array>

import tscore;

template <class T, size_t entries> class Milestones
{
public:
Expand Down
2 changes: 2 additions & 0 deletions include/proxy/PluginVC.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
#include "iocore/net/NetVConnection.h"
#include "tscore/ink_atomic.h"

import tscore;

class PluginVCCore;

struct PluginVCState {
Expand Down
2 changes: 2 additions & 0 deletions include/proxy/ProxySession.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include "proxy/IPAllow.h"
#include "tscore/SnowflakeID.h"

import tscore;

// Emit a debug message conditional on whether this particular client session
// has debugging enabled. This should only be called from within a client session
// member function.
Expand Down
2 changes: 2 additions & 0 deletions include/proxy/ProxyTransaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "proxy/ProxySession.h"
#include <string_view>

import tscore;

class HttpSM;

// Abstract Class for any transaction with-in the HttpSM
Expand Down
2 changes: 2 additions & 0 deletions include/proxy/http/HttpCacheSM.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
#include "proxy/hdrs/HTTP.h"
#include "proxy/http/HttpConfig.h"

import tscore;

class HttpSM;
class HttpCacheSM;

Expand Down
2 changes: 2 additions & 0 deletions include/proxy/http/HttpSM.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
#include "tscore/History.h"
#include "tscore/PendingAction.h"

import tscore;

#define HTTP_API_CONTINUE (INK_API_EVENT_EVENTS_START + 0)
#define HTTP_API_ERROR (INK_API_EVENT_EVENTS_START + 1)

Expand Down
2 changes: 2 additions & 0 deletions include/proxy/http/HttpTransact.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
#include <string>
#include <string_view>

import tscore;

#define HTTP_OUR_VIA_MAX_LENGTH 1024 // 512-bytes for hostname+via string, 512-bytes for the debug info

#define HTTP_RELEASE_ASSERT(X) ink_release_assert(X)
Expand Down
2 changes: 2 additions & 0 deletions include/proxy/http/HttpTunnel.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@

#include "iocore/eventsystem/EventSystem.h"

import tscore;

// Get rid of any previous definition first... /leif
#ifdef MAX_PRODUCERS
#undef MAX_PRODUCERS
Expand Down
3 changes: 2 additions & 1 deletion include/proxy/http/PreWarmManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ using ts::Metrics;

// tscore
#include "tscore/CryptoHash.h"
#include "tscore/ink_hrtime.h"

#include <array>
#include <cstddef>
Expand All @@ -54,6 +53,8 @@ using ts::Metrics;
#include <string>
#include <unordered_map>

import tscore;

// PreWarm::Dst and PreWarm::SPtrConstDst are defined in iocore.
namespace PreWarm
{
Expand Down
2 changes: 2 additions & 0 deletions include/proxy/http2/Http2CommonSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include "proxy/http2/Http2ConnectionState.h"
#include "proxy/http2/Http2Frame.h"

import tscore;

// Name Edata Description
// HTTP2_SESSION_EVENT_INIT Http2CommonSession * HTTP/2 session is born
// HTTP2_SESSION_EVENT_FINI Http2CommonSession * HTTP/2 session is ended
Expand Down
3 changes: 2 additions & 1 deletion include/proxy/http2/Http2ConnectionState.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
#include "proxy/http2/HPACK.h"
#include "proxy/http2/Http2Stream.h"
#include "proxy/http2/Http2DependencyTree.h"
#include "tscore/FrequencyCounter.h"

import tscore;

class Http2CommonSession;
class Http2Frame;
Expand Down
2 changes: 2 additions & 0 deletions include/proxy/http2/Http2Stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#include "tscore/History.h"
#include "proxy/Milestones.h"

import tscore;

class Http2Stream;
class Http2ConnectionState;

Expand Down
2 changes: 2 additions & 0 deletions include/proxy/http3/Http3Transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include "proxy/http3/Http3FrameDispatcher.h"
#include "proxy/http3/Http3FrameCollector.h"

import tscore;

class QUICStreamIO;
class HQSession;
class Http09Session;
Expand Down
42 changes: 0 additions & 42 deletions include/tscore/FrequencyCounter.h

This file was deleted.

Loading