get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 7983,
    "url": "http://patches.dpdk.org/api/patches/7983/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1445640444-30340-1-git-send-email-johndale@cisco.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<1445640444-30340-1-git-send-email-johndale@cisco.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1445640444-30340-1-git-send-email-johndale@cisco.com",
    "date": "2015-10-23T22:47:24",
    "name": "[dpdk-dev] enic: improve Tx packet rate",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "24583a7a36e75734be994dc53142c59298473bf6",
    "submitter": {
        "id": 359,
        "url": "http://patches.dpdk.org/api/people/359/?format=api",
        "name": "John Daley (johndale)",
        "email": "johndale@cisco.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1445640444-30340-1-git-send-email-johndale@cisco.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/7983/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/7983/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 90FCE593A;\n\tSat, 24 Oct 2015 00:47:29 +0200 (CEST)",
            "from rcdn-iport-4.cisco.com (rcdn-iport-4.cisco.com [173.37.86.75])\n\tby dpdk.org (Postfix) with ESMTP id 1EAFB5927\n\tfor <dev@dpdk.org>; Sat, 24 Oct 2015 00:47:28 +0200 (CEST)",
            "from alln-core-2.cisco.com ([173.36.13.135])\n\tby rcdn-iport-4.cisco.com with ESMTP; 23 Oct 2015 22:47:27 +0000",
            "from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48])\n\tby alln-core-2.cisco.com (8.14.5/8.14.5) with ESMTP id t9NMlQje019533;\n\tFri, 23 Oct 2015 22:47:27 GMT",
            "by cisco.com (Postfix, from userid 392789)\n\tid D65443FAAD1F; Fri, 23 Oct 2015 15:47:26 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n\td=cisco.com; i=@cisco.com; l=8403; q=dns/txt; s=iport;\n\tt=1445640448; x=1446850048;\n\th=from:to:cc:subject:date:message-id;\n\tbh=xmdwfmD7f46pqgpE/Qun4TM/Ew4jjivRMB3iYPEl/j8=;\n\tb=TMw6Y+G4d24nyCWiwxmcIYrqR+3prCbzleucTqW87xBe5m4DOULRynmw\n\thnTdJ1o3E1xhXCmKY/C966MGnsVLRdpRUZ3eIHfp4SZTXPi5LtsnJz0oF\n\tM9XeXg2hZoqweun2bgiKdIvk4pOlmvR0nKX44H25BqfsdJpI71Y3WK4lr o=;",
        "X-IronPort-AV": "E=Sophos;i=\"5.20,188,1444694400\"; d=\"scan'208\";a=\"40398167\"",
        "From": "John Daley <johndale@cisco.com>",
        "To": "dev@dpdk.org",
        "Date": "Fri, 23 Oct 2015 15:47:24 -0700",
        "Message-Id": "<1445640444-30340-1-git-send-email-johndale@cisco.com>",
        "X-Mailer": "git-send-email 2.4.3",
        "Cc": "John Daley <johndale@cisco.com>",
        "Subject": "[dpdk-dev] [PATCH] enic: improve Tx packet rate",
        "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": "For every packet sent, a completion was being requested and the\nposted_index register on the nic was being updated. Instead,\nrequest a completion and update the posted index once per burst\nafter all packets have been sent by the burst function.\n\nSigned-off-by: John Daley <johndale@cisco.com>\nAcked-by: Sujith Sankar <ssujith@cisco.com>\n---\n drivers/net/enic/base/enic_vnic_wq.h | 80 ++++++++++++++++++++++++++++++++++++\n drivers/net/enic/enic.h              |  7 ++--\n drivers/net/enic/enic_ethdev.c       | 25 +++++++----\n drivers/net/enic/enic_main.c         | 16 ++++----\n 4 files changed, 109 insertions(+), 19 deletions(-)\n create mode 100644 drivers/net/enic/base/enic_vnic_wq.h",
    "diff": "diff --git a/drivers/net/enic/base/enic_vnic_wq.h b/drivers/net/enic/base/enic_vnic_wq.h\nnew file mode 100644\nindex 0000000..abe1850\n--- /dev/null\n+++ b/drivers/net/enic/base/enic_vnic_wq.h\n@@ -0,0 +1,80 @@\n+/*\n+ * Copyright 2008-2015 Cisco Systems, Inc.  All rights reserved.\n+ * Copyright 2007 Nuova Systems, Inc.  All rights reserved.\n+ *\n+ * Copyright (c) 2015, Cisco Systems, Inc.\n+ * All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions\n+ * are met:\n+ *\n+ * 1. Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions and the following disclaimer.\n+ *\n+ * 2. Redistributions in binary form must reproduce the above copyright\n+ * notice, this list of conditions and the following disclaimer in\n+ * the documentation and/or other materials provided with the\n+ * distribution.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\n+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+ * POSSIBILITY OF SUCH DAMAGE.\n+ *\n+ */\n+\n+#ifndef _ENIC_VNIC_WQ_H_\n+#define _ENIC_VNIC_WQ_H_\n+\n+#include \"vnic_dev.h\"\n+#include \"vnic_cq.h\"\n+\n+static inline void enic_vnic_post_wq_index(struct vnic_wq *wq)\n+{\n+       struct vnic_wq_buf *buf = wq->to_use;\n+\n+       /* Adding write memory barrier prevents compiler and/or CPU\n+        * reordering, thus avoiding descriptor posting before\n+        * descriptor is initialized. Otherwise, hardware can read\n+        * stale descriptor fields.\n+        */\n+       wmb();\n+       iowrite32(buf->index, &wq->ctrl->posted_index);\n+}\n+\n+static inline void enic_vnic_post_wq(struct vnic_wq *wq,\n+        void *os_buf, dma_addr_t dma_addr,\n+        unsigned int len, int sop,\n+        uint8_t desc_skip_cnt, uint8_t cq_entry,\n+        uint8_t compressed_send, uint64_t wrid)\n+{\n+        struct vnic_wq_buf *buf = wq->to_use;\n+\n+        buf->sop = sop;\n+        buf->cq_entry = cq_entry;\n+        buf->compressed_send = compressed_send;\n+        buf->desc_skip_cnt = desc_skip_cnt;\n+        buf->os_buf = os_buf;\n+        buf->dma_addr = dma_addr;\n+        buf->len = len;\n+        buf->wr_id = wrid;\n+\n+        buf = buf->next;\n+        if (cq_entry) {\n+\t\tenic_vnic_post_wq_index(wq);\n+        }\n+        wq->to_use = buf;\n+\n+        wq->ring.desc_avail -= desc_skip_cnt;\n+}\n+\n+#endif /* _ENIC_VNIC_WQ_H_ */\ndiff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h\nindex 91faeaf..c7bc742 100644\n--- a/drivers/net/enic/enic.h\n+++ b/drivers/net/enic/enic.h\n@@ -48,7 +48,7 @@\n \n #define DRV_NAME\t\t\"enic_pmd\"\n #define DRV_DESCRIPTION\t\t\"Cisco VIC Ethernet NIC Poll-mode Driver\"\n-#define DRV_VERSION\t\t\"1.0.0.5\"\n+#define DRV_VERSION\t\t\"1.0.0.6\"\n #define DRV_COPYRIGHT\t\t\"Copyright 2008-2015 Cisco Systems, Inc\"\n \n #define ENIC_WQ_MAX\t\t8\n@@ -187,10 +187,11 @@ extern void enic_add_packet_filter(struct enic *enic);\n extern void enic_set_mac_address(struct enic *enic, uint8_t *mac_addr);\n extern void enic_del_mac_address(struct enic *enic);\n extern unsigned int enic_cleanup_wq(struct enic *enic, struct vnic_wq *wq);\n-extern int enic_send_pkt(struct enic *enic, struct vnic_wq *wq,\n+extern void enic_send_pkt(struct enic *enic, struct vnic_wq *wq,\n \tstruct rte_mbuf *tx_pkt, unsigned short len,\n-\tuint8_t sop, uint8_t eop,\n+\tuint8_t sop, uint8_t eop, uint8_t cq_entry,\n \tuint16_t ol_flags, uint16_t vlan_tag);\n+extern void enic_post_wq_index(struct vnic_wq *wq);\n extern int enic_poll(struct vnic_rq *rq, struct rte_mbuf **rx_pkts,\n \tunsigned int budget, unsigned int *work_done);\n extern int enic_probe(struct enic *enic);\ndiff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c\nindex e385560..1e7c823 100644\n--- a/drivers/net/enic/enic_ethdev.c\n+++ b/drivers/net/enic/enic_ethdev.c\n@@ -488,36 +488,43 @@ static uint16_t enicpmd_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\n \tunsigned int seg_len;\n \tunsigned int inc_len;\n \tunsigned int nb_segs;\n-\tstruct rte_mbuf *tx_pkt;\n+\tstruct rte_mbuf *tx_pkt, *next_tx_pkt;\n \tstruct vnic_wq *wq = (struct vnic_wq *)tx_queue;\n \tstruct enic *enic = vnic_dev_priv(wq->vdev);\n \tunsigned short vlan_id;\n \tunsigned short ol_flags;\n+\tuint8_t last_seg, eop;\n \n \tfor (index = 0; index < nb_pkts; index++) {\n \t\ttx_pkt = *tx_pkts++;\n \t\tinc_len = 0;\n \t\tnb_segs = tx_pkt->nb_segs;\n \t\tif (nb_segs > vnic_wq_desc_avail(wq)) {\n+\t\t\tif (index > 0) {\n+\t\t\t\tenic_post_wq_index(wq);\n+\t\t\t}\n+\n \t\t\t/* wq cleanup and try again */\n \t\t\tif (!enic_cleanup_wq(enic, wq) ||\n-\t\t\t\t(nb_segs > vnic_wq_desc_avail(wq)))\n+\t\t\t\t(nb_segs > vnic_wq_desc_avail(wq))) {\n \t\t\t\treturn index;\n+\t\t\t}\n \t\t}\n \t\tpkt_len = tx_pkt->pkt_len;\n \t\tvlan_id = tx_pkt->vlan_tci;\n \t\tol_flags = tx_pkt->ol_flags;\n \t\tfor (frags = 0; inc_len < pkt_len; frags++) {\n-\t\t\tif (!tx_pkt)\n+\t\t\tif (!tx_pkt) {\n \t\t\t\tbreak;\n+\t\t\t}\n+\t\t\tnext_tx_pkt = tx_pkt->next;\n \t\t\tseg_len = tx_pkt->data_len;\n \t\t\tinc_len += seg_len;\n-\t\t\tif (enic_send_pkt(enic, wq, tx_pkt,\n-\t\t\t\t    (unsigned short)seg_len, !frags,\n-\t\t\t\t    (pkt_len == inc_len), ol_flags, vlan_id)) {\n-\t\t\t\tbreak;\n-\t\t\t}\n-\t\t\ttx_pkt = tx_pkt->next;\n+\t\t\teop = (pkt_len == inc_len) || (next_tx_pkt == NULL);\n+\t\t\tlast_seg = eop && (index == ((unsigned int)nb_pkts - 1));\n+\t\t\tenic_send_pkt(enic, wq, tx_pkt, (unsigned short)seg_len,\n+\t\t\t\t!frags, eop, last_seg, ol_flags, vlan_id);\n+\t\t\ttx_pkt = next_tx_pkt;\n \t\t}\n \t}\n \ndiff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c\nindex c3c62c4..22ac60e 100644\n--- a/drivers/net/enic/enic_main.c\n+++ b/drivers/net/enic/enic_main.c\n@@ -58,6 +58,7 @@\n #include \"vnic_cq.h\"\n #include \"vnic_intr.h\"\n #include \"vnic_nic.h\"\n+#include \"enic_vnic_wq.h\"\n \n static inline int enic_is_sriov_vf(struct enic *enic)\n {\n@@ -151,15 +152,18 @@ unsigned int enic_cleanup_wq(struct enic *enic, struct vnic_wq *wq)\n \t\t-1 /*wq_work_to_do*/, enic_wq_service, NULL);\n }\n \n+void enic_post_wq_index(struct vnic_wq *wq)\n+{\n+\tenic_vnic_post_wq_index(wq);\n+}\n \n-int enic_send_pkt(struct enic *enic, struct vnic_wq *wq,\n+void enic_send_pkt(struct enic *enic, struct vnic_wq *wq,\n \tstruct rte_mbuf *tx_pkt, unsigned short len,\n-\tuint8_t sop, uint8_t eop,\n+\tuint8_t sop, uint8_t eop, uint8_t cq_entry,\n \tuint16_t ol_flags, uint16_t vlan_tag)\n {\n \tstruct wq_enet_desc *desc = vnic_wq_next_desc(wq);\n \tuint16_t mss = 0;\n-\tuint8_t cq_entry = eop;\n \tuint8_t vlan_tag_insert = 0;\n \tuint64_t bus_addr = (dma_addr_t)\n \t    (tx_pkt->buf_physaddr + RTE_PKTMBUF_HEADROOM);\n@@ -190,14 +194,12 @@ int enic_send_pkt(struct enic *enic, struct vnic_wq *wq,\n \t\tvlan_tag,\n \t\t0 /* loopback */);\n \n-\tvnic_wq_post(wq, (void *)tx_pkt, bus_addr, len,\n-\t\tsop, eop,\n+\tenic_vnic_post_wq(wq, (void *)tx_pkt, bus_addr, len,\n+\t\tsop,\n \t\t1 /*desc_skip_cnt*/,\n \t\tcq_entry,\n \t\t0 /*compressed send*/,\n \t\t0 /*wrid*/);\n-\n-\treturn 0;\n }\n \n void enic_dev_stats_clear(struct enic *enic)\n",
    "prefixes": [
        "dpdk-dev"
    ]
}