From eba9a998cee5977e58aa18d0780ec8da321271bc Mon Sep 17 00:00:00 2001 From: Locietta Date: Wed, 30 Aug 2023 01:13:15 +0800 Subject: [PATCH] [Config] Backport Config Changes from Upstreams (#42) * 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) --- 0003-bbrv3-fix-clang-build.patch | 43 ++++++++++++++++++++++++++++++++ config.sh | 1 + wsl2_defconfig | 12 +++------ 3 files changed, 48 insertions(+), 8 deletions(-) create mode 100644 0003-bbrv3-fix-clang-build.patch diff --git a/0003-bbrv3-fix-clang-build.patch b/0003-bbrv3-fix-clang-build.patch new file mode 100644 index 0000000..9d531cb --- /dev/null +++ b/0003-bbrv3-fix-clang-build.patch @@ -0,0 +1,43 @@ +From 229949907e120db70b12fa76e34a9b4cc013c7c9 Mon Sep 17 00:00:00 2001 +From: xingxing +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 + diff --git a/config.sh b/config.sh index a2214e5..a9cc81a 100755 --- a/config.sh +++ b/config.sh @@ -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!" diff --git a/wsl2_defconfig b/wsl2_defconfig index 9131578..5761d39 100644 --- a/wsl2_defconfig +++ b/wsl2_defconfig @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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