Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/816375/?format=api
{ "id": 816375, "url": "http://patchwork.ozlabs.org/api/patches/816375/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/36a1ee841087089c1ba364a3fb89282674a9a80b.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": "<36a1ee841087089c1ba364a3fb89282674a9a80b.1505926196.git.pabeni@redhat.com>", "list_archive_url": null, "date": "2017-09-20T16:54:04", "name": "[net-next,4/5] net: add simple socket-like dst cache helpers", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "1541d7e04bf768e56f0177c45df40bce8589b865", "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/36a1ee841087089c1ba364a3fb89282674a9a80b.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/816375/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/816375/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 3xy5Xp0xYtz9t2V\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 21 Sep 2017 02:58:18 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751583AbdITQ6Q (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 20 Sep 2017 12:58:16 -0400", "from mx1.redhat.com ([209.132.183.28]:52760 \"EHLO mx1.redhat.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1750938AbdITQ6P (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tWed, 20 Sep 2017 12:58:15 -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 6B039C047B89;\n\tWed, 20 Sep 2017 16:58:15 +0000 (UTC)", "from localhost.mxp.redhat.com (unknown [10.32.181.195])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 2A85D60C9A;\n\tWed, 20 Sep 2017 16:58:14 +0000 (UTC)" ], "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com 6B039C047B89", "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 4/5] net: add simple socket-like dst cache helpers", "Date": "Wed, 20 Sep 2017 18:54:04 +0200", "Message-Id": "<36a1ee841087089c1ba364a3fb89282674a9a80b.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.31]);\n\tWed, 20 Sep 2017 16:58:15 +0000 (UTC)", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "It will be used by later patches to reduce code duplication.\n\nSigned-off-by: Paolo Abeni <pabeni@redhat.com>\n---\n include/net/dst.h | 12 ++++++++++++\n net/core/dst.c | 16 ++++++++++++++++\n 2 files changed, 28 insertions(+)", "diff": "diff --git a/include/net/dst.h b/include/net/dst.h\nindex 93568bd0a352..a6a39357f19a 100644\n--- a/include/net/dst.h\n+++ b/include/net/dst.h\n@@ -485,6 +485,18 @@ static inline struct dst_entry *dst_check(struct dst_entry *dst, u32 cookie)\n \treturn dst;\n }\n \n+bool dst_update(struct dst_entry **cache, struct dst_entry *dst);\n+static inline struct dst_entry *dst_access(struct dst_entry **cache,\n+\t\t\t\t\t u32 cookie)\n+{\n+\tstruct dst_entry *dst = READ_ONCE(*cache);\n+\n+\tif (!dst)\n+\t\treturn NULL;\n+\n+\treturn dst_check(dst, cookie);\n+}\n+\n /* Flags for xfrm_lookup flags argument. */\n enum {\n \tXFRM_LOOKUP_ICMP = 1 << 0,\ndiff --git a/net/core/dst.c b/net/core/dst.c\nindex a6c47da7d0f8..6aff0a3e7ba3 100644\n--- a/net/core/dst.c\n+++ b/net/core/dst.c\n@@ -205,6 +205,22 @@ void dst_release_immediate(struct dst_entry *dst)\n }\n EXPORT_SYMBOL(dst_release_immediate);\n \n+/* 'dst' is not refcounted */\n+bool dst_update(struct dst_entry **cache, struct dst_entry *dst)\n+{\n+\tif (likely(*cache == dst))\n+\t\treturn false;\n+\n+\tif (dst_hold_safe(dst)) {\n+\t\tstruct dst_entry *old = xchg(cache, dst);\n+\n+\t\tdst_release(old);\n+\t\treturn old != dst;\n+\t}\n+\treturn false;\n+}\n+EXPORT_SYMBOL_GPL(dst_update);\n+\n u32 *dst_cow_metrics_generic(struct dst_entry *dst, unsigned long old)\n {\n \tstruct dst_metrics *p = kmalloc(sizeof(*p), GFP_ATOMIC);\n", "prefixes": [ "net-next", "4/5" ] }