Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/816373/?format=api
{ "id": 816373, "url": "http://patchwork.ozlabs.org/api/patches/816373/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/39b55ec9584df7dfd6eb498a3d354cd2e08e3eaa.1505926196.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": "<39b55ec9584df7dfd6eb498a3d354cd2e08e3eaa.1505926196.git.pabeni@redhat.com>", "list_archive_url": null, "date": "2017-09-20T16:54:01", "name": "[net-next,1/5] net: add support for noref skb->sk", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "012fa93350a505fe9dc47e93ff24cdcbffe01837", "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/39b55ec9584df7dfd6eb498a3d354cd2e08e3eaa.1505926196.git.pabeni@redhat.com/mbox/", "series": [ { "id": 4180, "url": "http://patchwork.ozlabs.org/api/series/4180/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=4180", "date": "2017-09-20T16:54:00", "name": "net: introduce noref sk", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/4180/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/816373/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/816373/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-mx05.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com", "ext-mx05.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 3xy5Xk5zj2z9sP1\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 21 Sep 2017 02:58:14 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751471AbdITQ6M (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 20 Sep 2017 12:58:12 -0400", "from mx1.redhat.com ([209.132.183.28]:34176 \"EHLO mx1.redhat.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1750938AbdITQ6K (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tWed, 20 Sep 2017 12:58:10 -0400", "from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\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 C0B512F9446;\n\tWed, 20 Sep 2017 16:58:10 +0000 (UTC)", "from localhost.mxp.redhat.com (unknown [10.32.181.195])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 7EA2060C9A;\n\tWed, 20 Sep 2017 16:58:09 +0000 (UTC)" ], "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com C0B512F9446", "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": "[PATCH net-next 1/5] net: add support for noref skb->sk", "Date": "Wed, 20 Sep 2017 18:54:01 +0200", "Message-Id": "<39b55ec9584df7dfd6eb498a3d354cd2e08e3eaa.1505926196.git.pabeni@redhat.com>", "In-Reply-To": "<cover.1505926196.git.pabeni@redhat.com>", "References": "<cover.1505926196.git.pabeni@redhat.com>", "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.12", "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.29]);\n\tWed, 20 Sep 2017 16:58:10 +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 | 30 ++++++++++++++++++++++++++++++\n net/core/sock.c | 6 ++++++\n 2 files changed, 36 insertions(+)", "diff": "diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h\nindex 72299ef00061..459a5672811d 100644\n--- a/include/linux/skbuff.h\n+++ b/include/linux/skbuff.h\n@@ -922,6 +922,36 @@ 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+\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..3aa4950639bb 100644\n--- a/net/core/sock.c\n+++ b/net/core/sock.c\n@@ -1893,6 +1893,12 @@ 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+}\n+EXPORT_SYMBOL(sock_dummyfree);\n+\n kuid_t sock_i_uid(struct sock *sk)\n {\n \tkuid_t uid;\n", "prefixes": [ "net-next", "1/5" ] }