From patchwork Sun May 5 11:35:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13654234 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 1249114A96; Sun, 5 May 2024 11:36:11 +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=1714908972; cv=none; b=EtcyBUxuw+IrTdLdE79LieldjYYSQADJ2PDx5q1dU0Nef+Z1mhsm/sS4XYKTqFeSCNO1WSBWXBme3MT5QC/4vbdzHlPzPQAKcLnu7ksISy5Tlu2wu02g1nBMRolk+pwX1SojLce4SlaCkz7VM2PRjIzP7wpcAEwoo3RkPPs2kyg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714908972; c=relaxed/simple; bh=/AC7+LZJDf+efY3dpVitzKY1KWJsSFb1MpmvhpNE41s=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=NzBtWUv8iNhEsspHH0YwipGsvVc+fDQqq9THhKwCViZqTcrqafZvS+po971t6CIN1px22AyFk31XP8kcMrPC22vUM4qtdr8BVpNCxmDC+RWMMg6F9AoW9o3wuzZfG/Bp3q2d7vm1IBSvCa4GJ8A2JMdee7n6Pdq7jHdpO58cooA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DtriQHjD; 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="DtriQHjD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA28BC113CC; Sun, 5 May 2024 11:36:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714908971; bh=/AC7+LZJDf+efY3dpVitzKY1KWJsSFb1MpmvhpNE41s=; h=From:To:Cc:Subject:Date:From; b=DtriQHjDjBrWXWXOM3eMFdQqUl3K52aMEA4m/5khziSQITfyJHnUW2pCWHlFRJqsS idKmwsvWAA7AivuFoO3PQqXg1Aqy4ioZP+SWmmTnaLFCSMqiDJk0ETFQq24YxSSqfc Bt7FixTN1/hS4SI7eL8voYtSCwcvZ2tKzLOITIqDCMdi9xoCaiydOkxqCxL2KjxDsO GgGL/8JnWwxF9B9Cu7PUZhYMcixfVKwjnVgAxOMVBH80+Fr/zhL4uIeNBQSM3BL3JJ HmPGXW0Goz9PCuSYV5yqIVAibx8oFVAxMamE0l8VhFwJzgcGMuwJslHvEVHXJhvcAd GeEyYAVsr6AiQ== 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 , Jakub Sitnicki Cc: Geliang Tang , bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, Geliang Tang Subject: [PATCH bpf-next 0/6] use network helpers, part 4 Date: Sun, 5 May 2024 19:35:07 +0800 Message-ID: X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Geliang Tang This patchset adds post_socket_cb pointer together with 'struct post_socket_opts cb_opts' into struct network_helper_opts to make start_server_addr() helper more flexible. With these modifications, many duplicate codes can be dropped. Patches 1-3 address Martin's comments in the previous series. Geliang Tang (6): selftests/bpf: Add post_socket_cb for network_helper_opts selftests/bpf: Use start_server_addr in sockopt_inherit selftests/bpf: Use start_server_addr in test_tcp_check_syncookie selftests/bpf: Use connect_to_fd in sockopt_inherit selftests/bpf: Use connect_to_fd in test_tcp_check_syncookie selftests/bpf: Drop get_port in test_tcp_check_syncookie tools/testing/selftests/bpf/Makefile | 1 + tools/testing/selftests/bpf/network_helpers.c | 25 ++-- tools/testing/selftests/bpf/network_helpers.h | 4 + .../bpf/prog_tests/sockopt_inherit.c | 63 ++-------- .../bpf/test_tcp_check_syncookie_user.c | 117 ++++-------------- 5 files changed, 61 insertions(+), 149 deletions(-)