From patchwork Thu Apr 11 01:03:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13625270 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 58A4C3201; Thu, 11 Apr 2024 01:03:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712797413; cv=none; b=M9+utYSLGj8/wVkI9Og7CBo1OKO/ChNx/Z6MX1O+b0+OO2OaHSx/A3hgOU9qTZPbclDMVsnCLa22etwDOTTDZ0AW+bPoTihKY4QJ9P82hFcJPyiTAXct+/xSbUnqLtA5TNBSBPmX4BlDBFSRGRraJruvqZcRGRD8jQcK2IaLDJY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712797413; c=relaxed/simple; bh=q8IrRxuw4+n3BjswybWNxHXs1xvEhWvtFUpvujWJo04=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=aYbqHRA2e5AePQDahoxFzk6AaMpFoJzFtyrVLkoOu6uGt5GxhokpZ3r1u5JNdR1dECvopApHHXdYk5ilIYPTvyoZZ/2LRnZloWeWNNAaKhrtT3Bjd+bBUNIXJ/RwzJGAxMqQpbLrx2Uk5TFUdCCYqNOmGQ3yp+CcxXOCQh5i44M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=K2jDtHCF; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="K2jDtHCF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0162C433F1; Thu, 11 Apr 2024 01:03:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712797412; bh=q8IrRxuw4+n3BjswybWNxHXs1xvEhWvtFUpvujWJo04=; h=From:To:Cc:Subject:Date:From; b=K2jDtHCFtLxlJMXCOGzYHp2+je+Qt3mtFTC75g5B7mna6lXfFZk892Wbj0af87Hfy Yd/aHGozp2EvIjITFgU2gK2UhHM/v1O3VdRZBAnZzUiTL7l1Qg4E55C7istjdTLO0Y KASg9AkgQRJ/wG+UzC4NHhEIPQNm/G+hezpdD2UfJRycQB05UiOvkwLAyP4mmSvr6i SrPWQKRLAFU3mwPumfe7VPGrFbTAzUksiot4mS0fnd/lPONCQxuO+34lInDT4IFPgO 10tzOF8K7yv5gfs/hpFshY+t7M8HKL6Wc7NdeGI5F/jVz7kte/KQoVk5Sr/rjVwx6a k7A1EXzgl0vSw== From: Geliang Tang To: Andrii Nakryiko , Eduard Zingerman , Mykola Lysenko , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Shuah Khan Cc: Geliang Tang , bpf@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH bpf-next v2 00/14] use start_server and connect_to helpers Date: Thu, 11 Apr 2024 09:03:08 +0800 Message-Id: X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: bpf@iogearbox.net From: Geliang Tang v2: - update patch 6 only, fix errors reported by CI. This patchset uses public helpers start_server_* and connect_to_* defined in network_helpers.c to drop duplicate code. Geliang Tang (14): selftests/bpf: Add start_server_addr helper selftests/bpf: Use start_server_addr in cls_redirect selftests/bpf: Use connect_to_addr in cls_redirect selftests/bpf: Use start_server_addr in sk_assign selftests/bpf: Use connect_to_addr in sk_assign selftests/bpf: Use log_err in network_helpers selftests/bpf: Use start_server_addr in test_sock_addr selftests/bpf: Use connect_to_addr in test_sock_addr selftests/bpf: Add function pointer for __start_server selftests/bpf: Add start_server_setsockopt helper selftests/bpf: Use start_server_setsockopt in sockopt_inherit selftests/bpf: Use connect_to_fd in sockopt_inherit selftests/bpf: Use start_server_* in test_tcp_check_syncookie selftests/bpf: Use connect_to_addr in test_tcp_check_syncookie tools/testing/selftests/bpf/Makefile | 4 +- tools/testing/selftests/bpf/network_helpers.c | 50 ++++++++---- tools/testing/selftests/bpf/network_helpers.h | 4 + .../selftests/bpf/prog_tests/cls_redirect.c | 38 +--------- .../selftests/bpf/prog_tests/sk_assign.c | 53 +------------ .../bpf/prog_tests/sockopt_inherit.c | 64 ++++------------ tools/testing/selftests/bpf/test_sock_addr.c | 74 ++---------------- .../bpf/test_tcp_check_syncookie_user.c | 76 +++---------------- 8 files changed, 83 insertions(+), 280 deletions(-)