From patchwork Thu Jul 29 23:36:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Iwashima, Kuniyuki" X-Patchwork-Id: 12410105 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1C74C4338F for ; Thu, 29 Jul 2021 23:37:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7D0C260EBB for ; Thu, 29 Jul 2021 23:37:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235206AbhG2Xh1 (ORCPT ); Thu, 29 Jul 2021 19:37:27 -0400 Received: from smtp-fw-6002.amazon.com ([52.95.49.90]:62976 "EHLO smtp-fw-6002.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235179AbhG2XhY (ORCPT ); Thu, 29 Jul 2021 19:37:24 -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=1627601842; x=1659137842; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Ue07W/Z0VJ2j1XU1R2r8p3b/MCrZd/T/7jeVdKxGJcM=; b=S16MRM1fklNPmclYytwfQYcduToJ80AJjpS31gjMHQ/Od2r8kiiZN8Xn N39obe/aQ10vEBxjyzgLXQ7hlaHI940SfnCPVRVDzuchESdSy2a1tE+pP GXSxrA5DUdxAp3+ncUm8GA5fAVQJxg+wj4m8MZzDr/NPMTa/O1159bvCx A=; X-IronPort-AV: E=Sophos;i="5.84,280,1620691200"; d="scan'208";a="128930036" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-1d-74cf8b49.us-east-1.amazon.com) ([10.43.8.2]) by smtp-border-fw-6002.iad6.amazon.com with ESMTP; 29 Jul 2021 23:37:21 +0000 Received: from EX13MTAUWB001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1d-74cf8b49.us-east-1.amazon.com (Postfix) with ESMTPS id 0818BC01C0; Thu, 29 Jul 2021 23:37:19 +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.23; Thu, 29 Jul 2021 23:37:19 +0000 Received: from 88665a182662.ant.amazon.com (10.43.162.164) by EX13D04ANC001.ant.amazon.com (10.43.157.89) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Thu, 29 Jul 2021 23:37:14 +0000 From: Kuniyuki Iwashima To: "David S. Miller" , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , "Song Liu" , Yonghong Song , John Fastabend , KP Singh CC: Benjamin Herrenschmidt , Kuniyuki Iwashima , Kuniyuki Iwashima , , Subject: [PATCH bpf-next 0/2] BPF iterator for UNIX domain socket. Date: Fri, 30 Jul 2021 08:36:43 +0900 Message-ID: <20210729233645.4869-1-kuniyu@amazon.co.jp> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Originating-IP: [10.43.162.164] X-ClientProxiedBy: EX13D24UWB004.ant.amazon.com (10.43.161.4) To EX13D04ANC001.ant.amazon.com (10.43.157.89) Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net This patch set adds BPF iterator support for UNIX domain socket. The first patch implements it and the second adds a selftest. Kuniyuki Iwashima (2): bpf: af_unix: Implement BPF iterator for UNIX domain socket. selftest/bpf: Implement sample UNIX domain socket iterator program. include/linux/btf_ids.h | 3 +- net/unix/af_unix.c | 78 +++++++++++++++++++ .../selftests/bpf/prog_tests/bpf_iter.c | 17 ++++ .../selftests/bpf/progs/bpf_iter_unix.c | 75 ++++++++++++++++++ 4 files changed, 172 insertions(+), 1 deletion(-) create mode 100644 tools/testing/selftests/bpf/progs/bpf_iter_unix.c