From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrey Ignatov Subject: [PATCH bpf-next 0/4] bpf: Support socket lookup in CGROUP_SOCK_ADDR progs Date: Thu, 8 Nov 2018 08:54:21 -0800 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Cc: Andrey Ignatov , , , , To: Return-path: Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:60476 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726583AbeKICbu (ORCPT ); Thu, 8 Nov 2018 21:31:50 -0500 Received: from pps.filterd (m0044008.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wA8Gs94C024943 for ; Thu, 8 Nov 2018 08:55:28 -0800 Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0a-00082601.pphosted.com with ESMTP id 2nmre5r59h-12 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 08 Nov 2018 08:55:28 -0800 Sender: netdev-owner@vger.kernel.org List-ID: This patch set makes bpf_sk_lookup_tcp, bpf_sk_lookup_udp and bpf_sk_release helpers available in programs of type BPF_PROG_TYPE_CGROUP_SOCK_ADDR. Patch 1 is a fix for bpf_sk_lookup_udp that was already sent to netdev separately for bpf (stable) tree. Here it's prerequisite for patch 4. Patch 2 is refactoring to prepare for patch 3. Similar refactoring was done as part of "bpf: Extend the sk_lookup() helper to XDP hookpoint." patch published on netdev earlier but not merged yet. This patch set can reuse the work done for xdp if it's merged. This patch doesn't make any logic changes and simply moves code around. Patch 3 is the main patch in the set, it makes the helpers available for BPF_PROG_TYPE_CGROUP_SOCK_ADDR and provides more details about use-case. Patch 4 adds selftest for new functionality. Andrey Ignatov (4): bpf: Fix IPv6 dport byte order in bpf_sk_lookup_udp bpf: Split bpf_sk_lookup bpf: Support socket lookup in CGROUP_SOCK_ADDR progs selftest/bpf: Use bpf_sk_lookup_{tcp,udp} in test_sock_addr net/core/filter.c | 96 +++++++++++++++++---- tools/testing/selftests/bpf/connect4_prog.c | 43 +++++++-- tools/testing/selftests/bpf/connect6_prog.c | 56 +++++++++--- 3 files changed, 156 insertions(+), 39 deletions(-) -- 2.17.1