From: John Fastabend Subject: [PATCH bpf-next 0/3] add size field to sk_msg_md Date: Sun, 16 Dec 2018 15:47:03 -0800 Message-ID: <1545004026-5127-1-git-send-email-john.fastabend@gmail.com> Cc: netdev@vger.kernel.org, john.fastabend@gmail.com To: daniel@iogearbox.net, ast@kernel.org Return-path: Received: from mail-io1-f65.google.com ([209.85.166.65]:44291 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731036AbeLPXrS (ORCPT ); Sun, 16 Dec 2018 18:47:18 -0500 Received: by mail-io1-f65.google.com with SMTP id r200so8668115iod.11 for ; Sun, 16 Dec 2018 15:47:18 -0800 (PST) Sender: netdev-owner@vger.kernel.org List-ID: This adds a size field to the sk_msg_md data structure used by SK_MSG programs. Without this in the zerocopy case and in the copy case where multiple iovs are in use its difficult to know how much data can be pulled in. The normal method of reading data and data_end only give the current contiguous buffer. BPF programs can attempt to pull in extra data but have to guess if it exists. This can result in multiple "guesses" its much better if we know upfront the size of the sk_msg. John Fastabend (3): bpf: sockmap, metadata support for reporting length of message bpf: add tools lib/include support sk_msg_md size field bpf: sk_msg, add tests for size field include/linux/skmsg.h | 3 +++ include/uapi/linux/bpf.h | 1 + net/core/filter.c | 6 ++++++ tools/include/uapi/linux/bpf.h | 1 + tools/testing/selftests/bpf/test_verifier.c | 16 +++++++++++++--- 5 files changed, 24 insertions(+), 3 deletions(-) -- 2.7.4