Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2390877pxu; Mon, 7 Dec 2020 05:32:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJwUToycWH3IX9nV6jkwV/Np8QomuLEIQGb7jxKyudbwrQj3wQfIzV9hWcEtB09T0wKG8+We X-Received: by 2002:a05:6402:4cf:: with SMTP id n15mr19966060edw.241.1607347945775; Mon, 07 Dec 2020 05:32:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607347945; cv=none; d=google.com; s=arc-20160816; b=0SScPqT6NhrXuFG5/iveTIi76XiV/1v8EuP8RQoTrYIngmlIk+C4kjSDrOAhK9QyiM xnFA+MtokPw4dGAHbfBOfeyyw8euS2Ar8GLA+rKTy3xSx7JoHTxLiWmBi7ud/XEXzBMh raOSrLjil/PHaJkHME+pQMXAy/MXeji+8077+IJiQdvk/R33nqghtRkRYXoHCRgtggrj H0lNbr+gdf2bCuJqsRnk7nKBW05bosEnOZ8v+4+QPUqcO0b7CSK/qkIDW7O3ZnDSOtVx bBaAfvMnONOQrO+tH7BudeGf5XXfNL//QB0XViHrvCUuOHDzrOESyN1x3JUbLvDFA9Dq /LAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=zZWQroLY9J+nGi+ykaI4WpcwCCgdqU/PMdq9gqllP8M=; b=UO9a1wJrsKctFUZgu3L2E2B4Thqe/Ui5S4uDRnFWTIxf3z9d6Y6Zco7IC7ksi+afS/ fOWkpQmHrzTXCc1MnpGy0yAtRXHqz602ckduzBakFIoOoe8HjfcqMwBRU6djOB8riZXM MhYFbzVwA4kl83/gs0czxtGHant5ofOacTehQHSKHZ/X6b+vtlMA/HEgGxaEva6LNQAI 5ESlc1nX4DQzjkgFll4h63O/KC+wyi8NdfeCNLgtB/d2DjJLV3hwQjgoGzcDHK6XMBEz WVXF/x2mAl11TCseTbKgr0HxldoFE9TXGIPEZlnEt5G3kATEWhF4Mty0Fbh/Rkbrp1kH jzzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.co.jp header.s=amazon201209 header.b="lIbaP/P9"; 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 di13si5818366edb.412.2020.12.07.05.32.03; Mon, 07 Dec 2020 05:32:25 -0800 (PST) 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="lIbaP/P9"; 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 S1726531AbgLGN2W (ORCPT + 99 others); Mon, 7 Dec 2020 08:28:22 -0500 Received: from smtp-fw-9103.amazon.com ([207.171.188.200]:54916 "EHLO smtp-fw-9103.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725917AbgLGN2U (ORCPT ); Mon, 7 Dec 2020 08:28:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.co.jp; i=@amazon.co.jp; q=dns/txt; s=amazon201209; t=1607347699; x=1638883699; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=zZWQroLY9J+nGi+ykaI4WpcwCCgdqU/PMdq9gqllP8M=; b=lIbaP/P9pB0fX+tDTg8pBWongkWfx23+avN5YtWJ63RzYcqV8uHUDDeo PmqMLA7uGpOQ3e0W0nKF0FPgFdIWB2SUFqUmig269CBBrUEoAITd6Z23g bJfdmmNjmG+Qod7Oazq5gsDhm3uAijfFhYwAyfi4JNAbzwOVbvWSKeOPu w=; X-IronPort-AV: E=Sophos;i="5.78,399,1599523200"; d="scan'208";a="901122159" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-1d-2c665b5d.us-east-1.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-9103.sea19.amazon.com with ESMTP; 07 Dec 2020 13:27:53 +0000 Received: from EX13MTAUWB001.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-1d-2c665b5d.us-east-1.amazon.com (Postfix) with ESMTPS id 4B0C0A1E56; Mon, 7 Dec 2020 13:27:50 +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; Mon, 7 Dec 2020 13:27:50 +0000 Received: from 38f9d3582de7.ant.amazon.com (10.43.161.43) by EX13D04ANC001.ant.amazon.com (10.43.157.89) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 7 Dec 2020 13:27:45 +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 v2 bpf-next 09/13] libbpf: Set expected_attach_type for BPF_PROG_TYPE_SK_REUSEPORT. Date: Mon, 7 Dec 2020 22:24:52 +0900 Message-ID: <20201207132456.65472-10-kuniyu@amazon.co.jp> X-Mailer: git-send-email 2.17.2 (Apple Git-113) In-Reply-To: <20201207132456.65472-1-kuniyu@amazon.co.jp> References: <20201207132456.65472-1-kuniyu@amazon.co.jp> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.161.43] X-ClientProxiedBy: EX13D37UWC002.ant.amazon.com (10.43.162.123) 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 9be88a90a4aa..ba64c891a5e7 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -8471,7 +8471,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.17.2 (Apple Git-113)