From patchwork Fri Nov 30 23:32:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Stringer X-Patchwork-Id: 1006255 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=wand.net.nz Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mpk94GRg"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 4369fP5V6Dz9s9G for ; Sat, 1 Dec 2018 10:32:29 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726778AbeLAKnY (ORCPT ); Sat, 1 Dec 2018 05:43:24 -0500 Received: from mail-oi1-f171.google.com ([209.85.167.171]:37153 "EHLO mail-oi1-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726013AbeLAKnX (ORCPT ); Sat, 1 Dec 2018 05:43:23 -0500 Received: by mail-oi1-f171.google.com with SMTP id y23so6222735oia.4 for ; Fri, 30 Nov 2018 15:32:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kMDpzasJ3I8GObehGMmSpSTnblhle5lJziYjv6HvZ+Q=; b=mpk94GRgJga9B7xxFD5nBdLlaH//06L3N/4Kb53hsOZVB+7+pH7Tb5xoAa6MzDCxaO 3bJ+hSWdEBZZa5WL1I7taRn+ZcdLXojUQVGYvYcc1XdJoFB9CiObUKdq3LTaFhCgkCKy hU25VRZi8cpPC/UezqVaTsPq4Qzqa0rH1ZZKpX5fyPxDhEBGTs/rsaExrAiC83G/Kbm8 ivUHScpKquPvCFteIkskQY7kLP+XEyw5j25Cnb127dDVj/mFcxRb0e8wUUxxz+zAmjlq zm6DR+muBCGFDwFhvAt4Oo3Drs8xuH53JI/2Wa7GEQDpjVcQWV/VWRVlFb8AC0S/E9qP uBjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=kMDpzasJ3I8GObehGMmSpSTnblhle5lJziYjv6HvZ+Q=; b=j5w2OqaHiqSTn4w7584ckBrPcalY4qWnI9YPeaVs150yp0zL8y8Gm1fPHVgRO1gRPP KhW8Dipw4nAuIO5lueGK6Obilz83G0BO9w4Qi9SdrP0aN72sN5sBNcnjg2W9Y56/z5yv 8t+eFyPUyPK9hlAehQM5zpHQNstYjRfoAXKG1joe9CDQKvgXIfRF6+1WvXWGUXhz+qw6 hCtnJ9BFPQb1AvAaP3UqEdlmSXmBcp5qsAD77Bgh3inPEC1c1rCVUFSRoXKfdYs7Ly7m hHRHc2ySxfc8UNq6P7DunMJqSaexvTPY3k+pUiGcfpodHvNkdau5E6m+aau6b+YiyVJs Hnog== X-Gm-Message-State: AA+aEWZ0sP7v79vP2kEYNBHzNrfyMhiw2NtPt8f7NNK8yFQW/Kj+MoFR GJbw3T5K2qV4mrQM/c/2juI= X-Google-Smtp-Source: AFSGD/W88+ltGW3/iewgugWFmtd+ITPlQt5nQgkFi4pEZX+TMrG9W2Mhilu0nDym04RBX2Jg21dLNg== X-Received: by 2002:a54:4088:: with SMTP id i8mr4364660oii.324.1543620746995; Fri, 30 Nov 2018 15:32:26 -0800 (PST) Received: from localhost.localdomain ([99.0.85.34]) by smtp.gmail.com with ESMTPSA id 62sm2458942otu.42.2018.11.30.15.32.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Nov 2018 15:32:26 -0800 (PST) From: Joe Stringer To: daniel@iogearbox.net, ast@kernel.org Cc: netdev@vger.kernel.org, dsahern@gmail.com, nicolas.dichtel@6wind.com Subject: [PATCHv3 bpf 2/2] bpf: Improve socket lookup reuseport documentation Date: Fri, 30 Nov 2018 15:32:21 -0800 Message-Id: <20181130233221.8433-2-joe@wand.net.nz> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181130233221.8433-1-joe@wand.net.nz> References: <20181130233221.8433-1-joe@wand.net.nz> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Improve the wording around socket lookup for reuseport sockets, and ensure that both bpf.h headers are in sync. Signed-off-by: Joe Stringer --- include/uapi/linux/bpf.h | 4 ++++ tools/include/uapi/linux/bpf.h | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index ad68b472dad2..47f620b5cc5c 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h @@ -2203,6 +2203,8 @@ union bpf_attr { * **CONFIG_NET** configuration option. * Return * Pointer to *struct bpf_sock*, or NULL in case of failure. + * For sockets with reuseport option, the *struct bpf_sock* + * result is from reuse->socks[] using the hash of the tuple. * * struct bpf_sock *bpf_sk_lookup_udp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u64 netns, u64 flags) * Description @@ -2237,6 +2239,8 @@ union bpf_attr { * **CONFIG_NET** configuration option. * Return * Pointer to *struct bpf_sock*, or NULL in case of failure. + * For sockets with reuseport option, the *struct bpf_sock* + * result is from reuse->socks[] using the hash of the tuple. * * int bpf_sk_release(struct bpf_sock *sk) * Description diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index de2072ef475b..47f620b5cc5c 100644 --- a/tools/include/uapi/linux/bpf.h +++ b/tools/include/uapi/linux/bpf.h @@ -2203,8 +2203,8 @@ union bpf_attr { * **CONFIG_NET** configuration option. * Return * Pointer to *struct bpf_sock*, or NULL in case of failure. - * For sockets with reuseport option, *struct bpf_sock* - * return is from reuse->socks[] using hash of the packet. + * For sockets with reuseport option, the *struct bpf_sock* + * result is from reuse->socks[] using the hash of the tuple. * * struct bpf_sock *bpf_sk_lookup_udp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u64 netns, u64 flags) * Description @@ -2239,8 +2239,8 @@ union bpf_attr { * **CONFIG_NET** configuration option. * Return * Pointer to *struct bpf_sock*, or NULL in case of failure. - * For sockets with reuseport option, *struct bpf_sock* - * return is from reuse->socks[] using hash of the packet. + * For sockets with reuseport option, the *struct bpf_sock* + * result is from reuse->socks[] using the hash of the tuple. * * int bpf_sk_release(struct bpf_sock *sk) * Description