Skip to content

Commit

Permalink
Remove libccp from mvfst
Browse files Browse the repository at this point in the history
Summary: We don't use it, and the OSS lib hasn't been updated in a while.

Reviewed By: mjoras

Differential Revision: D46707559

fbshipit-source-id: ec102a52183a736cfb1c0241600816a837062108
  • Loading branch information
kvtsoy authored and facebook-github-bot committed Jun 16, 2023
1 parent dccfc70 commit adf16f9
Show file tree
Hide file tree
Showing 37 changed files with 7 additions and 2,871 deletions.
10 changes: 0 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,6 @@ find_package(Fizz REQUIRED)
find_package(Glog REQUIRED)
find_package(Threads)

if(DEFINED CCP_ENABLED)
find_package(libccp REQUIRED)
set(LIBCCP_LIBRARY libccp::ccp_static)
# mvfst implementation of ccp is guarded with ifdef CCP_ENABLED
add_compile_definitions(CCP_ENABLED=${CCP_ENABLED})
# libccp header files include extern c if __CPLUSPLUS__ is defined
add_compile_definitions(__CPLUSPLUS__=1)
endif()


SET(GFLAG_DEPENDENCIES "")
SET(QUIC_EXTRA_LINK_LIBRARIES "")
SET(QUIC_EXTRA_INCLUDE_DIRECTORIES "")
Expand Down
41 changes: 1 addition & 40 deletions build_helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,13 @@ Usage ${0##*/} [-h|?] [-p PATH] [-i INSTALL_PREFIX]
-m (optional): Build folly without jemalloc
-s (optional): Skip installing system package dependencies
-c (optional): Use ccache
-z (optional): enable CCP support
-f (optional): Skip fetching dependencies (to test local changes)
-h|? Show this help message
EOF
}

FETCH_DEPENDENCIES=true
while getopts ":hp:i:msczf" arg; do
while getopts ":hp:i:mscf" arg; do
case $arg in
p)
BUILD_DIR="${OPTARG}"
Expand All @@ -49,9 +48,6 @@ while getopts ":hp:i:msczf" arg; do
c)
MVFST_USE_CCACHE=true
;;
z)
MVFST_ENABLE_CCP=true
;;
f)
FETCH_DEPENDENCIES=false
;;
Expand Down Expand Up @@ -88,12 +84,10 @@ mkdir -p "$MVFST_BUILD_DIR"
if [ -z "${INSTALL_PREFIX-}" ]; then
FOLLY_INSTALL_DIR=$DEPS_DIR
FIZZ_INSTALL_DIR=$DEPS_DIR
LIBCCP_INSTALL_DIR=$DEPS_DIR
MVFST_INSTALL_DIR=$BWD
else
FOLLY_INSTALL_DIR=$INSTALL_PREFIX
FIZZ_INSTALL_DIR=$INSTALL_PREFIX
LIBCCP_INSTALL_DIR=$INSTALL_PREFIX
MVFST_INSTALL_DIR=$INSTALL_PREFIX
fi

Expand Down Expand Up @@ -354,32 +348,6 @@ function detect_platform() {
echo -e "${COLOR_GREEN}Detected platform: $Platform ${COLOR_OFF}"
}

function setup_libccp() {
LIBCCP_DIR=$DEPS_DIR/libccp
LIBCCP_BUILD_DIR=$LIBCCP_DIR/build/
if [ ! -d "$LIBCCP_DIR" ] ; then
echo -e "${COLOR_GREEN}[ INFO ] Cloning libccp repo ${COLOR_OFF}"
git clone https://github.com/ccp-project/libccp "$LIBCCP_DIR"
fi

#synch_dependency_to_commit "$LIBCCP_DIR" "$MVFST_ROOT_DIR/build/deps/github_hashes/libccp-rev.txt"

echo -e "${COLOR_GREEN}Building libccp ${COLOR_OFF}"
mkdir -p "$LIBCCP_BUILD_DIR"
cd "$LIBCCP_BUILD_DIR" || exit
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBUILD_TESTS=OFF \
-DCMAKE_PREFIX_PATH="$LIBCCP_INSTALL_DIR" \
-DCMAKE_INSTALL_PREFIX="$LIBCCP_INSTALL_DIR" \
-DCMAKE_CXX_FLAGS=\D__CPLUSPLUS__=1 \
${CMAKE_EXTRA_ARGS[@]+"${CMAKE_EXTRA_ARGS[@]}"} \
"$LIBCCP_DIR"
make -j "$nproc"
make install
echo -e "${COLOR_GREEN}libccp is installed ${COLOR_OFF}"
cd "$BWD" || exit
}

