Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1003/?format=api
{ "id": 1003, "url": "http://patchwork.ozlabs.org/api/patches/1003/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20080922.191236.216829858.davem@davemloft.net/", "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": "<20080922.191236.216829858.davem@davemloft.net>", "list_archive_url": null, "date": "2008-09-23T02:12:36", "name": "[3/7] : net: Add new interfaces for SKB list light-weight init and splicing.", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "deaf26f602757828bc39ac26bf0ac95ab4f44b6c", "submitter": { "id": 15, "url": "http://patchwork.ozlabs.org/api/people/15/?format=api", "name": "David Miller", "email": "davem@davemloft.net" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20080922.191236.216829858.davem@davemloft.net/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/1003/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1003/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<netdev-owner@vger.kernel.org>", "X-Original-To": "patchwork-incoming@ozlabs.org", "Delivered-To": "patchwork-incoming@ozlabs.org", "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.176.167])\n\tby ozlabs.org (Postfix) with ESMTP id 04684DDE98\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 23 Sep 2008 12:13:00 +1000 (EST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1754102AbYIWCMv (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 22 Sep 2008 22:12:51 -0400", "(majordomo@vger.kernel.org) by vger.kernel.org id S1754100AbYIWCMu\n\t(ORCPT <rfc822; netdev-outgoing>); Mon, 22 Sep 2008 22:12:50 -0400", "from 74-93-104-97-Washington.hfc.comcastbusiness.net\n\t([74.93.104.97]:37175\n\t\"EHLO sunset.davemloft.net\" rhost-flags-OK-FAIL-OK-OK)\n\tby vger.kernel.org with ESMTP id S1754058AbYIWCMs (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Mon, 22 Sep 2008 22:12:48 -0400", "from localhost (localhost [127.0.0.1])\n\tby sunset.davemloft.net (Postfix) with ESMTP id 5B848C8C185\n\tfor <netdev@vger.kernel.org>; Mon, 22 Sep 2008 19:12:36 -0700 (PDT)" ], "Date": "Mon, 22 Sep 2008 19:12:36 -0700 (PDT)", "Message-Id": "<20080922.191236.216829858.davem@davemloft.net>", "To": "netdev@vger.kernel.org", "Subject": "[PATCH 3/7]: net: Add new interfaces for SKB list light-weight\n\tinit and splicing.", "From": "David Miller <davem@davemloft.net>", "X-Mailer": "Mew version 6.1 on Emacs 22.1 / Mule 5.0 (SAKAKI)", "Mime-Version": "1.0", "Content-Type": "Text/Plain; charset=us-ascii", "Content-Transfer-Encoding": "7bit", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "net: Add new interfaces for SKB list light-weight init and splicing.\n\nThis will be used by subsequent changesets.\n\nSigned-off-by: David S. Miller <davem@davemloft.net>\n---\n include/linux/skbuff.h | 96 +++++++++++++++++++++++++++++++++++++++++++++++-\n 1 files changed, 94 insertions(+), 2 deletions(-)", "diff": "diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h\nindex aa80ad9..027b061 100644\n--- a/include/linux/skbuff.h\n+++ b/include/linux/skbuff.h\n@@ -660,6 +660,22 @@ static inline __u32 skb_queue_len(const struct sk_buff_head *list_)\n \treturn list_->qlen;\n }\n \n+/**\n+ *\t__skb_queue_head_init - initialize non-spinlock portions of sk_buff_head\n+ *\t@list: queue to initialize\n+ *\n+ *\tThis initializes only the list and queue length aspects of\n+ *\tan sk_buff_head object. This allows to initialize the list\n+ *\taspects of an sk_buff_head without reinitializing things like\n+ *\tthe spinlock. It can also be used for on-stack sk_buff_head\n+ *\tobjects where the spinlock is known to not be used.\n+ */\n+static inline void __skb_queue_head_init(struct sk_buff_head *list)\n+{\n+\tlist->prev = list->next = (struct sk_buff *)list;\n+\tlist->qlen = 0;\n+}\n+\n /*\n * This function creates a split out lock class for each invocation;\n * this is needed for now since a whole lot of users of the skb-queue\n@@ -671,8 +687,7 @@ static inline __u32 skb_queue_len(const struct sk_buff_head *list_)\n static inline void skb_queue_head_init(struct sk_buff_head *list)\n {\n \tspin_lock_init(&list->lock);\n-\tlist->prev = list->next = (struct sk_buff *)list;\n-\tlist->qlen = 0;\n+\t__skb_queue_head_init(list);\n }\n \n static inline void skb_queue_head_init_class(struct sk_buff_head *list,\n@@ -699,6 +714,83 @@ static inline void __skb_insert(struct sk_buff *newsk,\n \tlist->qlen++;\n }\n \n+static inline void __skb_queue_splice(const struct sk_buff_head *list,\n+\t\t\t\t struct sk_buff *prev,\n+\t\t\t\t struct sk_buff *next)\n+{\n+\tstruct sk_buff *first = list->next;\n+\tstruct sk_buff *last = list->prev;\n+\n+\tfirst->prev = prev;\n+\tprev->next = first;\n+\n+\tlast->next = next;\n+\tnext->prev = last;\n+}\n+\n+/**\n+ *\tskb_queue_splice - join two skb lists, this is designed for stacks\n+ *\t@list: the new list to add\n+ *\t@head: the place to add it in the first list\n+ */\n+static inline void skb_queue_splice(const struct sk_buff_head *list,\n+\t\t\t\t struct sk_buff_head *head)\n+{\n+\tif (!skb_queue_empty(list)) {\n+\t\t__skb_queue_splice(list, (struct sk_buff *) head, head->next);\n+\t\thead->qlen = list->qlen;\n+\t}\n+}\n+\n+/**\n+ *\tskb_queue_splice - join two skb lists and reinitialise the emptied list\n+ *\t@list: the new list to add\n+ *\t@head: the place to add it in the first list\n+ *\n+ *\tThe list at @list is reinitialised\n+ */\n+static inline void skb_queue_splice_init(struct sk_buff_head *list,\n+\t\t\t\t\t struct sk_buff_head *head)\n+{\n+\tif (!skb_queue_empty(list)) {\n+\t\t__skb_queue_splice(list, (struct sk_buff *) head, head->next);\n+\t\thead->qlen = list->qlen;\n+\t\t__skb_queue_head_init(list);\n+\t}\n+}\n+\n+/**\n+ *\tskb_queue_splice_tail - join two skb lists, each list being a queue\n+ *\t@list: the new list to add\n+ *\t@head: the place to add it in the first list\n+ */\n+static inline void skb_queue_splice_tail(const struct sk_buff_head *list,\n+\t\t\t\t\t struct sk_buff_head *head)\n+{\n+\tif (!skb_queue_empty(list)) {\n+\t\t__skb_queue_splice(list, head->prev, (struct sk_buff *) head);\n+\t\thead->qlen = list->qlen;\n+\t}\n+}\n+\n+/**\n+ *\tskb_queue_splice_tail - join two skb lists and reinitialise the emptied list\n+ *\t@list: the new list to add\n+ *\t@head: the place to add it in the first list\n+ *\n+ *\tEach of the lists is a queue.\n+ *\tThe list at @list is reinitialised\n+ */\n+static inline void skb_queue_splice_tail_init(struct sk_buff_head *list,\n+\t\t\t\t\t struct sk_buff_head *head)\n+{\n+\tif (!skb_queue_empty(list)) {\n+\t\t__skb_queue_splice(list, head->prev, (struct sk_buff *) head);\n+\t\thead->qlen = list->qlen;\n+\t\t__skb_queue_head_init(list);\n+\t}\n+}\n+\n /**\n *\t__skb_queue_after - queue a buffer at the list head\n *\t@list: list to use\n", "prefixes": [ "3/7" ] }