1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-08-08 09:42:06 +03:00

Remove forcible setting of ContinuousMemory

Summary: Previously, we didn't support all combinations of (batching mode, data path type).

Reviewed By: mjoras

Differential Revision: D73280506

fbshipit-source-id: 752a1eda4f58a19f86410bff514415017ffdb383
This commit is contained in:
Aman Sharma
2025-04-21 10:30:20 -07:00
committed by Facebook GitHub Bot
parent b90551c3bb
commit 0c5295f4ef
3 changed files with 1 additions and 32 deletions

View File

@@ -1641,20 +1641,6 @@ folly::Expected<WriteQuicDataResult, QuicError> writeConnectionDataToSocket(
return folly::makeUnexpected(gsoResult.error()); return folly::makeUnexpected(gsoResult.error());
} }
connection.gsoSupported = sock.getGSO().value() >= 0; connection.gsoSupported = sock.getGSO().value() >= 0;
if (!*connection.gsoSupported) {
if (!useSinglePacketInplaceBatchWriter(
connection.transportSettings.maxBatchSize,
connection.transportSettings.dataPathType) &&
(connection.transportSettings.dataPathType ==
DataPathType::ContinuousMemory)) {
// Change data path type to DataPathType::ChainedMemory.
// Continuous memory data path is only supported with working GSO or
// SinglePacketInplaceBatchWriter.
LOG(ERROR) << "Switching data path to ChainedMemory as "
<< "GSO is not supported on the socket";
connection.transportSettings.dataPathType = DataPathType::ChainedMemory;
}
}
} }
auto batchWriter = BatchWriterFactory::makeBatchWriter( auto batchWriter = BatchWriterFactory::makeBatchWriter(

View File

@@ -62,8 +62,7 @@ QuicServerWorker::QuicServerWorker(
SetEventCallback ec) SetEventCallback ec)
: callback_(std::move(callback)), : callback_(std::move(callback)),
setEventCallback_(ec), setEventCallback_(ec),
transportSettings_( transportSettings_(std::move(transportSettings)),
validateTransportSettings(std::move(transportSettings))),
takeoverPktHandler_(this), takeoverPktHandler_(this),
observerList_(this) { observerList_(this) {
pending0RttData_.setPruneHook( pending0RttData_.setPruneHook(
@@ -1272,19 +1271,6 @@ void QuicServerWorker::setFizzContext(
ctx_ = ctx; ctx_ = ctx;
} }
TransportSettings QuicServerWorker::validateTransportSettings(
TransportSettings transportSettings) {
if (transportSettings.batchingMode != QuicBatchingMode::BATCHING_MODE_GSO &&
transportSettings.batchingMode !=
QuicBatchingMode::BATCHING_MODE_SENDMMSG_GSO) {
if (transportSettings.dataPathType == DataPathType::ContinuousMemory) {
LOG(ERROR) << "Unsupported data path type and batching mode combination";
}
transportSettings.dataPathType = DataPathType::ChainedMemory;
}
return transportSettings;
}
void QuicServerWorker::rejectNewConnections( void QuicServerWorker::rejectNewConnections(
std::function<bool()> rejectNewConnections) { std::function<bool()> rejectNewConnections) {
rejectNewConnections_ = std::move(rejectNewConnections); rejectNewConnections_ = std::move(rejectNewConnections);

View File

@@ -45,9 +45,6 @@ class QuicServerWorker : public FollyAsyncUDPSocketAlias::ReadCallback,
static int getUnfinishedHandshakeCount(); static int getUnfinishedHandshakeCount();
private: private:
static TransportSettings validateTransportSettings(
TransportSettings transportSettings);
struct MsgHdr : public folly::EventRecvmsgCallback::MsgHdr { struct MsgHdr : public folly::EventRecvmsgCallback::MsgHdr {
static auto constexpr kBuffSize = 1024; static auto constexpr kBuffSize = 1024;