From patchwork Thu Apr 25 03:23:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13642841 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 79D051C6A8; Thu, 25 Apr 2024 03:24:22 +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=1714015462; cv=none; b=GH0lDG3m4E/X7Vii9x6XXuFvreNADY+cILxrpMoYjzJmbAZZuWwHmhjQc5lsaNXTjUXnbPt16haXWKdCsH9Um1U6KCoxjZp3N/zGXg5DPv+aU5Y2ii5iVFbQ5axhSIqFrw5Hti4iWIWNwrYMna8xg/s3glsXnjNHnZ6YvwNYPng= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714015462; c=relaxed/simple; bh=LYWNoznwAqbIjH82tdL14xos7Rbx4vG9o/9WhTJVG6s=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=G4KgT/ZnQl5MA8KK075gozAIOANdPDFdfUN3Bx6C8VFJb7fhQe/7hLuOxpdywjN7Nynf8tI06jVTTP0KRYLymtzsCAShVwHG5sZXj5vUk7Vf2Q/bJ65TLl+8Z1/Gq/t9WIGup6xjPLMWmvTzvBfODXCqgdsK/X4AwZbsSJxER+c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WfG/Pp7V; 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="WfG/Pp7V" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13B2AC113CC; Thu, 25 Apr 2024 03:24:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714015462; bh=LYWNoznwAqbIjH82tdL14xos7Rbx4vG9o/9WhTJVG6s=; h=From:To:Cc:Subject:Date:From; b=WfG/Pp7V7A6KledbExjZwCUMIUQlTOxfpqMVI0RyA7JMmhPi7xx06Roc8ctSX3EpJ 6u4uMaZAAJTRXVBflC3ebxksMUbOkSbIKn1zT7ttNjWoBos8jXYI+y/PeQ/YwWbvFY xFPpf8ZqAHshvKYTl6+k6gEGSDqRw1odEA0vSHOz4LMZ8eW89L+PzQXJujQL3e5eUq mF8KXSvXaCsT+9t7A5rGO/3HO7rK0b7aivXBAxNiVmmgzp2MWLZELP/+AyNenO2UKE 5B8wTGyCfiM1yw2Gp833+Hxpx1jnwFf3JfCaWsQwYD3HPNGfxk1yBQwcQPRLh7Fpg0 JdAdnMkZSuIBQ== 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, Geliang Tang Subject: [PATCH bpf-next 0/6] use network helpers, part 3 Date: Thu, 25 Apr 2024 11:23:40 +0800 Message-Id: X-Mailer: git-send-email 2.40.1 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 opts argument for __start_server, and adds setsockopt pointer together with optval and optlen into struct network_helper_opts to make start_server_addr helper more flexible. With these modifications, many duplicate codes can be dropped. Patch 4 addresses comments of Martin and Eduard in the previous series. Geliang Tang (6): selftests/bpf: Add opts argument for __start_server selftests/bpf: Make start_mptcp_server static selftests/bpf: Drop start_server_proto helper selftests/bpf: Add setsockopt for network_helper_opts selftests/bpf: Use start_server_addr in sockopt_inherit selftests/bpf: Use start_server_addr in test_tcp_check_syncookie tools/testing/selftests/bpf/Makefile | 1 + tools/testing/selftests/bpf/network_helpers.c | 53 ++++++++------- tools/testing/selftests/bpf/network_helpers.h | 5 +- .../testing/selftests/bpf/prog_tests/mptcp.c | 16 +++++ .../bpf/prog_tests/sockopt_inherit.c | 34 ++++------ .../bpf/test_tcp_check_syncookie_user.c | 64 ++++++------------- 6 files changed, 78 insertions(+), 95 deletions(-)