get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 8059,
    "url": "https://patches.dpdk.org/api/patches/8059/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1445939209-12783-14-git-send-email-jing.d.chen@intel.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1445939209-12783-14-git-send-email-jing.d.chen@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1445939209-12783-14-git-send-email-jing.d.chen@intel.com",
    "date": "2015-10-27T09:46:46",
    "name": "[dpdk-dev,v3,13/16] fm10k: introduce 2 funcs to reset TX queue and mbuf release",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "bbf841351246bd2f7de6ab9572d5cab04f88dbe3",
    "submitter": {
        "id": 40,
        "url": "https://patches.dpdk.org/api/people/40/?format=api",
        "name": "Chen, Jing D",
        "email": "jing.d.chen@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1445939209-12783-14-git-send-email-jing.d.chen@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/8059/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/8059/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id EAD488DA6;\n\tTue, 27 Oct 2015 10:47:33 +0100 (CET)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 3C3478E67\n\tfor <dev@dpdk.org>; Tue, 27 Oct 2015 10:47:26 +0100 (CET)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby fmsmga102.fm.intel.com with ESMTP; 27 Oct 2015 02:47:26 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby orsmga003.jf.intel.com with ESMTP; 27 Oct 2015 02:47:25 -0700",
            "from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com\n\t[10.239.29.89])\n\tby shvmail01.sh.intel.com with ESMTP id t9R9lMrI031045;\n\tTue, 27 Oct 2015 17:47:22 +0800",
            "from shecgisg004.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid t9R9lKTV013464; Tue, 27 Oct 2015 17:47:22 +0800",
            "(from jingche2@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t9R9lKmp013460; \n\tTue, 27 Oct 2015 17:47:20 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.20,204,1444719600\"; d=\"scan'208\";a=\"672566239\"",
        "From": "\"Chen Jing D(Mark)\" <jing.d.chen@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Tue, 27 Oct 2015 17:46:46 +0800",
        "Message-Id": "<1445939209-12783-14-git-send-email-jing.d.chen@intel.com>",
        "X-Mailer": "git-send-email 1.7.12.2",
        "In-Reply-To": "<1445939209-12783-1-git-send-email-jing.d.chen@intel.com>",
        "References": "<1445507104-22563-2-git-send-email-jing.d.chen@intel.com>\n\t<1445939209-12783-1-git-send-email-jing.d.chen@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v3 13/16] fm10k: introduce 2 funcs to reset TX\n\tqueue and mbuf release",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: \"Chen Jing D(Mark)\" <jing.d.chen@intel.com>\n\nAdd 2 funcs to reset TX queue and mbuf release when Vector TX\napplied.\n\nSigned-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>\n---\n drivers/net/fm10k/fm10k_rxtx_vec.c |   68 ++++++++++++++++++++++++++++++++++++\n 1 files changed, 68 insertions(+), 0 deletions(-)",
    "diff": "diff --git a/drivers/net/fm10k/fm10k_rxtx_vec.c b/drivers/net/fm10k/fm10k_rxtx_vec.c\nindex e802eec..7ef7910 100644\n--- a/drivers/net/fm10k/fm10k_rxtx_vec.c\n+++ b/drivers/net/fm10k/fm10k_rxtx_vec.c\n@@ -44,6 +44,11 @@\n #pragma GCC diagnostic ignored \"-Wcast-qual\"\n #endif\n \n+static void\n+fm10k_tx_queue_release_mbufs_vec(struct fm10k_tx_queue *txq);\n+static void\n+fm10k_reset_tx_queue(struct fm10k_tx_queue *txq);\n+\n /* Handling the offload flags (olflags) field takes computation\n  * time when receiving packets. Therefore we provide a flag to disable\n  * the processing of the olflags field when they are not needed. This\n@@ -620,6 +625,17 @@ fm10k_recv_scattered_pkts_vec(void *rx_queue,\n \t\t&split_flags[i]);\n }\n \n+static const struct fm10k_txq_ops vec_txq_ops = {\n+\t.release_mbufs = fm10k_tx_queue_release_mbufs_vec,\n+\t.reset = fm10k_reset_tx_queue,\n+};\n+\n+void __attribute__((cold))\n+fm10k_txq_vec_setup(struct fm10k_tx_queue *txq)\n+{\n+\ttxq->ops = &vec_txq_ops;\n+}\n+\n static inline void\n vtx1(volatile struct fm10k_tx_desc *txdp,\n \t\tstruct rte_mbuf *pkt, uint64_t flags)\n@@ -769,3 +785,55 @@ fm10k_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,\n \n \treturn nb_pkts;\n }\n+\n+static void __attribute__((cold))\n+fm10k_tx_queue_release_mbufs_vec(struct fm10k_tx_queue *txq)\n+{\n+\tunsigned i;\n+\tconst uint16_t max_desc = (uint16_t)(txq->nb_desc - 1);\n+\n+\tif (txq->sw_ring == NULL || txq->nb_free == max_desc)\n+\t\treturn;\n+\n+\t/* release the used mbufs in sw_ring */\n+\tfor (i = txq->next_dd - (txq->rs_thresh - 1);\n+\t     i != txq->next_free;\n+\t     i = (i + 1) & max_desc)\n+\t\trte_pktmbuf_free_seg(txq->sw_ring[i]);\n+\n+\ttxq->nb_free = max_desc;\n+\n+\t/* reset tx_entry */\n+\tfor (i = 0; i < txq->nb_desc; i++)\n+\t\ttxq->sw_ring[i] = NULL;\n+\n+\trte_free(txq->sw_ring);\n+\ttxq->sw_ring = NULL;\n+}\n+\n+static void __attribute__((cold))\n+fm10k_reset_tx_queue(struct fm10k_tx_queue *txq)\n+{\n+\tstatic const struct fm10k_tx_desc zeroed_desc = {0};\n+\tstruct rte_mbuf **txe = txq->sw_ring;\n+\tuint16_t i;\n+\n+\t/* Zero out HW ring memory */\n+\tfor (i = 0; i < txq->nb_desc; i++)\n+\t\ttxq->hw_ring[i] = zeroed_desc;\n+\n+\t/* Initialize SW ring entries */\n+\tfor (i = 0; i < txq->nb_desc; i++)\n+\t\ttxe[i] = NULL;\n+\n+\ttxq->next_dd = (uint16_t)(txq->rs_thresh - 1);\n+\ttxq->next_rs = (uint16_t)(txq->rs_thresh - 1);\n+\n+\ttxq->next_free = 0;\n+\ttxq->nb_used = 0;\n+\t/* Always allow 1 descriptor to be un-allocated to avoid\n+\t * a H/W race condition\n+\t */\n+\ttxq->nb_free = (uint16_t)(txq->nb_desc - 1);\n+\tFM10K_PCI_REG_WRITE(txq->tail_ptr, 0);\n+}\n",
    "prefixes": [
        "dpdk-dev",
        "v3",
        "13/16"
    ]
}