From patchwork Fri Nov 30 00:29:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Stringer X-Patchwork-Id: 1005744 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="KiNBb0VD"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 435b080NlQz9s9m for ; Fri, 30 Nov 2018 11:30:48 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727106AbeK3LiI (ORCPT ); Fri, 30 Nov 2018 06:38:08 -0500 Received: from mail-oi1-f177.google.com ([209.85.167.177]:39005 "EHLO mail-oi1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726451AbeK3LiH (ORCPT ); Fri, 30 Nov 2018 06:38:07 -0500 Received: by mail-oi1-f177.google.com with SMTP id i6so3322173oia.6 for ; Thu, 29 Nov 2018 16:30:44 -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; bh=QDMP6uaOHY4LgH6MCZLPhUPlohwHS7jE1yYrtU+U9rY=; b=KiNBb0VDHixmonLKrWHjIILdG6pt5G3ri0cDYXXbea+V0+KKXdHQNdCYxAIDxiNALg EO0OJrHX5jUD1USQyZrP3qaCzSC4o0Ll6yMd37nAOwQuzOag0gDe+B8YhBGkTKfyZdTw bfKqU1sexS5EYzkES6lWzHqed7gc0CMeri0naAjY2ffSSLrWLpmxXbhXxx4k6x0YhzxJ BmrnEgM7PeSV3qJz9D770d+G4EdLkOc035qJtPTY6ZC9vvMuOuXN8nNInncKGOzcIY1R KVkeoZ31rk2rdqgyLmynbexKZnYvZ2/IzgP3BgY+ZhhkGt3hKlzedPHVdJhUrm22q/1H /P8Q== 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; bh=QDMP6uaOHY4LgH6MCZLPhUPlohwHS7jE1yYrtU+U9rY=; b=NzjPsi0gpYERGYc8VRDHUr0voSiI9dAdhfnWIPzLd9e93QZQ9bNZCeS24tOHihjRo9 UIOtegyJVXrYymSDOt4m0sAUUQkTtspJWQLckBzNn6P5TLOEB9k5fequeBi2cQZmiCJq pzMEjH7zHyh4Hfny3/ZsEr8o1ePo7zoZ+6qfRUUa2dQ+WCx99wpfrl75lAMzzE8Uuldx 1mpP4QbJ3rSidce0bMNEyLzLO+wSpEtDKPIHTvYaD37ljbgmdmRu3Ie1hU1Q4VzXYKh0 6yeS6WAulUUl96raaYw0bJtFU5UjQABQ4SvuyYODkoKi3NLmN4eIqVBgAhdb8+P+lXQi GLUg== X-Gm-Message-State: AA+aEWYUseR4AKveIV6ZKcYfIK4P1tTQu5SwC6ouBiNLKVWOtXGzdSCo A3ksJaWcu/+O/LpQHAKNpuE= X-Google-Smtp-Source: AFSGD/VhIbPG4Xgk6gCJ+SXoHFsoCPB4Q3TzKagMF4pf5UlUxsF5/8K0i355s13FktNBvGwFMD7Y3g== X-Received: by 2002:aca:3cc5:: with SMTP id j188mr2079078oia.278.1543537843839; Thu, 29 Nov 2018 16:30:43 -0800 (PST) Received: from localhost.localdomain ([99.0.85.34]) by smtp.gmail.com with ESMTPSA id k207sm2112733oih.58.2018.11.29.16.30.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Nov 2018 16:30:43 -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: [PATCHv2 bpf 2/2] bpf: Improve socket lookup reuseport documentation Date: Thu, 29 Nov 2018 16:29:34 -0800 Message-Id: <20181130002934.21627-2-joe@wand.net.nz> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181130002934.21627-1-joe@wand.net.nz> References: <20181130002934.21627-1-joe@wand.net.nz> 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 38924b306e9f..b73d574356f4 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 465ad585c836..b73d574356f4 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