Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp4166101pxy; Mon, 26 Apr 2021 20:51:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5ai7GtWW9pVFCMhbcXwShgRdV99AUO3wTs9C6UbLmxeD3Ac7Me2EmuFhGZuOVBfBgj+BG X-Received: by 2002:a17:90b:1995:: with SMTP id mv21mr2766276pjb.19.1619495502922; Mon, 26 Apr 2021 20:51:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619495502; cv=none; d=google.com; s=arc-20160816; b=KDBv0YqparnLXYMDtcGNdusaipm2W8CDVM487GHsvjRsMi4MPMxPtyA1q4JsKqiag3 VG+xG02OEMF8W2vlTHsnvMSJLEoy9NYJgNM7K8DItXCiEpgFBBn4e8dT/xw/kQpbdMwH vzN9Cwmq4cVBmDE4idsgSbSBB+Nd+1g4Av4K/XYy1OaPksj4Yxhv/Yf7FP9JdelpU8FY QuZAoqpoD3xwCdVG884MwX38YzKABn6XUh2hWy+HeeloIDpJUeZ4jJFfyMISg5VYkiQz ADG6aehVKp1CAlmW/RfCu67AcvQVUZuR93zIJi4VFE9UtJydIILgY1rnB31naGcYRVQ9 Hj2w== 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=lqC496C337beUNNmGmonZvSwADhcguklhzGYClsS5NU=; b=v6skp5O/IiVpx6jD7qt7cWfSZwiaw5y9nwwUVOdpnTPv0dkLApeZYnpacGbpmxfUeG HO0UlSsNfbBGQMZMLUcxpCsUqkAjm5A0QRxmQym070InpeZb6+45iR/6+88heYahlKR2 jDmTmdNiYQQQcynfKI092LL44Wd1VyHcmODBP6MKyeNtky8gAyQRQQjS+bAZTZIZPkGL SR8tN2DQx5k0+319K4Mtur3Nq7g/BiWnxs2vZjat4c6jWqCpvwiLjxV/m9/zbxrqhBM2 79XjBHkzrRZKMhX2aCNp2eO8ClxR1Kv5bh7jEymiuh0d8o9YxCL39ef8JxIfcW95uGIM K5og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.co.jp header.s=amazon201209 header.b=goAMOo6D; 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 v187si2040116pfv.322.2021.04.26.20.51.30; Mon, 26 Apr 2021 20:51:42 -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=goAMOo6D; 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 S234406AbhD0DvW (ORCPT + 99 others); Mon, 26 Apr 2021 23:51:22 -0400 Received: from smtp-fw-4101.amazon.com ([72.21.198.25]:17917 "EHLO smtp-fw-4101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231363AbhD0DvT (ORCPT ); Mon, 26 Apr 2021 23:51:19 -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=1619495437; x=1651031437; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lqC496C337beUNNmGmonZvSwADhcguklhzGYClsS5NU=; b=goAMOo6DKtvhh6LvGxBYCxMGOlXO/aTaacr6x/kQ+RGN3i4Hi4xOu0mn HbrgQAync7k7OK3eujFdHNPPXVi1Ftz54QdT1xicG74clsCKhiFGibhi1 4cAYUmeWE4Sae783ceXSrVR7EGSvLHSDXb2xvoFHy0apoOY379Fe2L9Be U=; X-IronPort-AV: E=Sophos;i="5.82,254,1613433600"; d="scan'208";a="104127413" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-1e-c7f73527.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-4101.iad4.amazon.com with ESMTP; 27 Apr 2021 03:49:37 +0000 Received: from EX13MTAUWB001.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-1e-c7f73527.us-east-1.amazon.com (Postfix) with ESMTPS id CC0BBC00A8; Tue, 27 Apr 2021 03:49:33 +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.2; Tue, 27 Apr 2021 03:49:32 +0000 Received: from 88665a182662.ant.amazon.com (10.43.162.93) by EX13D04ANC001.ant.amazon.com (10.43.157.89) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 27 Apr 2021 03:49:27 +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 v4 bpf-next 10/11] libbpf: Set expected_attach_type for BPF_PROG_TYPE_SK_REUSEPORT. Date: Tue, 27 Apr 2021 12:46:22 +0900 Message-ID: <20210427034623.46528-11-kuniyu@amazon.co.jp> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210427034623.46528-1-kuniyu@amazon.co.jp> References: <20210427034623.46528-1-kuniyu@amazon.co.jp> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.43.162.93] X-ClientProxiedBy: EX13D18UWC002.ant.amazon.com (10.43.162.88) 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 a1cddd17af7d..538849fb6bb7 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -8818,7 +8818,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