function setup_rust() {
if ! [ -x "$(command -v rustc)" ] || ! [ -x "$(command -v cargo)" ]; then
echo -e "${COLOR_RED}[ ERROR ] Rust not found (required for CCP support).${COLOR_OFF}\n"
Expand All @@ -398,10 +366,6 @@ setup_googletest
setup_zstd
setup_folly
setup_fizz
if [[ -n "${MVFST_ENABLE_CCP-}" ]]; then
setup_libccp
setup_rust
fi


# build mvfst:
Expand All @@ -413,9 +377,6 @@ mvfst_cmake_build_args=(
-DBUILD_TESTS=On \
${CMAKE_EXTRA_ARGS[@]+"${CMAKE_EXTRA_ARGS[@]}"} \
)
if [[ -n "${MVFST_ENABLE_CCP-}" ]]; then
mvfst_cmake_build_args+=(-DCCP_ENABLED=TRUE)
fi
cmake "${mvfst_cmake_build_args[@]}" ../..
make -j "$nproc"

Expand Down
4 changes: 0 additions & 4 deletions quic/QuicConstants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ std::string_view congestionControlTypeToString(CongestionControlType type) {
return kCongestionControlCopa2Str;
case CongestionControlType::NewReno:
return kCongestionControlNewRenoStr;
case CongestionControlType::CCP:
return kCongestionControlCcpStr;
case CongestionControlType::StaticCwnd:
return kCongestionControlStaticCwndStr;
case CongestionControlType::None:
Expand All @@ -53,8 +51,6 @@ std::optional<CongestionControlType> congestionControlStrToType(
return quic::CongestionControlType::Copa2;
} else if (str == kCongestionControlNewRenoStr) {
return quic::CongestionControlType::NewReno;
} else if (str == kCongestionControlCcpStr) {
return quic::CongestionControlType::CCP;
} else if (str == kCongestionControlStaticCwndStr) {
return quic::CongestionControlType::StaticCwnd;
} else if (str == kCongestionControlNoneStr) {
Expand Down
2 changes: 0 additions & 2 deletions quic/QuicConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,6 @@ constexpr std::string_view kCongestionControlBbrTestingStr = "bbr_testing";
constexpr std::string_view kCongestionControlCopaStr = "copa";
constexpr std::string_view kCongestionControlCopa2Str = "copa2";
constexpr std::string_view kCongestionControlNewRenoStr = "newreno";
constexpr std::string_view kCongestionControlCcpStr = "ccp";
constexpr std::string_view kCongestionControlStaticCwndStr = "staticcwnd";
constexpr std::string_view kCongestionControlNoneStr = "none";

Expand All @@ -404,7 +403,6 @@ enum class CongestionControlType : uint8_t {
Copa2,
BBR,
BBRTesting,
CCP,
StaticCwnd,
None,
// NOTE: MAX should always be at the end
Expand Down
3 changes: 0 additions & 3 deletions quic/congestion_control/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ add_library(
Copa2.cpp
NewReno.cpp
QuicCubic.cpp
QuicCCP.cpp
ServerCongestionControllerFactory.cpp
SimulatedTBF.cpp
StaticCwndCongestionController.cpp
Expand Down Expand Up @@ -50,7 +49,6 @@ target_link_libraries(
mvfst_exception
mvfst_state_machine
mvfst_state_functions
${LIBCCP_LIBRARY}
)

file(
Expand All @@ -71,4 +69,3 @@ install(
)

add_subdirectory(test)
add_subdirectory(third_party/ccp)
4 changes: 0 additions & 4 deletions quic/congestion_control/CongestionControllerFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ DefaultCongestionControllerFactory::makeCongestionController(
case CongestionControlType::NewReno:
congestionController = std::make_unique<NewReno>(conn);
break;
case CongestionControlType::CCP:
LOG(ERROR)
<< "Default CC Factory cannot make CCP. Falling back to cubic.";
FOLLY_FALLTHROUGH;
case CongestionControlType::Cubic:
congestionController = std::make_unique<Cubic>(conn);
break;
Expand Down
Loading

0 comments on commit adf16f9

Please sign in to comment.