1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-07-30 14:43:05 +03:00

Remove ThreadLocalBatchWriter

Summary: Remove ThreadLocalBatchWriter since it's not being used.

Reviewed By: mjoras

Differential Revision: D50809221

fbshipit-source-id: 3754e64320518165654217b1e368429c69a944c5
This commit is contained in:
Joseph Beshay
2023-11-07 14:51:15 -08:00
committed by Facebook GitHub Bot
parent b3bd78408b
commit cc9ccc8f99
12 changed files with 23 additions and 261 deletions

View File

@ -364,9 +364,6 @@ QuicBatchingMode getQuicBatchingMode(uint32_t val);
// by BATCHING_MODE_GSO
constexpr uint32_t kDefaultQuicMaxBatchSize = 16;
// thread local delay
constexpr std::chrono::microseconds kDefaultThreadLocalDelay = 1ms;
// rfc6298:
constexpr int kRttAlpha = 8;
constexpr int kRttBeta = 4;

View File

@ -13,13 +13,12 @@
namespace quic {
IOBufQuicBatch::IOBufQuicBatch(
BatchWriterPtr&& batchWriter,
bool threadLocal,
QuicAsyncUDPSocketWrapper& sock,
const folly::SocketAddress& peerAddress,
QuicTransportStatsCallback* statsCallback,
QuicClientConnectionState::HappyEyeballsState* happyEyeballsState)
: batchWriter_(std::move(batchWriter)),
threadLocal_(threadLocal),
sock_(sock),
peerAddress_(peerAddress),
statsCallback_(statsCallback),
@ -34,27 +33,19 @@ bool IOBufQuicBatch::write(
// see if we need to flush the prev buffer(s)
if (batchWriter_->needsFlush(encodedSize)) {
// continue even if we get an error here
flush(FlushType::FLUSH_TYPE_ALWAYS);
flush();
}
// try to append the new buffers
if (batchWriter_->append(
std::move(buf),
encodedSize,
peerAddress_,
threadLocal_ ? &sock_ : nullptr)) {
if (batchWriter_->append(std::move(buf), encodedSize, peerAddress_, &sock_)) {
// return if we get an error here
return flush(FlushType::FLUSH_TYPE_ALWAYS);
return flush();
}
return true;
}
bool IOBufQuicBatch::flush(FlushType flushType) {
if (threadLocal_ &&
(flushType == FlushType::FLUSH_TYPE_ALLOW_THREAD_LOCAL_DELAY)) {
return true;
}
bool IOBufQuicBatch::flush() {
bool ret = flushInternal();
reset();

View File

@ -20,14 +20,8 @@ struct BufQuicBatchResult {
class IOBufQuicBatch {
public:
enum class FlushType {
FLUSH_TYPE_ALWAYS,
FLUSH_TYPE_ALLOW_THREAD_LOCAL_DELAY,
};
IOBufQuicBatch(
BatchWriterPtr&& batchWriter,
bool threadLocal,
QuicAsyncUDPSocketWrapper& sock,
const folly::SocketAddress& peerAddress,
QuicTransportStatsCallback* statsCallback,
@ -38,8 +32,7 @@ class IOBufQuicBatch {
// returns true if it succeeds and false if the loop should end
bool write(std::unique_ptr<folly::IOBuf>&& buf, size_t encodedSize);
bool flush(
FlushType flushType = FlushType::FLUSH_TYPE_ALLOW_THREAD_LOCAL_DELAY);
bool flush();
FOLLY_ALWAYS_INLINE uint64_t getPktSent() const {
return result_.packetsSent;
@ -61,7 +54,6 @@ class IOBufQuicBatch {
bool isRetriableError(int err);
BatchWriterPtr batchWriter_;
bool threadLocal_;
QuicAsyncUDPSocketWrapper& sock_;
const folly::SocketAddress& peerAddress_;
QuicTransportStatsCallback* statsCallback_{nullptr};

View File

@ -7,140 +7,11 @@
#include <quic/api/QuicBatchWriterFactory.h>
#if !FOLLY_MOBILE
#define USE_THREAD_LOCAL_BATCH_WRITER 1
#else
#define USE_THREAD_LOCAL_BATCH_WRITER 0
#endif
namespace {
#if USE_THREAD_LOCAL_BATCH_WRITER
class ThreadLocalBatchWriterCache : public folly::AsyncTimeout {
private:
ThreadLocalBatchWriterCache() = default;
// we need to handle the case where the thread is being destroyed
// while the EventBase has an outstanding timer
struct Holder {
Holder() = default;
~Holder() {
if (ptr_) {
ptr_->decRef();
}
}
ThreadLocalBatchWriterCache* ptr_{nullptr};
};
void addRef() {
++count_;
}
void decRef() {
if (--count_ == 0) {
delete this;
}
}
public:
static ThreadLocalBatchWriterCache& getThreadLocalInstance() {
static thread_local Holder sCache;
if (!sCache.ptr_) {
sCache.ptr_ = new ThreadLocalBatchWriterCache();
}
return *sCache.ptr_;
}
void timeoutExpired() noexcept override {
timerActive_ = false;
auto& instance = getThreadLocalInstance();
if (instance.socket_ && instance.batchWriter_ &&
!instance.batchWriter_->empty()) {
// pass a default address - it is not being used by the writer
instance.batchWriter_->write(*socket_.get(), folly::SocketAddress());
instance.batchWriter_->reset();
}
decRef();
}
void enable(bool val) {
if (enabled_ != val) {
enabled_ = val;
batchingMode_ = quic::QuicBatchingMode::BATCHING_MODE_NONE;
batchWriter_.reset();
}
}
quic::BatchWriter* FOLLY_NULLABLE getCachedWriter(
quic::QuicBatchingMode mode,
const std::chrono::microseconds& threadLocalDelay) {
enabled_ = true;
threadLocalDelay_ = threadLocalDelay;
if (mode == batchingMode_) {
return batchWriter_.release();
}
batchingMode_ = mode;
batchWriter_.reset();
return nullptr;
}
void setCachedWriter(quic::BatchWriter* writer) {
if (enabled_) {
auto* evb = writer->evb();
if (evb && evb->getBackingEventBase() && !socket_) {
auto fd = writer->getAndResetFd();
if (fd >= 0) {
socket_ = std::make_unique<quic::QuicAsyncUDPSocketWrapperImpl>(
evb->getBackingEventBase());
socket_->setFD(
quic::toNetworkFdType(fd),
quic::QuicAsyncUDPSocketWrapper::FDOwnership::OWNS);
}
attachTimeoutManager(evb->getBackingEventBase());
}
batchWriter_.reset(writer);
// start the timer if not active
if (evb && evb->getBackingEventBase() && socket_ && !timerActive_) {
addRef();
timerActive_ = true;
evb->scheduleTimeoutHighRes(this, threadLocalDelay_);
}
} else {
delete writer;
}
}
private:
std::atomic<uint32_t> count_{1};
bool enabled_{false};
bool timerActive_{false};
std::chrono::microseconds threadLocalDelay_{1000};
quic::QuicBatchingMode batchingMode_{
quic::QuicBatchingMode::BATCHING_MODE_NONE};
// this is just an std::unique_ptr
std::unique_ptr<quic::BatchWriter> batchWriter_;
std::unique_ptr<quic::QuicAsyncUDPSocketWrapper> socket_;
};
#endif
} // namespace
namespace quic {
// BatchWriterDeleter
void BatchWriterDeleter::operator()(BatchWriter* batchWriter) {
#if USE_THREAD_LOCAL_BATCH_WRITER
ThreadLocalBatchWriterCache::getThreadLocalInstance().setCachedWriter(
batchWriter);
#else
delete batchWriter;
#endif
}
BatchWriterPtr makeGsoBatchWriter(uint32_t batchSize) {
@ -160,30 +31,9 @@ BatchWriterPtr makeSendmmsgGsoBatchWriter(uint32_t batchSize) {
BatchWriterPtr BatchWriterFactory::makeBatchWriter(
const quic::QuicBatchingMode& batchingMode,
uint32_t batchSize,
bool useThreadLocal,
const std::chrono::microseconds& threadLocalDelay,
DataPathType dataPathType,
QuicConnectionStateBase& conn,
bool gsoSupported) {
#if USE_THREAD_LOCAL_BATCH_WRITER
if (useThreadLocal &&
(batchingMode == quic::QuicBatchingMode::BATCHING_MODE_SENDMMSG_GSO) &&
gsoSupported) {
BatchWriterPtr ret(
ThreadLocalBatchWriterCache::getThreadLocalInstance().getCachedWriter(
batchingMode, threadLocalDelay));
if (ret) {
return ret;
}
} else {
ThreadLocalBatchWriterCache::getThreadLocalInstance().enable(false);
}
#else
(void)useThreadLocal;
(void)threadLocalDelay;
#endif
return makeBatchWriterHelper(
batchingMode, batchSize, dataPathType, conn, gsoSupported);
}

View File

@ -25,8 +25,6 @@ class BatchWriterFactory {
static BatchWriterPtr makeBatchWriter(
const quic::QuicBatchingMode& batchingMode,
uint32_t batchSize,
bool useThreadLocal,
const std::chrono::microseconds& threadLocalDelay,
DataPathType dataPathType,
QuicConnectionStateBase& conn,
bool gsoSupported);
@ -53,6 +51,7 @@ class BatchWriterFactory {
}
// Fall through to Sendmmsg batching if gso is not supported.
}
[[fallthrough]];
case quic::QuicBatchingMode::BATCHING_MODE_SENDMMSG:
return BatchWriterPtr(new SendmmsgPacketBatchWriter(batchSize));
case quic::QuicBatchingMode::BATCHING_MODE_SENDMMSG_GSO: {

View File

@ -32,8 +32,6 @@ BatchWriterPtr makeSendmmsgGsoBatchWriter(uint32_t) {
BatchWriterPtr BatchWriterFactory::makeBatchWriter(
const quic::QuicBatchingMode& batchingMode,
uint32_t batchSize,
bool /* useThreadLocal */,
const std::chrono::microseconds& /* threadLocalDelay */,
DataPathType dataPathType,
QuicConnectionStateBase& conn,
bool gsoSupported) {

View File

@ -1487,8 +1487,6 @@ WriteQuicDataResult writeConnectionDataToSocket(
auto batchWriter = BatchWriterFactory::makeBatchWriter(
connection.transportSettings.batchingMode,
connection.transportSettings.maxBatchSize,
connection.transportSettings.useThreadLocalBatching,
connection.transportSettings.threadLocalDelay,
connection.transportSettings.dataPathType,
connection,
*connection.gsoSupported);
@ -1498,7 +1496,6 @@ WriteQuicDataResult writeConnectionDataToSocket(
: &static_cast<QuicClientConnectionState&>(connection).happyEyeballsState;
IOBufQuicBatch ioBufBatch(
std::move(batchWriter),
connection.transportSettings.useThreadLocalBatching,
sock,
connection.peerAddress,
connection.statsCallback,

View File

@ -31,7 +31,6 @@ void RunTest(int numBatch) {
IOBufQuicBatch ioBufBatch(
std::move(batchWriter),
false,
sock,
peerAddress,
conn.statsCallback,

View File

@ -24,8 +24,7 @@ constexpr const auto kStrLenLT = 5;
constexpr const auto kBatchNum = 3;
constexpr const auto kNumLoops = 10;
struct QuicBatchWriterTest : public ::testing::Test,
public ::testing::WithParamInterface<bool> {
struct QuicBatchWriterTest : public ::testing::Test {
QuicBatchWriterTest()
: conn_(FizzServerQuicHandshakeContext::Builder().build()) {}
@ -34,13 +33,10 @@ struct QuicBatchWriterTest : public ::testing::Test,
bool gsoSupported_{false};
};
TEST_P(QuicBatchWriterTest, TestBatchingNone) {
bool useThreadLocal = GetParam();
TEST_F(QuicBatchWriterTest, TestBatchingNone) {
auto batchWriter = quic::BatchWriterFactory::makeBatchWriter(
quic::QuicBatchingMode::BATCHING_MODE_NONE,
kBatchNum,
useThreadLocal,
quic::kDefaultThreadLocalDelay,
DataPathType::ChainedMemory,
conn_,
gsoSupported_);
@ -60,8 +56,7 @@ TEST_P(QuicBatchWriterTest, TestBatchingNone) {
}
}
TEST_P(QuicBatchWriterTest, TestBatchingGSOBase) {
bool useThreadLocal = GetParam();
TEST_F(QuicBatchWriterTest, TestBatchingGSOBase) {
folly::EventBase evb;
QuicAsyncUDPSocketWrapperImpl sock(&evb);
sock.setReuseAddr(false);
@ -71,8 +66,6 @@ TEST_P(QuicBatchWriterTest, TestBatchingGSOBase) {
auto batchWriter = quic::BatchWriterFactory::makeBatchWriter(
quic::QuicBatchingMode::BATCHING_MODE_GSO,
1,
useThreadLocal,
quic::kDefaultThreadLocalDelay,
DataPathType::ChainedMemory,
conn_,
gsoSupported_);
@ -90,8 +83,7 @@ TEST_P(QuicBatchWriterTest, TestBatchingGSOBase) {
}
}
TEST_P(QuicBatchWriterTest, TestBatchingGSOLastSmallPacket) {
bool useThreadLocal = GetParam();
TEST_F(QuicBatchWriterTest, TestBatchingGSOLastSmallPacket) {
folly::EventBase evb;
QuicAsyncUDPSocketWrapperImpl sock(&evb);
sock.setReuseAddr(false);
@ -101,8 +93,6 @@ TEST_P(QuicBatchWriterTest, TestBatchingGSOLastSmallPacket) {
auto batchWriter = quic::BatchWriterFactory::makeBatchWriter(
quic::QuicBatchingMode::BATCHING_MODE_GSO,
1,
useThreadLocal,
quic::kDefaultThreadLocalDelay,
DataPathType::ChainedMemory,
conn_,
gsoSupported_);
@ -132,8 +122,7 @@ TEST_P(QuicBatchWriterTest, TestBatchingGSOLastSmallPacket) {
}
}
TEST_P(QuicBatchWriterTest, TestBatchingGSOLastBigPacket) {
bool useThreadLocal = GetParam();
TEST_F(QuicBatchWriterTest, TestBatchingGSOLastBigPacket) {
folly::EventBase evb;
QuicAsyncUDPSocketWrapperImpl sock(&evb);
sock.setReuseAddr(false);
@ -143,8 +132,6 @@ TEST_P(QuicBatchWriterTest, TestBatchingGSOLastBigPacket) {
auto batchWriter = quic::BatchWriterFactory::makeBatchWriter(
quic::QuicBatchingMode::BATCHING_MODE_GSO,
1,
useThreadLocal,
quic::kDefaultThreadLocalDelay,
DataPathType::ChainedMemory,
conn_,
gsoSupported_);
@ -169,8 +156,7 @@ TEST_P(QuicBatchWriterTest, TestBatchingGSOLastBigPacket) {
}
}
TEST_P(QuicBatchWriterTest, TestBatchingGSOBatchNum) {
bool useThreadLocal = GetParam();
TEST_F(QuicBatchWriterTest, TestBatchingGSOBatchNum) {
folly::EventBase evb;
QuicAsyncUDPSocketWrapperImpl sock(&evb);
sock.setReuseAddr(false);
@ -180,8 +166,6 @@ TEST_P(QuicBatchWriterTest, TestBatchingGSOBatchNum) {
auto batchWriter = quic::BatchWriterFactory::makeBatchWriter(
quic::QuicBatchingMode::BATCHING_MODE_GSO,
kBatchNum,
useThreadLocal,
quic::kDefaultThreadLocalDelay,
DataPathType::ChainedMemory,
conn_,
gsoSupported_);
@ -215,13 +199,10 @@ TEST_P(QuicBatchWriterTest, TestBatchingGSOBatchNum) {
}
}
TEST_P(QuicBatchWriterTest, TestBatchingSendmmsg) {
bool useThreadLocal = GetParam();
TEST_F(QuicBatchWriterTest, TestBatchingSendmmsg) {
auto batchWriter = quic::BatchWriterFactory::makeBatchWriter(
quic::QuicBatchingMode::BATCHING_MODE_SENDMMSG,
kBatchNum,
useThreadLocal,
quic::kDefaultThreadLocalDelay,
DataPathType::ChainedMemory,
conn_,
gsoSupported_);
@ -252,8 +233,7 @@ TEST_P(QuicBatchWriterTest, TestBatchingSendmmsg) {
}
}
TEST_P(QuicBatchWriterTest, TestBatchingSendmmsgGSOBatchNum) {
bool useThreadLocal = GetParam();
TEST_F(QuicBatchWriterTest, TestBatchingSendmmsgGSOBatchNum) {
folly::EventBase evb;
QuicAsyncUDPSocketWrapperImpl sock(&evb);
sock.setReuseAddr(false);
@ -263,8 +243,6 @@ TEST_P(QuicBatchWriterTest, TestBatchingSendmmsgGSOBatchNum) {
auto batchWriter = quic::BatchWriterFactory::makeBatchWriter(
quic::QuicBatchingMode::BATCHING_MODE_SENDMMSG_GSO,
kBatchNum,
useThreadLocal,
quic::kDefaultThreadLocalDelay,
DataPathType::ChainedMemory,
conn_,
gsoSupported_);
@ -298,8 +276,7 @@ TEST_P(QuicBatchWriterTest, TestBatchingSendmmsgGSOBatchNum) {
}
}
TEST_P(QuicBatchWriterTest, TestBatchingSendmmsgGSOBatcBigSmallPacket) {
bool useThreadLocal = GetParam();
TEST_F(QuicBatchWriterTest, TestBatchingSendmmsgGSOBatcBigSmallPacket) {
folly::EventBase evb;
QuicAsyncUDPSocketWrapperImpl sock(&evb);
sock.setReuseAddr(false);
@ -309,8 +286,6 @@ TEST_P(QuicBatchWriterTest, TestBatchingSendmmsgGSOBatcBigSmallPacket) {
auto batchWriter = quic::BatchWriterFactory::makeBatchWriter(
quic::QuicBatchingMode::BATCHING_MODE_SENDMMSG_GSO,
3 * kBatchNum,
useThreadLocal,
quic::kDefaultThreadLocalDelay,
DataPathType::ChainedMemory,
conn_,
gsoSupported_);
@ -349,8 +324,7 @@ TEST_P(QuicBatchWriterTest, TestBatchingSendmmsgGSOBatcBigSmallPacket) {
}
}
TEST_P(QuicBatchWriterTest, InplaceWriterNeedsFlush) {
bool useThreadLocal = GetParam();
TEST_F(QuicBatchWriterTest, InplaceWriterNeedsFlush) {
gsoSupported_ = true;
uint32_t batchSize = 20;
auto bufAccessor =
@ -359,8 +333,6 @@ TEST_P(QuicBatchWriterTest, InplaceWriterNeedsFlush) {
auto batchWriter = quic::BatchWriterFactory::makeBatchWriter(
quic::QuicBatchingMode::BATCHING_MODE_GSO,
batchSize,
useThreadLocal,
quic::kDefaultThreadLocalDelay,
DataPathType::ContinuousMemory,
conn_,
gsoSupported_);
@ -374,8 +346,7 @@ TEST_P(QuicBatchWriterTest, InplaceWriterNeedsFlush) {
EXPECT_TRUE(batchWriter->needsFlush(conn_.udpSendPacketLen));
}
TEST_P(QuicBatchWriterTest, InplaceWriterAppendLimit) {
bool useThreadLocal = GetParam();
TEST_F(QuicBatchWriterTest, InplaceWriterAppendLimit) {
gsoSupported_ = true;
uint32_t batchSize = 20;
auto bufAccessor =
@ -384,8 +355,6 @@ TEST_P(QuicBatchWriterTest, InplaceWriterAppendLimit) {
auto batchWriter = quic::BatchWriterFactory::makeBatchWriter(
quic::QuicBatchingMode::BATCHING_MODE_GSO,
batchSize,
useThreadLocal,
quic::kDefaultThreadLocalDelay,
DataPathType::ContinuousMemory,
conn_,
gsoSupported_);
@ -407,8 +376,7 @@ TEST_P(QuicBatchWriterTest, InplaceWriterAppendLimit) {
batchWriter->append(nullptr, 1000, folly::SocketAddress(), nullptr));
}
TEST_P(QuicBatchWriterTest, InplaceWriterAppendSmaller) {
bool useThreadLocal = GetParam();
TEST_F(QuicBatchWriterTest, InplaceWriterAppendSmaller) {
gsoSupported_ = true;
uint32_t batchSize = 20;
auto bufAccessor =
@ -417,8 +385,6 @@ TEST_P(QuicBatchWriterTest, InplaceWriterAppendSmaller) {
auto batchWriter = quic::BatchWriterFactory::makeBatchWriter(
quic::QuicBatchingMode::BATCHING_MODE_GSO,
batchSize,
useThreadLocal,
quic::kDefaultThreadLocalDelay,
DataPathType::ContinuousMemory,
conn_,
gsoSupported_);
@ -440,8 +406,7 @@ TEST_P(QuicBatchWriterTest, InplaceWriterAppendSmaller) {
batchWriter->append(nullptr, 700, folly::SocketAddress(), nullptr));
}
TEST_P(QuicBatchWriterTest, InplaceWriterWriteAll) {
bool useThreadLocal = GetParam();
TEST_F(QuicBatchWriterTest, InplaceWriterWriteAll) {
folly::EventBase evb;
quic::test::MockAsyncUDPSocket sock(&evb);
uint32_t batchSize = 20;
@ -452,8 +417,6 @@ TEST_P(QuicBatchWriterTest, InplaceWriterWriteAll) {
auto batchWriter = quic::BatchWriterFactory::makeBatchWriter(
quic::QuicBatchingMode::BATCHING_MODE_GSO,
batchSize,
useThreadLocal,
quic::kDefaultThreadLocalDelay,
DataPathType::ContinuousMemory,
conn_,
gsoSupported_);
@ -489,8 +452,7 @@ TEST_P(QuicBatchWriterTest, InplaceWriterWriteAll) {
EXPECT_EQ(0, buf->length());
}
TEST_P(QuicBatchWriterTest, InplaceWriterWriteOne) {
bool useThreadLocal = GetParam();
TEST_F(QuicBatchWriterTest, InplaceWriterWriteOne) {
folly::EventBase evb;
quic::test::MockAsyncUDPSocket sock(&evb);
uint32_t batchSize = 20;
@ -501,8 +463,6 @@ TEST_P(QuicBatchWriterTest, InplaceWriterWriteOne) {
auto batchWriter = quic::BatchWriterFactory::makeBatchWriter(
quic::QuicBatchingMode::BATCHING_MODE_GSO,
batchSize,
useThreadLocal,
quic::kDefaultThreadLocalDelay,
DataPathType::ContinuousMemory,
conn_,
gsoSupported_);
@ -530,8 +490,7 @@ TEST_P(QuicBatchWriterTest, InplaceWriterWriteOne) {
EXPECT_EQ(0, buf->length());
}
TEST_P(QuicBatchWriterTest, InplaceWriterLastOneTooBig) {
bool useThreadLocal = GetParam();
TEST_F(QuicBatchWriterTest, InplaceWriterLastOneTooBig) {
folly::EventBase evb;
quic::test::MockAsyncUDPSocket sock(&evb);
uint32_t batchSize = 20;
@ -542,8 +501,6 @@ TEST_P(QuicBatchWriterTest, InplaceWriterLastOneTooBig) {
auto batchWriter = quic::BatchWriterFactory::makeBatchWriter(
quic::QuicBatchingMode::BATCHING_MODE_GSO,
batchSize,
useThreadLocal,
quic::kDefaultThreadLocalDelay,
DataPathType::ContinuousMemory,
conn_,
gsoSupported_);
@ -576,8 +533,7 @@ TEST_P(QuicBatchWriterTest, InplaceWriterLastOneTooBig) {
EXPECT_EQ(0, buf->headroom());
}
TEST_P(QuicBatchWriterTest, InplaceWriterBufResidueCheck) {
bool useThreadLocal = GetParam();
TEST_F(QuicBatchWriterTest, InplaceWriterBufResidueCheck) {
folly::EventBase evb;
quic::test::MockAsyncUDPSocket sock(&evb);
gsoSupported_ = true;
@ -590,8 +546,6 @@ TEST_P(QuicBatchWriterTest, InplaceWriterBufResidueCheck) {
auto batchWriter = quic::BatchWriterFactory::makeBatchWriter(
quic::QuicBatchingMode::BATCHING_MODE_GSO,
batchSize,
useThreadLocal,
quic::kDefaultThreadLocalDelay,
DataPathType::ContinuousMemory,
conn_,
gsoSupported_);
@ -621,11 +575,6 @@ TEST_P(QuicBatchWriterTest, InplaceWriterBufResidueCheck) {
EXPECT_EQ(0, rawBuf->headroom());
}
INSTANTIATE_TEST_SUITE_P(
QuicBatchWriterTest,
QuicBatchWriterTest,
::testing::Values(false, true));
class SinglePacketInplaceBatchWriterTest : public ::testing::Test {
public:
SinglePacketInplaceBatchWriterTest()
@ -643,8 +592,6 @@ class SinglePacketInplaceBatchWriterTest : public ::testing::Test {
return quic::BatchWriterFactory::makeBatchWriter(
batchingMode,
conn_.transportSettings.maxBatchSize,
false /* useThreadLocal */,
quic::kDefaultThreadLocalDelay,
conn_.transportSettings.dataPathType,
conn_,
false /* gsoSupported_ */);

View File

@ -144,7 +144,6 @@ BufQuicBatchResult writePacketsGroup(
fakeConn, fakeConn.transportSettings.maxBatchSize));
IOBufQuicBatch ioBufBatch(
std::move(batchWriter),
false /* thread local batching */,
sock,
reqGroup.clientAddress,
nullptr /* statsCallback */,

View File

@ -60,7 +60,6 @@ TEST_F(DSRPacketizerSingleWriteTest, SingleWrite) {
std::make_unique<NiceMock<quic::test::MockAsyncUDPSocket>>(&evb);
IOBufQuicBatch ioBufBatch(
std::move(batchWriter),
false /* threadLocal */,
*socket,
peerAddress,
nullptr /* statsCallback */,
@ -105,7 +104,6 @@ TEST_F(DSRPacketizerSingleWriteTest, NotEnoughData) {
std::make_unique<NiceMock<quic::test::MockAsyncUDPSocket>>(&evb);
IOBufQuicBatch ioBufBatch(
std::move(batchWriter),
false /* threadLocal */,
*socket,
peerAddress,
nullptr /* statsCallback */,

View File

@ -182,11 +182,6 @@ struct TransportSettings {
uint16_t flowControlWindowFrequency{2};
// batching mode
QuicBatchingMode batchingMode{QuicBatchingMode::BATCHING_MODE_NONE};
// use thread local batcher - currently it works only with
// BATCHING_MODE_SENDMMSG_GSO it will not be enabled if the mode is different
bool useThreadLocalBatching{false};
// thread local delay interval
std::chrono::microseconds threadLocalDelay{kDefaultThreadLocalDelay};
// maximum number of packets we can batch. This does not apply to
// BATCHING_MODE_NONE
uint32_t maxBatchSize{kDefaultQuicMaxBatchSize};