Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/817701/?format=api
{ "id": 817701, "url": "http://patchwork.ozlabs.org/api/patches/817701/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/b16163e3a4fa4d772edeabd8743acb4a07206bb9.1506114055.git.pabeni@redhat.com/", "project": { "id": 7, "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api", "name": "Linux network development", "link_name": "netdev", "list_id": "netdev.vger.kernel.org", "list_email": "netdev@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<b16163e3a4fa4d772edeabd8743acb4a07206bb9.1506114055.git.pabeni@redhat.com>", "list_archive_url": null, "date": "2017-09-22T21:06:25", "name": "[RFC,01/11] net: add support for noref skb->sk", "commit_ref": null, "pull_url": null, "state": "rfc", "archived": true, "hash": "a2511b64ac7631c8bcd3dd8447557c19379d59be", "submitter": { "id": 67312, "url": "http://patchwork.ozlabs.org/api/people/67312/?format=api", "name": "Paolo Abeni", "email": "pabeni@redhat.com" }, "delegate": { "id": 34, "url": "http://patchwork.ozlabs.org/api/users/34/?format=api", "username": "davem", "first_name": "David", "last_name": "Miller", "email": "davem@davemloft.net" }, "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/b16163e3a4fa4d772edeabd8743acb4a07206bb9.1506114055.git.pabeni@redhat.com/mbox/", "series": [ { "id": 4709, "url": "http://patchwork.ozlabs.org/api/series/4709/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=4709", "date": "2017-09-22T21:06:24", "name": "udp: full early demux for unconnected sockets", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/4709/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/817701/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/817701/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<netdev-owner@vger.kernel.org>", "X-Original-To": "patchwork-incoming@ozlabs.org", "Delivered-To": "patchwork-incoming@ozlabs.org", "Authentication-Results": [ "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)", "ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com", "ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=pabeni@redhat.com" ], "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xzQyw4kghz9sP1\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat, 23 Sep 2017 07:07:04 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752706AbdIVVHB (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 22 Sep 2017 17:07:01 -0400", "from mx1.redhat.com ([209.132.183.28]:44696 \"EHLO mx1.redhat.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1752694AbdIVVG6 (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tFri, 22 Sep 2017 17:06:58 -0400", "from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 0DA22C04B318;\n\tFri, 22 Sep 2017 21:06:58 +0000 (UTC)", "from dhcppc0.redhat.com (ovpn-116-39.ams2.redhat.com\n\t[10.36.116.39])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 583175EE02;\n\tFri, 22 Sep 2017 21:06:56 +0000 (UTC)" ], "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com 0DA22C04B318", "From": "Paolo Abeni <pabeni@redhat.com>", "To": "netdev@vger.kernel.org", "Cc": "\"David S. Miller\" <davem@davemloft.net>,\n\tPablo Neira Ayuso <pablo@netfilter.org>, Florian Westphal <fw@strlen.de>,\n\tEric Dumazet <edumazet@google.com>,\n\tHannes Frederic Sowa <hannes@stressinduktion.org>", "Subject": "[RFC PATCH 01/11] net: add support for noref skb->sk", "Date": "Fri, 22 Sep 2017 23:06:25 +0200", "Message-Id": "<b16163e3a4fa4d772edeabd8743acb4a07206bb9.1506114055.git.pabeni@redhat.com>", "In-Reply-To": "<cover.1506114055.git.pabeni@redhat.com>", "References": "<cover.1506114055.git.pabeni@redhat.com>", "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.15", "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.31]);\n\tFri, 22 Sep 2017 21:06:58 +0000 (UTC)", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "Noref sk do not carry a socket refcount, are valid\nonly inside the current RCU section and must be\nexplicitly cleared before exiting such section.\n\nThey will be used in a later patch to allow early demux\nwithout sock refcounting.\n\nSigned-off-by: Paolo Abeni <pabeni@redhat.com>\n---\n include/linux/skbuff.h | 31 +++++++++++++++++++++++++++++++\n net/core/sock.c | 7 +++++++\n 2 files changed, 38 insertions(+)", "diff": "diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h\nindex 492828801acb..c3fc32636690 100644\n--- a/include/linux/skbuff.h\n+++ b/include/linux/skbuff.h\n@@ -922,6 +922,37 @@ static inline struct rtable *skb_rtable(const struct sk_buff *skb)\n \treturn (struct rtable *)skb_dst(skb);\n }\n \n+void sock_dummyfree(struct sk_buff *skb);\n+\n+/* only early demux can set noref socks\n+ * noref socks do not carry any refcount and must be\n+ * cleared before exiting the current RCU section\n+ */\n+static inline void skb_set_noref_sk(struct sk_buff *skb, struct sock *sk)\n+{\n+\tskb->sk = sk;\n+\tskb->destructor = sock_dummyfree;\n+}\n+\n+static inline bool skb_has_noref_sk(struct sk_buff *skb)\n+{\n+\treturn skb->destructor == sock_dummyfree;\n+}\n+\n+static inline struct sock *skb_clear_noref_sk(struct sk_buff *skb)\n+{\n+\tstruct sock *ret;\n+\n+\tif (!skb_has_noref_sk(skb))\n+\t\treturn NULL;\n+\n+\tWARN_ON_ONCE(!rcu_read_lock_held());\n+\tret = skb->sk;\n+\tskb->sk = NULL;\n+\tskb->destructor = NULL;\n+\treturn ret;\n+}\n+\n /* For mangling skb->pkt_type from user space side from applications\n * such as nft, tc, etc, we only allow a conservative subset of\n * possible pkt_types to be set.\ndiff --git a/net/core/sock.c b/net/core/sock.c\nindex 9b7b6bbb2a23..33da8e7e58a0 100644\n--- a/net/core/sock.c\n+++ b/net/core/sock.c\n@@ -1893,6 +1893,13 @@ void sock_efree(struct sk_buff *skb)\n }\n EXPORT_SYMBOL(sock_efree);\n \n+/* dummy destructor used by noref sockets */\n+void sock_dummyfree(struct sk_buff *skb)\n+{\n+\tWARN_ON_ONCE(!rcu_read_lock_held());\n+}\n+EXPORT_SYMBOL(sock_dummyfree);\n+\n kuid_t sock_i_uid(struct sock *sk)\n {\n \tkuid_t uid;\n", "prefixes": [ "RFC", "01/11" ] }