Show a patch.

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

{
    "id": 43659,
    "url": "http://patches.dpdk.org/api/patches/43659/",
    "web_url": "http://patches.dpdk.org/patch/43659/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<20180809175008.5787-5-stephen@networkplumber.org>",
    "date": "2018-08-09T17:50:08",
    "name": "[4/4] netvsc: implement tx_done_cleanup",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "af2299068e9e51d84c55e29f149a20e2a4c756ab",
    "submitter": {
        "id": 27,
        "url": "http://patches.dpdk.org/api/people/27/",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@intel.com"
    },
    "mbox": "http://patches.dpdk.org/patch/43659/mbox/",
    "series": [
        {
            "id": 954,
            "url": "http://patches.dpdk.org/api/series/954/",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=954",
            "date": "2018-08-09T17:50:04",
            "name": "netvsc performance enhancements",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/954/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/43659/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/43659/checks/",
    "tags": {},
    "headers": {
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "To": "dev@dpdk.org",
        "X-Google-Smtp-Source": "AA+uWPyTz8xDKtCv5456ImjjS+FSTMVUjLQfjr2caxCTmgLuprZebpGEiDKNl0A24/jZnoLsobu8Rw==",
        "Message-Id": "<20180809175008.5787-5-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.18.0",
        "X-Gm-Message-State": "AOUpUlHlTqq5lhFANTiopReOLtY3SJPjIXnsH8kngJb9X7vhgn98KA5E\n\tJat2CoTRAtYAWampGq/Lfo4JaeXs4g0=",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=networkplumber-org.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=Nu/qK3zVLfLflxQC1/BZ40Ryby39Zg+goe32F4QiVSM=;\n\tb=Elcm1zbnJUg59H5xSsWQzSiop9d32wRpXDG0VrxArWua4ZW7ZfaYUG5yO2RYsPlaY3\n\tGykhChyEViJcOheMNnq8NRSW9/cK5QiHZ1jph+MG8oFFEPWpKKoE3F6W3sR9ix/b9L0g\n\tU/7q+KbfmB7NDu0El/B0ervzK7btLbpCGRBJR4Z89+TVaQQl/MBftk6jUDzg0aOAeLun\n\t+U2w7jaH19xjlUsNMgAaokE1KlZsNjKLnKsVPYnCq8Czmg26MhQV4j3yv8qaKBJJslg4\n\tK6MK/tunEzaVTkETbkmKKhqJr56Bo1UaQiWancQVMofK2ktYW9SyrII2eeG5tzWXPFwy\n\tIQcA==",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-BeenThere": "dev@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 2F29C4C8D;\n\tThu,  9 Aug 2018 19:50:29 +0200 (CEST)",
            "from mail-pl0-f68.google.com (mail-pl0-f68.google.com\n\t[209.85.160.68]) by dpdk.org (Postfix) with ESMTP id EBC31343C\n\tfor <dev@dpdk.org>; Thu,  9 Aug 2018 19:50:23 +0200 (CEST)",
            "by mail-pl0-f68.google.com with SMTP id g6-v6so2852140plq.9\n\tfor <dev@dpdk.org>; Thu, 09 Aug 2018 10:50:23 -0700 (PDT)",
            "from xeon-e3.lan (204-195-22-127.wavecable.com. [204.195.22.127])\n\tby smtp.gmail.com with ESMTPSA id\n\tn22-v6sm14993873pfj.68.2018.08.09.10.50.21\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tThu, 09 Aug 2018 10:50:22 -0700 (PDT)"
        ],
        "Subject": "[dpdk-dev] [PATCH 4/4] netvsc: implement tx_done_cleanup",
        "In-Reply-To": "<20180809175008.5787-1-stephen@networkplumber.org>",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>,\n\tStephen Hemminger <sthemmin@microsoft.com>",
        "Precedence": "list",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "X-Received": "by 2002:a17:902:864b:: with SMTP id\n\ty11-v6mr2952519plt.335.1533837022854; \n\tThu, 09 Aug 2018 10:50:22 -0700 (PDT)",
        "References": "<20180809175008.5787-1-stephen@networkplumber.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Errors-To": "dev-bounces@dpdk.org",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Delivered-To": "patchwork@dpdk.org",
        "Date": "Thu,  9 Aug 2018 10:50:08 -0700",
        "X-Mailman-Version": "2.1.15",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=Nu/qK3zVLfLflxQC1/BZ40Ryby39Zg+goe32F4QiVSM=;\n\tb=JlYbJRqt1NYisIl+2idopKrWZk8ngTlO3IvtGHYgO0nmS+4e7PDikHFbaiHfe/1P/8\n\tPkBAYFcTLuwAU/G6+BT6qhySHK2SG6ItFFH1s7ASaxcr8i/XCd1DZubJ4QnzR7U45VsE\n\tBHRBklFvwCnFdgui6BZ4LBK7v+eMqV4nyRjXo0ZIunf7CiqC0DadduisK1xMtbtxmi8l\n\tgTTjtoUZfz5cqV7/L6TrdSPJP1HgLuiA3MEKu4BvhKqljJORmrgkBf+G/HCWz6DKl8vw\n\tZxZckH0qzY03B8ynZ92dbY6Du7PezAja6vPR48ERGq8PSOJ7ClDUJb+RGB6oZsSZQMg+\n\t/dgg=="
    },
    "content": "Add tx_done_cleanup ethdev hook to allow application to\ncontrol if/when it wants completions to be handled.\n\nSigned-off-by: Stephen Hemminger <sthemmin@microsoft.com>\n---\n drivers/net/netvsc/hn_ethdev.c |  1 +\n drivers/net/netvsc/hn_rndis.c  |  2 +-\n drivers/net/netvsc/hn_rxtx.c   | 26 +++++++++++++++++++++-----\n drivers/net/netvsc/hn_var.h    |  4 +++-\n 4 files changed, 26 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c\nindex 148e6a33d682..2200ee319f98 100644\n--- a/drivers/net/netvsc/hn_ethdev.c\n+++ b/drivers/net/netvsc/hn_ethdev.c\n@@ -547,6 +547,7 @@ static const struct eth_dev_ops hn_eth_dev_ops = {\n \t.allmulticast_disable   = hn_dev_allmulticast_disable,\n \t.tx_queue_setup\t\t= hn_dev_tx_queue_setup,\n \t.tx_queue_release\t= hn_dev_tx_queue_release,\n+\t.tx_done_cleanup        = hn_dev_tx_done_cleanup,\n \t.rx_queue_setup\t\t= hn_dev_rx_queue_setup,\n \t.rx_queue_release\t= hn_dev_rx_queue_release,\n \t.link_update\t\t= hn_dev_link_update,\ndiff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c\nindex bde33969331e..f44add726b91 100644\n--- a/drivers/net/netvsc/hn_rndis.c\n+++ b/drivers/net/netvsc/hn_rndis.c\n@@ -382,7 +382,7 @@ static int hn_rndis_exec1(struct hn_data *hv,\n \tif (comp) {\n \t\t/* Poll primary channel until response received */\n \t\twhile (hv->rndis_pending == rid)\n-\t\t\thn_process_events(hv, 0);\n+\t\t\thn_process_events(hv, 0, 1);\n \n \t\tmemcpy(comp, hv->rndis_resp, comp_len);\n \t}\ndiff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c\nindex 02ef27e363cc..24abc2a91cea 100644\n--- a/drivers/net/netvsc/hn_rxtx.c\n+++ b/drivers/net/netvsc/hn_rxtx.c\n@@ -801,6 +801,14 @@ hn_dev_rx_queue_release(void *arg)\n \t}\n }\n \n+int\n+hn_dev_tx_done_cleanup(void *arg, uint32_t free_cnt)\n+{\n+\tstruct hn_tx_queue *txq = arg;\n+\n+\treturn hn_process_events(txq->hv, txq->queue_id, free_cnt);\n+}\n+\n void\n hn_dev_rx_queue_info(struct rte_eth_dev *dev, uint16_t queue_idx,\n \t\t     struct rte_eth_rxq_info *qinfo)\n@@ -831,25 +839,27 @@ hn_nvs_handle_notify(const struct vmbus_chanpkt_hdr *pkthdr,\n  * Process pending events on the channel.\n  * Called from both Rx queue poll and Tx cleanup\n  */\n-void hn_process_events(struct hn_data *hv, uint16_t queue_id)\n+uint32_t hn_process_events(struct hn_data *hv, uint16_t queue_id,\n+\t\t\t   uint32_t tx_limit)\n {\n \tstruct rte_eth_dev *dev = &rte_eth_devices[hv->port_id];\n \tstruct hn_rx_queue *rxq;\n \tuint32_t bytes_read = 0;\n+\tuint32_t tx_done = 0;\n \tint ret = 0;\n \n \trxq = queue_id == 0 ? hv->primary : dev->data->rx_queues[queue_id];\n \n \t/* If no pending data then nothing to do */\n \tif (rte_vmbus_chan_rx_empty(rxq->chan))\n-\t\treturn;\n+\t\treturn 0;\n \n \t/*\n \t * Since channel is shared between Rx and TX queue need to have a lock\n \t * since DPDK does not force same CPU to be used for Rx/Tx.\n \t */\n \tif (unlikely(!rte_spinlock_trylock(&rxq->ring_lock)))\n-\t\treturn;\n+\t\treturn 0;\n \n \tfor (;;) {\n \t\tconst struct vmbus_chanpkt_hdr *pkt;\n@@ -873,6 +883,7 @@ void hn_process_events(struct hn_data *hv, uint16_t queue_id)\n \n \t\tswitch (pkt->type) {\n \t\tcase VMBUS_CHANPKT_TYPE_COMP:\n+\t\t\t++tx_done;\n \t\t\thn_nvs_handle_comp(dev, queue_id, pkt, data);\n \t\t\tbreak;\n \n@@ -889,6 +900,9 @@ void hn_process_events(struct hn_data *hv, uint16_t queue_id)\n \t\t\tbreak;\n \t\t}\n \n+\t\tif (tx_limit && tx_done >= tx_limit)\n+\t\t\tbreak;\n+\n \t\tif (rxq->rx_ring && rte_ring_full(rxq->rx_ring))\n \t\t\tbreak;\n \t}\n@@ -897,6 +911,8 @@ void hn_process_events(struct hn_data *hv, uint16_t queue_id)\n \t\trte_vmbus_chan_signal_read(rxq->chan, bytes_read);\n \n \trte_spinlock_unlock(&rxq->ring_lock);\n+\n+\treturn tx_done;\n }\n \n static void hn_append_to_chim(struct hn_tx_queue *txq,\n@@ -1244,7 +1260,7 @@ hn_xmit_pkts(void *ptxq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)\n \t\treturn 0;\n \n \tif (rte_mempool_avail_count(hv->tx_pool) <= txq->free_thresh)\n-\t\thn_process_events(hv, txq->queue_id);\n+\t\thn_process_events(hv, txq->queue_id, 0);\n \n \tfor (nb_tx = 0; nb_tx < nb_pkts; nb_tx++) {\n \t\tstruct rte_mbuf *m = tx_pkts[nb_tx];\n@@ -1326,7 +1342,7 @@ hn_recv_pkts(void *prxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)\n \n \t/* If ring is empty then process more */\n \tif (rte_ring_count(rxq->rx_ring) < nb_pkts)\n-\t\thn_process_events(hv, rxq->queue_id);\n+\t\thn_process_events(hv, rxq->queue_id, 0);\n \n \t/* Get mbufs off staging ring */\n \treturn rte_ring_sc_dequeue_burst(rxq->rx_ring, (void **)rx_pkts,\ndiff --git a/drivers/net/netvsc/hn_var.h b/drivers/net/netvsc/hn_var.h\nindex b3e0a93d45df..fec8d7c402a5 100644\n--- a/drivers/net/netvsc/hn_var.h\n+++ b/drivers/net/netvsc/hn_var.h\n@@ -133,7 +133,8 @@ hn_primary_chan(const struct hn_data *hv)\n \treturn hv->channels[0];\n }\n \n-void hn_process_events(struct hn_data *hv, uint16_t queue_id);\n+uint32_t hn_process_events(struct hn_data *hv, uint16_t queue_id,\n+\t\t       uint32_t tx_limit);\n \n uint16_t hn_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\n \t\t      uint16_t nb_pkts);\n@@ -147,6 +148,7 @@ int\thn_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,\n void\thn_dev_tx_queue_release(void *arg);\n void\thn_dev_tx_queue_info(struct rte_eth_dev *dev, uint16_t queue_idx,\n \t\t\t     struct rte_eth_txq_info *qinfo);\n+int\thn_dev_tx_done_cleanup(void *arg, uint32_t free_cnt);\n \n struct hn_rx_queue *hn_rx_queue_alloc(struct hn_data *hv,\n \t\t\t\t      uint16_t queue_id,\n",
    "prefixes": [
        "4/4"
    ]
}