From patchwork Sat May 11 03:16:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13662252 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 6597C21A04; Sat, 11 May 2024 03:16:40 +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=1715397401; cv=none; b=t0IWiySwoNOWsXsgcx1qimRYSRFcuovCu3Z+UoqOYJFh6WuIk5SBGx4XxKmmhUteHDzq8X2P7ANy4ecaSn2Z6VbEkSwvhC/cyhwNd+KtU6eWfXAH054TIIp+LDxW1i2OhWW0ApWF5oVFVk01eM4TeWgFhBG2nbOQ03+0N2qP/vE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715397401; c=relaxed/simple; bh=VNZWbyB0sPB4GGLEN/TJoCScuWT9X5M8rRhhLEnSAt0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=FNnKFMhM2v2+rMUzQb4OKL8Mn+nlyAL40pBIn1kLnFQeKZ27B5nFWOJy8K2avM6fBT8c2KUUOi++UZhJhPSGK7MLQouBIgjFcAM/IaqUT3DEf5+JmiRmPXzDpPyy5ubccAY02wOjq4zMfej1/1rGNsKSOp0dRBv5Be4LBCO+W8k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hUrsIVWH; 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="hUrsIVWH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EDCCDC113CC; Sat, 11 May 2024 03:16:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715397400; bh=VNZWbyB0sPB4GGLEN/TJoCScuWT9X5M8rRhhLEnSAt0=; h=From:To:Cc:Subject:Date:From; b=hUrsIVWHsLrJqkvpCZpp6TkrjoXD3gZHxRq144YavEzF0ed4qHJ66gzW+xJvKApR8 19fm5b5rqEr6u1q78fwYvEkKX3hk/qD4i8weJtmGknzILVRYDgqaE73ox0gQg10TYe ZZYWoEmQLoLo4hDANDwkreWCcNe8Vxq8hUqqfwhvXP2aQo2yhc/YFwW1R64oag++lh l7aExx5StYsEUz7X692Qmh5Xs4D17m1epWSWfYjo51+EhiTQboXkuQPqhafJywT7L0 T994h/hRiy2pOQGnFCGjv53+HisLYfe+YwczRJWZ1R3M3LhCzW+40LvnUKq7NjcESX CzZmtBx5OpO4g== 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/4] use network helpers, part 5 Date: Sat, 11 May 2024 11:16:24 +0800 Message-ID: X-Mailer: git-send-email 2.43.0 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 This patchset uses post_socket_cb and post_connect_cb callbacks of struct network_helper_opts to refactor do_test() in bpf_tcp_ca.c to move dctcp test dedicated code out of do_test() into test_dctcp(). Patch 3 adds a new member in post_socket_opts and patch 4 adds a new callback in network_helper_opts. I'm not sure if this is going too far. Geliang Tang (4): selftests/bpf: Use post_socket_cb in connect_to_fd_opts selftests/bpf: Use start_server_addr in bpf_tcp_ca selftests/bpf: Use connect_to_fd_opts in do_test in bpf_tcp_ca selftests/bpf: Add post_connect_cb callback tools/testing/selftests/bpf/network_helpers.c | 13 ++- tools/testing/selftests/bpf/network_helpers.h | 8 +- .../selftests/bpf/prog_tests/bpf_tcp_ca.c | 105 +++++++++++------- 3 files changed, 81 insertions(+), 45 deletions(-)