From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrey Ignatov Subject: [PATCH bpf-next 0/4] Support bpf_get_socket_cookie in more prog types Date: Mon, 30 Jul 2018 09:04:32 -0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Cc: Andrey Ignatov , , , , To: Return-path: Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:49838 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726760AbeG3Rnk (ORCPT ); Mon, 30 Jul 2018 13:43:40 -0400 Received: from pps.filterd (m0109331.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w6UG3wuH010961 for ; Mon, 30 Jul 2018 09:08:01 -0700 Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2kj53g05ew-7 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 30 Jul 2018 09:08:01 -0700 Sender: netdev-owner@vger.kernel.org List-ID: This patch set adds support to call bpf_get_socket_cookie() helper from two more program types: * BPF_PROG_TYPE_CGROUP_SOCK_ADDR; * BPF_PROG_TYPE_SOCK_OPS. Patch 1 adds kernel support and provides more details. Patch 2 syncs UAPI changes to tools/. Patch 3 adds missing helper to bpf_helpers.h. Patch 4 adds selftest for new functionality. Andrey Ignatov (4): bpf: Support bpf_get_socket_cookie in more prog types bpf: Sync bpf.h to tools/ selftests/bpf: Add bpf_get_socket_cookie to bpf_helpers.h selftests/bpf: Test for get_socket_cookie include/uapi/linux/bpf.h | 14 + net/core/filter.c | 28 ++ tools/include/uapi/linux/bpf.h | 14 + tools/testing/selftests/bpf/Makefile | 6 +- tools/testing/selftests/bpf/bpf_helpers.h | 2 + .../selftests/bpf/socket_cookie_prog.c | 60 +++++ .../selftests/bpf/test_socket_cookie.c | 249 ++++++++++++++++++ 7 files changed, 371 insertions(+), 2 deletions(-) create mode 100644 tools/testing/selftests/bpf/socket_cookie_prog.c create mode 100644 tools/testing/selftests/bpf/test_socket_cookie.c -- 2.17.1