Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1020/?format=api
{ "id": 1020, "url": "http://patchwork.ozlabs.org/api/patches/1020/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20080923.002101.227089368.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": "<20080923.002101.227089368.davem@davemloft.net>", "list_archive_url": null, "date": "2008-09-23T07:21:01", "name": ": Use skb_queue_head in de4x5 driver...", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "cad647a16b324f3a665a7e722a28eb7f2ec3e465", "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/20080923.002101.227089368.davem@davemloft.net/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/1020/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1020/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 F1E1EDDE9E\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 23 Sep 2008 17:21:19 +1000 (EST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752336AbYIWHVO (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tTue, 23 Sep 2008 03:21:14 -0400", "(majordomo@vger.kernel.org) by vger.kernel.org id S1752468AbYIWHVO\n\t(ORCPT <rfc822; netdev-outgoing>); Tue, 23 Sep 2008 03:21:14 -0400", "from 74-93-104-97-Washington.hfc.comcastbusiness.net\n\t([74.93.104.97]:60596\n\t\"EHLO sunset.davemloft.net\" rhost-flags-OK-FAIL-OK-OK)\n\tby vger.kernel.org with ESMTP id S1750966AbYIWHVO (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Tue, 23 Sep 2008 03:21:14 -0400", "from localhost (localhost [127.0.0.1])\n\tby sunset.davemloft.net (Postfix) with ESMTP id A2111C8C181\n\tfor <netdev@vger.kernel.org>; Tue, 23 Sep 2008 00:21:01 -0700 (PDT)" ], "Date": "Tue, 23 Sep 2008 00:21:01 -0700 (PDT)", "Message-Id": "<20080923.002101.227089368.davem@davemloft.net>", "To": "netdev@vger.kernel.org", "Subject": "[PATCH]: Use skb_queue_head in de4x5 driver...", "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": "More by-hand SKB list management elimination...\n\nde4x5: Use skb_queue_head instead of by-hand implementation.\n\nSigned-off-by: David S. Miller <davem@davemloft.net>\n---\n drivers/net/tulip/de4x5.c | 38 ++++++++------------------------------\n 1 files changed, 8 insertions(+), 30 deletions(-)", "diff": "diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c\nindex 617ef41..6444cbe 100644\n--- a/drivers/net/tulip/de4x5.c\n+++ b/drivers/net/tulip/de4x5.c\n@@ -832,7 +832,7 @@ struct de4x5_private {\n \ts32 csr14; /* Saved SIA TX/RX Register */\n \ts32 csr15; /* Saved SIA General Register */\n \tint save_cnt; /* Flag if state already saved */\n-\tstruct sk_buff *skb; /* Save the (re-ordered) skb's */\n+\tstruct sk_buff_head queue; /* Save the (re-ordered) skb's */\n } cache;\n struct de4x5_srom srom; /* A copy of the SROM */\n int cfrv;\t\t\t\t /* Card CFRV copy */\n@@ -1128,6 +1128,7 @@ de4x5_hw_init(struct net_device *dev, u_long iobase, struct device *gendev)\n \tprintk(\" which has an Ethernet PROM CRC error.\\n\");\n \treturn -ENXIO;\n } else {\n+\tskb_queue_head_init(&lp->cache.queue);\n \tlp->cache.gepc = GEP_INIT;\n \tlp->asBit = GEP_SLNK;\n \tlp->asPolarity = GEP_SLNK;\n@@ -1487,7 +1488,7 @@ de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev)\n \t}\n } else if (skb->len > 0) {\n \t/* If we already have stuff queued locally, use that first */\n-\tif (lp->cache.skb && !lp->interrupt) {\n+\tif (!skb_queue_empty(&lp->cache.queue) && !lp->interrupt) {\n \t de4x5_put_cache(dev, skb);\n \t skb = de4x5_get_cache(dev);\n \t}\n@@ -1580,7 +1581,7 @@ de4x5_interrupt(int irq, void *dev_id)\n \n /* Load the TX ring with any locally stored packets */\n if (!test_and_set_bit(0, (void *)&lp->cache.lock)) {\n-\twhile (lp->cache.skb && !netif_queue_stopped(dev) && lp->tx_enable) {\n+\twhile (!skb_queue_empty(&lp->cache.queue) && !netif_queue_stopped(dev) && lp->tx_enable) {\n \t de4x5_queue_pkt(de4x5_get_cache(dev), dev);\n \t}\n \tlp->cache.lock = 0;\n@@ -3679,11 +3680,7 @@ de4x5_free_tx_buffs(struct net_device *dev)\n }\n \n /* Unload the locally queued packets */\n- while (lp->cache.skb) {\n-\tdev_kfree_skb(de4x5_get_cache(dev));\n- }\n-\n- return;\n+ __skb_queue_purge(&lp->cache.queue);\n }\n \n /*\n@@ -3781,43 +3778,24 @@ static void\n de4x5_put_cache(struct net_device *dev, struct sk_buff *skb)\n {\n struct de4x5_private *lp = netdev_priv(dev);\n- struct sk_buff *p;\n-\n- if (lp->cache.skb) {\n-\tfor (p=lp->cache.skb; p->next; p=p->next);\n-\tp->next = skb;\n- } else {\n-\tlp->cache.skb = skb;\n- }\n- skb->next = NULL;\n \n- return;\n+ __skb_queue_tail(&lp->cache.queue, skb);\n }\n \n static void\n de4x5_putb_cache(struct net_device *dev, struct sk_buff *skb)\n {\n struct de4x5_private *lp = netdev_priv(dev);\n- struct sk_buff *p = lp->cache.skb;\n-\n- lp->cache.skb = skb;\n- skb->next = p;\n \n- return;\n+ __skb_queue_head(&lp->cache.queue, skb);\n }\n \n static struct sk_buff *\n de4x5_get_cache(struct net_device *dev)\n {\n struct de4x5_private *lp = netdev_priv(dev);\n- struct sk_buff *p = lp->cache.skb;\n \n- if (p) {\n-\tlp->cache.skb = p->next;\n-\tp->next = NULL;\n- }\n-\n- return p;\n+ return __skb_dequeue(&lp->cache.queue);\n }\n \n /*\n", "prefixes": [] }