From patchwork Tue Jan 24 16:07:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Vernet X-Patchwork-Id: 4463 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2243632wrn; Tue, 24 Jan 2023 08:21:01 -0800 (PST) X-Google-Smtp-Source: AMrXdXuQqEJqNDKVl/rA4lZIT2n7Hy/4+ZsPMXU2bFdlI2Nsdtn10qtth4dXY6d96/fhEtBABUx+ X-Received: by 2002:a05:6402:3909:b0:499:bcd7:a968 with SMTP id fe9-20020a056402390900b00499bcd7a968mr32038994edb.22.1674577261610; Tue, 24 Jan 2023 08:21:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674577261; cv=none; d=google.com; s=arc-20160816; b=VOQDYkBLWcG7Zwar0fnl62DkJgy3tT2fj5J5UG82oNnU+QR8Ef8QB6i8ygBlM40jpl uPNMmvfaQON+BTnOLVcjt0oAr+m7s6krOVEONK41CDSnalVv9V6y/Kv5HzLoCG3NY87C fJ3JVMuv3soBPCtb6XxfYiEWYD5Ut90YJktc1fgzm+zgpMXmOiF/JNTRmrRbUjOPz1ps w4Dhg1/4AOCpFtB+iHFnwuOShmeneIbpHCxXvIpRGFQeA6J0PRcgLBnOj+9lOQVpjg5Z QH1mqgpC3dLtUQv9E1A5mQNC6QECsbPz7prC2bLyIJqdYtRpeLeIddz6YNc67w8glNsy A7Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=4oW+kjbdfD2UZ0Y0yY675AjDRpuz5dKDMbgZwwf8UEg=; b=ESjVYNHcDQjc2MSgm4IN1IUHHKo1KEbYkKm/2pQU2+Rh3aOhW8BZjwsLH1n58HA5co cO25FR+N9m0F8cjGr/IBG3zLmvopsU3OJHkvtw4vuAEs+1mDDCFtL4WgzTlZat3I/Ir3 f99qITdRVn7CbHIWebufTauMljDYNOOH101zklaU+R9wjmZ8h6mYs2tKgnDS0lxYq4YY +vD6QIgoPpWmUb41zQRJbmOOkV8gndZA8BcrqZYB1QwiS5asPI/voN0BFBtygGnjiJoC 2r505g74JCYHXe0QX35VDAzonk4gF18U1raulpUPE25xrmBzV8lqmWzBHQfrgN/EzoLZ 78+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f5-20020a1709063f4500b007c170f6b32dsi3069986ejj.516.2023.01.24.08.20.37; Tue, 24 Jan 2023 08:21:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233239AbjAXQJ1 (ORCPT + 99 others); Tue, 24 Jan 2023 11:09:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229956AbjAXQJ0 (ORCPT ); Tue, 24 Jan 2023 11:09:26 -0500 Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03F191ABFC; Tue, 24 Jan 2023 08:09:26 -0800 (PST) Received: by mail-qt1-f172.google.com with SMTP id d16so13428890qtw.8; Tue, 24 Jan 2023 08:09:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4oW+kjbdfD2UZ0Y0yY675AjDRpuz5dKDMbgZwwf8UEg=; b=fiGiClFex72BIS1hZUQTUCTdRaUt7TqJmMc57SbHabC15wBR3mjcpa59Lc25H2U4UC Fg/9yYR6ePWg+9IsoTMjozKA1owCG7d7OyoejW0s+AUMaqSb49ONzvxSDVKCY86O2KF5 Mg3IWjqno4S3cACODGurbr0ffXPZXc1iEkQRv5RlkLHo2BkEx9OOvC/J1q0jD9YfBR1+ +oGj2pL2bo6RBvVJHWVPwXhy6Cqr5mgCfyYhAWU1s8+nOV+sZm9jt/lFC0Xzd1NeNCTb 5XBLlfnQ+JKRku+I+DaJWWwmflaSC6GzdUItlc6rRuKoKUT6UY7ipd71g17HrO0NGFOa /4qg== X-Gm-Message-State: AFqh2krWQ31dOmWvf/XnCCr0dJQm3+obXm15m3Z0r6FZeHOct1xyTMC9 51hWCWU7zg2Jx7Ei65q/1AQ6p5Ob3q0GEqex X-Received: by 2002:ac8:5194:0:b0:3b6:302d:714 with SMTP id c20-20020ac85194000000b003b6302d0714mr44609903qtn.4.1674576564672; Tue, 24 Jan 2023 08:09:24 -0800 (PST) Received: from localhost ([2620:10d:c091:480::1:93a0]) by smtp.gmail.com with ESMTPSA id d7-20020ac800c7000000b003b0b903720esm1495692qtg.13.2023.01.24.08.09.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Jan 2023 08:09:24 -0800 (PST) From: David Vernet To: bpf@vger.kernel.org Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, song@kernel.org, yhs@meta.com, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, tj@kernel.org Subject: [PATCH bpf-next v2 0/4] Enable struct_ops programs to be sleepable Date: Tue, 24 Jan 2023 10:07:58 -0600 Message-Id: <20230124160802.1122124-1-void@manifault.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755921526703873699?= X-GMAIL-MSGID: =?utf-8?q?1755921526703873699?= This is part 2 of https://lore.kernel.org/bpf/20230123232228.646563-1-void@manifault.com/ Changelog: ---------- v1 -> v2: - Add support for specifying sleepable struct_ops programs with struct_ops.s in libbpf (Alexei). - Move failure test case into new dummy_st_ops_fail.c prog file. - Update test_dummy_sleepable() to use struct_ops.s instead of manually setting prog flags. Also remove open_load_skel() helper which is no longer needed. - Fix verifier tests to expect new sleepable prog failure message. David Vernet (4): bpf: Allow BPF_PROG_TYPE_STRUCT_OPS programs to be sleepable libbpf: Support sleepable struct_ops.s section bpf: Pass const struct bpf_prog * to .check_member bpf/selftests: Verify struct_ops prog sleepable behavior include/linux/bpf.h | 4 +- kernel/bpf/verifier.c | 7 ++- net/bpf/bpf_dummy_struct_ops.c | 18 ++++++ net/bpf/test_run.c | 6 ++ net/ipv4/bpf_tcp_ca.c | 3 +- tools/lib/bpf/libbpf.c | 1 + .../selftests/bpf/prog_tests/dummy_st_ops.c | 56 ++++++++++++++----- .../selftests/bpf/progs/dummy_st_ops_common.h | 20 +++++++ .../selftests/bpf/progs/dummy_st_ops_fail.c | 41 ++++++++++++++ ...{dummy_st_ops.c => dummy_st_ops_success.c} | 18 +++--- 10 files changed, 145 insertions(+), 29 deletions(-) create mode 100644 tools/testing/selftests/bpf/progs/dummy_st_ops_common.h create mode 100644 tools/testing/selftests/bpf/progs/dummy_st_ops_fail.c rename tools/testing/selftests/bpf/progs/{dummy_st_ops.c => dummy_st_ops_success.c} (75%)