get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/1007/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 1007,
    "url": "http://patchwork.ozlabs.org/api/patches/1007/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20080922.191245.120692142.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.191245.120692142.davem@davemloft.net>",
    "list_archive_url": null,
    "date": "2008-09-23T02:12:45",
    "name": "[7/7] : cxgb3: Use SKB list interfaces instead of home-grown implementation.",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "d5106291d8264ba363c0fbb2790c69a8f5a9e09f",
    "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.191245.120692142.davem@davemloft.net/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/1007/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1007/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 3C72CDDF11\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 23 Sep 2008 12:13:11 +1000 (EST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1754148AbYIWCNB (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 22 Sep 2008 22:13:01 -0400",
            "(majordomo@vger.kernel.org) by vger.kernel.org id S1754069AbYIWCNA\n\t(ORCPT <rfc822; netdev-outgoing>); Mon, 22 Sep 2008 22:13:00 -0400",
            "from 74-93-104-97-Washington.hfc.comcastbusiness.net\n\t([74.93.104.97]:37183\n\t\"EHLO sunset.davemloft.net\" rhost-flags-OK-FAIL-OK-OK)\n\tby vger.kernel.org with ESMTP id S1754134AbYIWCM5 (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Mon, 22 Sep 2008 22:12:57 -0400",
            "from localhost (localhost [127.0.0.1])\n\tby sunset.davemloft.net (Postfix) with ESMTP id B577EC8C185\n\tfor <netdev@vger.kernel.org>; Mon, 22 Sep 2008 19:12:45 -0700 (PDT)"
        ],
        "Date": "Mon, 22 Sep 2008 19:12:45 -0700 (PDT)",
        "Message-Id": "<20080922.191245.120692142.davem@davemloft.net>",
        "To": "netdev@vger.kernel.org",
        "Subject": "[PATCH 7/7]: cxgb3: Use SKB list interfaces instead of home-grown\n\timplementation.",
        "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": "cxgb3: Use SKB list interfaces instead of home-grown implementation.\n\nSigned-off-by: David S. Miller <davem@davemloft.net>\n---\n drivers/net/cxgb3/adapter.h |    3 +-\n drivers/net/cxgb3/l2t.c     |   39 ++++++++++++++++---------------------\n drivers/net/cxgb3/l2t.h     |    3 +-\n drivers/net/cxgb3/sge.c     |   45 ++++++++++++++++++++++---------------------\n 4 files changed, 42 insertions(+), 48 deletions(-)",
    "diff": "diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h\nindex 2711404..4f5cc69 100644\n--- a/drivers/net/cxgb3/adapter.h\n+++ b/drivers/net/cxgb3/adapter.h\n@@ -124,8 +124,7 @@ struct sge_rspq {\t\t/* state for an SGE response queue */\n \tdma_addr_t phys_addr;\t/* physical address of the ring */\n \tunsigned int cntxt_id;\t/* SGE context id for the response q */\n \tspinlock_t lock;\t/* guards response processing */\n-\tstruct sk_buff *rx_head;\t/* offload packet receive queue head */\n-\tstruct sk_buff *rx_tail;\t/* offload packet receive queue tail */\n+\tstruct sk_buff_head rx_queue; /* offload packet receive queue */\n \tstruct sk_buff *pg_skb; /* used to build frag list in napi handler */\n \n \tunsigned long offload_pkts;\ndiff --git a/drivers/net/cxgb3/l2t.c b/drivers/net/cxgb3/l2t.c\nindex 825e510..b2c5314 100644\n--- a/drivers/net/cxgb3/l2t.c\n+++ b/drivers/net/cxgb3/l2t.c\n@@ -86,6 +86,7 @@ static int setup_l2e_send_pending(struct t3cdev *dev, struct sk_buff *skb,\n \t\t\t\t  struct l2t_entry *e)\n {\n \tstruct cpl_l2t_write_req *req;\n+\tstruct sk_buff *tmp;\n \n \tif (!skb) {\n \t\tskb = alloc_skb(sizeof(*req), GFP_ATOMIC);\n@@ -103,13 +104,11 @@ static int setup_l2e_send_pending(struct t3cdev *dev, struct sk_buff *skb,\n \tmemcpy(req->dst_mac, e->dmac, sizeof(req->dst_mac));\n \tskb->priority = CPL_PRIORITY_CONTROL;\n \tcxgb3_ofld_send(dev, skb);\n-\twhile (e->arpq_head) {\n-\t\tskb = e->arpq_head;\n-\t\te->arpq_head = skb->next;\n-\t\tskb->next = NULL;\n+\n+\tskb_queue_walk_safe(&e->arpq, skb, tmp) {\n+\t\t__skb_unlink(skb, &e->arpq);\n \t\tcxgb3_ofld_send(dev, skb);\n \t}\n-\te->arpq_tail = NULL;\n \te->state = L2T_STATE_VALID;\n \n \treturn 0;\n@@ -121,12 +120,7 @@ static int setup_l2e_send_pending(struct t3cdev *dev, struct sk_buff *skb,\n  */\n static inline void arpq_enqueue(struct l2t_entry *e, struct sk_buff *skb)\n {\n-\tskb->next = NULL;\n-\tif (e->arpq_head)\n-\t\te->arpq_tail->next = skb;\n-\telse\n-\t\te->arpq_head = skb;\n-\te->arpq_tail = skb;\n+\t__skb_queue_tail(&e->arpq, skb);\n }\n \n int t3_l2t_send_slow(struct t3cdev *dev, struct sk_buff *skb,\n@@ -167,7 +161,7 @@ again:\n \t\t\t\tbreak;\n \n \t\t\tspin_lock_bh(&e->lock);\n-\t\t\tif (e->arpq_head)\n+\t\t\tif (!skb_queue_empty(&e->arpq))\n \t\t\t\tsetup_l2e_send_pending(dev, skb, e);\n \t\t\telse\t/* we lost the race */\n \t\t\t\t__kfree_skb(skb);\n@@ -357,14 +351,14 @@ EXPORT_SYMBOL(t3_l2t_get);\n  * XXX: maybe we should abandon the latter behavior and just require a failure\n  * handler.\n  */\n-static void handle_failed_resolution(struct t3cdev *dev, struct sk_buff *arpq)\n+static void handle_failed_resolution(struct t3cdev *dev, struct sk_buff_head *arpq)\n {\n-\twhile (arpq) {\n-\t\tstruct sk_buff *skb = arpq;\n+\tstruct sk_buff *skb, *tmp;\n+\n+\tskb_queue_walk_safe(arpq, skb, tmp) {\n \t\tstruct l2t_skb_cb *cb = L2T_SKB_CB(skb);\n \n-\t\tarpq = skb->next;\n-\t\tskb->next = NULL;\n+\t\t__skb_unlink(skb, arpq);\n \t\tif (cb->arp_failure_handler)\n \t\t\tcb->arp_failure_handler(dev, skb);\n \t\telse\n@@ -378,8 +372,8 @@ static void handle_failed_resolution(struct t3cdev *dev, struct sk_buff *arpq)\n  */\n void t3_l2t_update(struct t3cdev *dev, struct neighbour *neigh)\n {\n+\tstruct sk_buff_head arpq;\n \tstruct l2t_entry *e;\n-\tstruct sk_buff *arpq = NULL;\n \tstruct l2t_data *d = L2DATA(dev);\n \tu32 addr = *(u32 *) neigh->primary_key;\n \tint ifidx = neigh->dev->ifindex;\n@@ -395,6 +389,8 @@ void t3_l2t_update(struct t3cdev *dev, struct neighbour *neigh)\n \treturn;\n \n found:\n+\t__skb_queue_head_init(&arpq);\n+\n \tread_unlock(&d->lock);\n \tif (atomic_read(&e->refcnt)) {\n \t\tif (neigh != e->neigh)\n@@ -402,8 +398,7 @@ found:\n \n \t\tif (e->state == L2T_STATE_RESOLVING) {\n \t\t\tif (neigh->nud_state & NUD_FAILED) {\n-\t\t\t\tarpq = e->arpq_head;\n-\t\t\t\te->arpq_head = e->arpq_tail = NULL;\n+\t\t\t\tskb_queue_splice_init(&e->arpq, &arpq);\n \t\t\t} else if (neigh->nud_state & (NUD_CONNECTED|NUD_STALE))\n \t\t\t\tsetup_l2e_send_pending(dev, NULL, e);\n \t\t} else {\n@@ -415,8 +410,8 @@ found:\n \t}\n \tspin_unlock_bh(&e->lock);\n \n-\tif (arpq)\n-\t\thandle_failed_resolution(dev, arpq);\n+\tif (!skb_queue_empty(&arpq))\n+\t\thandle_failed_resolution(dev, &arpq);\n }\n \n struct l2t_data *t3_init_l2t(unsigned int l2t_capacity)\ndiff --git a/drivers/net/cxgb3/l2t.h b/drivers/net/cxgb3/l2t.h\nindex d790013..42ce65f 100644\n--- a/drivers/net/cxgb3/l2t.h\n+++ b/drivers/net/cxgb3/l2t.h\n@@ -64,8 +64,7 @@ struct l2t_entry {\n \tstruct neighbour *neigh;\t/* associated neighbour */\n \tstruct l2t_entry *first;\t/* start of hash chain */\n \tstruct l2t_entry *next;\t/* next l2t_entry on chain */\n-\tstruct sk_buff *arpq_head;\t/* queue of packets awaiting resolution */\n-\tstruct sk_buff *arpq_tail;\n+\tstruct sk_buff_head arpq;\t/* queue of packets awaiting resolution */\n \tspinlock_t lock;\n \tatomic_t refcnt;\t/* entry reference count */\n \tu8 dmac[6];\t\t/* neighbour's MAC address */\ndiff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c\nindex 1b0861d..6990c0d 100644\n--- a/drivers/net/cxgb3/sge.c\n+++ b/drivers/net/cxgb3/sge.c\n@@ -1704,16 +1704,15 @@ int t3_offload_tx(struct t3cdev *tdev, struct sk_buff *skb)\n  */\n static inline void offload_enqueue(struct sge_rspq *q, struct sk_buff *skb)\n {\n-\tskb->next = skb->prev = NULL;\n-\tif (q->rx_tail)\n-\t\tq->rx_tail->next = skb;\n-\telse {\n+\tint was_empty = skb_queue_empty(&q->rx_queue);\n+\n+\t__skb_queue_tail(&q->rx_queue, skb);\n+\n+\tif (was_empty) {\n \t\tstruct sge_qset *qs = rspq_to_qset(q);\n \n \t\tnapi_schedule(&qs->napi);\n-\t\tq->rx_head = skb;\n \t}\n-\tq->rx_tail = skb;\n }\n \n /**\n@@ -1754,26 +1753,29 @@ static int ofld_poll(struct napi_struct *napi, int budget)\n \tint work_done = 0;\n \n \twhile (work_done < budget) {\n-\t\tstruct sk_buff *head, *tail, *skbs[RX_BUNDLE_SIZE];\n+\t\tstruct sk_buff *skb, *tmp, *skbs[RX_BUNDLE_SIZE];\n+\t\tstruct sk_buff_head queue;\n \t\tint ngathered;\n \n \t\tspin_lock_irq(&q->lock);\n-\t\thead = q->rx_head;\n-\t\tif (!head) {\n+\t\t__skb_queue_head_init(&queue);\n+\t\tskb_queue_splice_init(&q->rx_queue, &queue);\n+\t\tif (skb_queue_empty(&queue)) {\n \t\t\tnapi_complete(napi);\n \t\t\tspin_unlock_irq(&q->lock);\n \t\t\treturn work_done;\n \t\t}\n-\n-\t\ttail = q->rx_tail;\n-\t\tq->rx_head = q->rx_tail = NULL;\n \t\tspin_unlock_irq(&q->lock);\n \n-\t\tfor (ngathered = 0; work_done < budget && head; work_done++) {\n-\t\t\tprefetch(head->data);\n-\t\t\tskbs[ngathered] = head;\n-\t\t\thead = head->next;\n-\t\t\tskbs[ngathered]->next = NULL;\n+\t\tngathered = 0;\n+\t\tskb_queue_walk_safe(&queue, skb, tmp) {\n+\t\t\tif (work_done >= budget)\n+\t\t\t\tbreak;\n+\t\t\twork_done++;\n+\n+\t\t\t__skb_unlink(skb, &queue);\n+\t\t\tprefetch(skb->data);\n+\t\t\tskbs[ngathered] = skb;\n \t\t\tif (++ngathered == RX_BUNDLE_SIZE) {\n \t\t\t\tq->offload_bundles++;\n \t\t\t\tadapter->tdev.recv(&adapter->tdev, skbs,\n@@ -1781,12 +1783,10 @@ static int ofld_poll(struct napi_struct *napi, int budget)\n \t\t\t\tngathered = 0;\n \t\t\t}\n \t\t}\n-\t\tif (head) {\t/* splice remaining packets back onto Rx queue */\n+\t\tif (!skb_queue_empty(&queue)) {\n+\t\t\t/* splice remaining packets back onto Rx queue */\n \t\t\tspin_lock_irq(&q->lock);\n-\t\t\ttail->next = q->rx_head;\n-\t\t\tif (!q->rx_head)\n-\t\t\t\tq->rx_tail = tail;\n-\t\t\tq->rx_head = head;\n+\t\t\tskb_queue_splice(&queue, &q->rx_queue);\n \t\t\tspin_unlock_irq(&q->lock);\n \t\t}\n \t\tdeliver_partial_bundle(&adapter->tdev, q, skbs, ngathered);\n@@ -2934,6 +2934,7 @@ int t3_sge_alloc_qset(struct adapter *adapter, unsigned int id, int nports,\n \tq->rspq.gen = 1;\n \tq->rspq.size = p->rspq_size;\n \tspin_lock_init(&q->rspq.lock);\n+\tskb_queue_head_init(&q->rspq.rx_queue);\n \n \tq->txq[TXQ_ETH].stop_thres = nports *\n \t    flits_to_desc(sgl_len(MAX_SKB_FRAGS + 1) + 3);\n",
    "prefixes": [
        "7/7"
    ]
}