Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2215871pxj; Sun, 16 May 2021 18:54:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYwTZVQa2yUs1GU1w1E2ChB1u+7pot/0UiX/J5zMkvPz5X/ir+/DepCSK2KFir2r2+hSKY X-Received: by 2002:a17:906:1e44:: with SMTP id i4mr58431090ejj.61.1621216458871; Sun, 16 May 2021 18:54:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621216458; cv=none; d=google.com; s=arc-20160816; b=JUE15CysyxpBr7PfXxUKkOI/IM+wIYOTOCUL5L6YNu2RDSkrHNxB89zhwLnLfqbb6d fUCLLMmS3qT0CnJ3yJKZeU+s/jnPX/lG1XpssuRv3Bz7b1gDU+PnatPBsYu+w14p4jGD vFwYxyZAesQ4HdFGIAhKMN4Y/43GLA8oQQIsyROD+oamRWXouLaQFp+DeEMrrT6NNzOe 25vlqxI+E7RcFwgLSe6mCgyp9we4gbFn18t1Jk71O9T4kHI9Za+NOkXGxLdSNGwhz6sy fSp6LcagLzlA9aPnXizQN2lSQjLNerC9rMH6kU8vTYQjYebxU9bN1iqmnYfr2D4P4qcp xDgQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gyt1CQPX41Y2hG/KqJcCuoJehCJZx0XEIj7EiL7V73Q=; b=rRqr6u0pX2oc4spamPbdWGnPvt1z3rHX3tN3ah4S8QTLhwQZ0bdVS/ZO0xtsBeDZBS xunIEZ4PuSFfZYWo3J0ln6olSexoNnMo9y3uBhZ0l/XJ84qeZm+TXHYjQCGkrg5SGucT 7mw1uD41nBmBX5zHd3VkOiR8BhUZConxzsBPA2GKTEhWeZ+pVmyS20a1ZybIyfYCHMxz gDMv4oPs47s04E+sPNRjNm9T3qo0q4OmsJhkY7ldLyB6ozbn3t/0LTm9KExVSo0/4T8s V0rVHN12ymv49eEZDXS3wbUDjgNiew9KAIpgdyBauRoU5NRpUHKsTxVfuNu7/oUG2xz+ vD5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.co.jp header.s=amazon201209 header.b=IWv50z7a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.co.jp Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hd8si6838546ejc.202.2021.05.16.18.53.55; Sun, 16 May 2021 18:54:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.co.jp header.s=amazon201209 header.b=IWv50z7a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.co.jp Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235036AbhEQA1L (ORCPT + 99 others); Sun, 16 May 2021 20:27:11 -0400 Received: from smtp-fw-80006.amazon.com ([99.78.197.217]:60011 "EHLO smtp-fw-80006.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232331AbhEQA1L (ORCPT ); Sun, 16 May 2021 20:27:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.co.jp; i=@amazon.co.jp; q=dns/txt; s=amazon201209; t=1621211156; x=1652747156; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gyt1CQPX41Y2hG/KqJcCuoJehCJZx0XEIj7EiL7V73Q=; b=IWv50z7aaMxKKf3unxIvntcF9uijJx7rg3nFQVeg7fuLhGMrd0wPFmvM NI/tX3nnx2NZ2Bk4m0Vkv6hhiY0H8wLWPYET25yOtQnXCNsbGfCuzjEVn 7h5x2GVosEa/jqHEs4DxQ3SqEvHbv3Nc3PmboFoKYrrfd6F+SOhHcrY3W o=; X-IronPort-AV: E=Sophos;i="5.82,306,1613433600"; d="scan'208";a="1587889" Received: from pdx4-co-svc-p1-lb2-vlan2.amazon.com (HELO email-inbound-relay-1a-821c648d.us-east-1.amazon.com) ([10.25.36.210]) by smtp-border-fw-80006.pdx80.corp.amazon.com with ESMTP; 17 May 2021 00:25:55 +0000 Received: from EX13MTAUWB001.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-1a-821c648d.us-east-1.amazon.com (Postfix) with ESMTPS id 5370DA11E3; Mon, 17 May 2021 00:25:51 +0000 (UTC) Received: from EX13D04ANC001.ant.amazon.com (10.43.157.89) by EX13MTAUWB001.ant.amazon.com (10.43.161.249) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 17 May 2021 00:25:51 +0000 Received: from 88665a182662.ant.amazon.com (10.43.162.28) by EX13D04ANC001.ant.amazon.com (10.43.157.89) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 17 May 2021 00:25:46 +0000 From: Kuniyuki Iwashima To: "David S . Miller" , Jakub Kicinski , Eric Dumazet , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau CC: Benjamin Herrenschmidt , Kuniyuki Iwashima , Kuniyuki Iwashima , , , Subject: [PATCH v6 bpf-next 10/11] libbpf: Set expected_attach_type for BPF_PROG_TYPE_SK_REUSEPORT. Date: Mon, 17 May 2021 09:22:57 +0900 Message-ID: <20210517002258.75019-11-kuniyu@amazon.co.jp> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210517002258.75019-1-kuniyu@amazon.co.jp> References: <20210517002258.75019-1-kuniyu@amazon.co.jp> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.43.162.28] X-ClientProxiedBy: EX13D21UWA004.ant.amazon.com (10.43.160.252) To EX13D04ANC001.ant.amazon.com (10.43.157.89) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This commit introduces a new section (sk_reuseport/migrate) and sets expected_attach_type to two each section in BPF_PROG_TYPE_SK_REUSEPORT program. Signed-off-by: Kuniyuki Iwashima --- tools/lib/bpf/libbpf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index e2a3cf437814..48df7498226e 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -8820,7 +8820,10 @@ static struct bpf_link *attach_iter(const struct bpf_sec_def *sec, static const struct bpf_sec_def section_defs[] = { BPF_PROG_SEC("socket", BPF_PROG_TYPE_SOCKET_FILTER), - BPF_PROG_SEC("sk_reuseport", BPF_PROG_TYPE_SK_REUSEPORT), + BPF_EAPROG_SEC("sk_reuseport/migrate", BPF_PROG_TYPE_SK_REUSEPORT, + BPF_SK_REUSEPORT_SELECT_OR_MIGRATE), + BPF_EAPROG_SEC("sk_reuseport", BPF_PROG_TYPE_SK_REUSEPORT, + BPF_SK_REUSEPORT_SELECT), SEC_DEF("kprobe/", KPROBE, .attach_fn = attach_kprobe), BPF_PROG_SEC("uprobe/", BPF_PROG_TYPE_KPROBE), -- 2.30.2