Skip to content

Commit

Permalink
[Config] Backport Config Changes from Upstreams (#42)
Browse files Browse the repository at this point in the history
* config: backport config changes from 2 upstreams

* patch: fix BBRv3 code for clang

clang warns use of `&&` with constant, which breaks build as `-Werror` is enabled (by default)
  • Loading branch information
Locietta authored Aug 29, 2023
1 parent db0a975 commit eba9a99
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 8 deletions.
43 changes: 43 additions & 0 deletions 0003-bbrv3-fix-clang-build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
From 229949907e120db70b12fa76e34a9b4cc013c7c9 Mon Sep 17 00:00:00 2001
From: xingxing <[email protected]>
Date: Tue, 29 Aug 2023 19:23:03 +0800
Subject: [PATCH] bbrv3: fix clang build

---
net/ipv4/tcp_bbr.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/ipv4/tcp_bbr.c b/net/ipv4/tcp_bbr.c
index f4f477a69..294bafe39 100644
--- a/net/ipv4/tcp_bbr.c
+++ b/net/ipv4/tcp_bbr.c
@@ -1077,7 +1077,7 @@ static int bbr_update_ecn_alpha(struct sock *sk)

/* See if we should use ECN sender logic for this connection. */
if (!bbr->ecn_eligible && bbr_can_use_ecn(sk) &&
- bbr_param(sk, ecn_factor) &&
+ !!bbr_param(sk, ecn_factor) &&
(bbr->min_rtt_us <= bbr_ecn_max_rtt_us ||
!bbr_ecn_max_rtt_us))
bbr->ecn_eligible = 1;
@@ -1184,7 +1184,7 @@ static bool bbr_is_inflight_too_high(const struct sock *sk,
}

if (rs->delivered_ce > 0 && rs->delivered > 0 &&
- bbr->ecn_eligible && bbr_param(sk, ecn_thresh)) {
+ bbr->ecn_eligible && !!bbr_param(sk, ecn_thresh)) {
ecn_thresh = (u64)rs->delivered * bbr_param(sk, ecn_thresh) >>
BBR_SCALE;
if (rs->delivered_ce > ecn_thresh) {
@@ -1382,7 +1382,7 @@ static void bbr_adapt_lower_bounds(struct sock *sk,
return;

/* ECN response. */
- if (bbr->ecn_in_round && bbr_param(sk, ecn_factor)) {
+ if (bbr->ecn_in_round && !!bbr_param(sk, ecn_factor)) {
bbr_init_lower_bounds(sk, false);
bbr_ecn_lower_bounds(sk, &ecn_inflight_lo);
}
--
2.41.0

1 change: 1 addition & 0 deletions config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#
git apply ../0001-6.1.y-dxgkrnl.patch
git apply ../0002-dxgkrnl-enable-mainline-support.patch
git apply ../0003-bbrv3-fix-clang-build.patch

if [ $? != 0 ]; then
echo "Patch conflict!"
Expand Down
12 changes: 4 additions & 8 deletions wsl2_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CONFIG_KERNEL_ZSTD=y
CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y
CONFIG_WATCH_QUEUE=y
CONFIG_AUDIT=y
CONFIG_NO_HZ_IDLE=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_BPF_SYSCALL=y
Expand Down Expand Up @@ -94,6 +95,7 @@ CONFIG_LEGACY_VSYSCALL_NONE=y
CONFIG_ACPI_NFIT=y
# CONFIG_X86_PM_TIMER is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
CONFIG_X86_AMD_PSTATE=y
# CONFIG_PCI_MMCONFIG is not set
CONFIG_IA32_EMULATION=y
CONFIG_KVM=y
Expand All @@ -102,7 +104,6 @@ CONFIG_X86_SGX_KVM=y
CONFIG_KVM_AMD=y
CONFIG_KVM_XEN=y
CONFIG_KPROBES=y
CONFIG_JUMP_LABEL=y
CONFIG_LTO_CLANG_THIN=y
CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT=y
CONFIG_MODULES=y
Expand Down Expand Up @@ -138,10 +139,8 @@ CONFIG_DAMON_RECLAIM=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_PACKET_DIAG=y
CONFIG_UNIX=y
CONFIG_UNIX_DIAG=y
CONFIG_XFRM_USER=y
CONFIG_INET=y
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_PNP=y
Expand All @@ -155,7 +154,7 @@ CONFIG_TCP_CONG_ADVANCED=y
# CONFIG_TCP_CONG_CUBIC is not set
# CONFIG_TCP_CONG_WESTWOOD is not set
# CONFIG_TCP_CONG_HTCP is not set
CONFIG_TCP_CONG_BBR2=y
CONFIG_TCP_CONG_BBR=y
CONFIG_IPV6_OPTIMISTIC_DAD=y
CONFIG_NETWORK_SECMARK=y
CONFIG_NETWORK_PHY_TIMESTAMPING=y
Expand Down Expand Up @@ -235,7 +234,6 @@ CONFIG_IP_NF_TARGET_MASQUERADE=y
CONFIG_IP_NF_TARGET_NETMAP=y
CONFIG_IP_NF_TARGET_REDIRECT=y
CONFIG_IP_NF_MANGLE=y
CONFIG_IP_NF_TARGET_CLUSTERIP=y
CONFIG_IP_NF_TARGET_ECN=y
CONFIG_IP_NF_TARGET_TTL=y
CONFIG_IP_NF_RAW=y
Expand Down Expand Up @@ -315,6 +313,7 @@ CONFIG_SCSI=y
# CONFIG_SCSI_PROC_FS is not set
CONFIG_BLK_DEV_SD=y
CONFIG_CHR_DEV_SG=y
CONFIG_SCSI_SCAN_ASYNC=y
CONFIG_SCSI_VIRTIO=y
CONFIG_MD=y
# CONFIG_MD_AUTODETECT is not set
Expand Down Expand Up @@ -458,7 +457,6 @@ CONFIG_UIO_DMEM_GENIRQ=y
CONFIG_VFIO=y
CONFIG_VFIO_PCI=y
# CONFIG_VFIO_PCI_IGD is not set
CONFIG_VFIO_MDEV=y
CONFIG_VIRTIO_PCI=y
# CONFIG_VIRTIO_PCI_LEGACY is not set
CONFIG_VIRTIO_PMEM=y
Expand Down Expand Up @@ -499,7 +497,6 @@ CONFIG_FS_DAX=y
CONFIG_FANOTIFY=y
CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
CONFIG_QUOTA=y
# CONFIG_PRINT_QUOTA_WARNING is not set
CONFIG_AUTOFS4_FS=y
CONFIG_FUSE_FS=y
CONFIG_CUSE=y
Expand Down Expand Up @@ -539,7 +536,6 @@ CONFIG_NFSD_BLOCKLAYOUT=y
CONFIG_NFSD_SCSILAYOUT=y
CONFIG_NFSD_FLEXFILELAYOUT=y
CONFIG_NFSD_V4_SECURITY_LABEL=y
# CONFIG_RPCSEC_GSS_KRB5 is not set
CONFIG_CEPH_FS=y
CONFIG_CEPH_FSCACHE=y
CONFIG_CEPH_FS_POSIX_ACL=y
Expand Down

0 comments on commit eba9a99

Please sign in to comment.