Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/16812/?format=api
http://patches.dpdk.org/api/patches/16812/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1477503907-11306-1-git-send-email-yongwang@vmware.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": "<1477503907-11306-1-git-send-email-yongwang@vmware.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1477503907-11306-1-git-send-email-yongwang@vmware.com", "date": "2016-10-26T17:45:07", "name": "[dpdk-dev] net/vmxnet3: fix mbuf release on reset/stop", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "c10607c22120267b04d2f1bd38d43e4aa5e4857c", "submitter": { "id": 93, "url": "http://patches.dpdk.org/api/people/93/?format=api", "name": "Yong Wang", "email": "yongwang@vmware.com" }, "delegate": { "id": 10, "url": "http://patches.dpdk.org/api/users/10/?format=api", "username": "bruce", "first_name": "Bruce", "last_name": "Richardson", "email": "bruce.richardson@intel.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1477503907-11306-1-git-send-email-yongwang@vmware.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/16812/comments/", "check": "pending", "checks": "http://patches.dpdk.org/api/patches/16812/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 112ECBD7D;\n\tWed, 26 Oct 2016 20:03:49 +0200 (CEST)", "from EX13-EDG-OU-001.vmware.com (ex13-edg-ou-001.vmware.com\n\t[208.91.0.189]) by dpdk.org (Postfix) with ESMTP id E32ADBD15\n\tfor <dev@dpdk.org>; Wed, 26 Oct 2016 20:03:47 +0200 (CEST)", "from sc9-mailhost2.vmware.com (10.113.161.72) by\n\tEX13-EDG-OU-001.vmware.com (10.113.208.155) with Microsoft SMTP\n\tServer id 15.0.1156.6; Wed, 26 Oct 2016 11:03:40 -0700", "from sc2-edge-ivybridge-01.eng.vmware.com\n\t(sc2-edge-ivybridge-01.eng.vmware.com [10.172.139.164])\n\tby sc9-mailhost2.vmware.com (Postfix) with ESMTP id 7DFBAB07AC;\n\tWed, 26 Oct 2016 11:03:46 -0700 (PDT)" ], "From": "Yong Wang <yongwang@vmware.com>", "To": "<stephen@networkplumber.org>", "Date": "Wed, 26 Oct 2016 10:45:07 -0700", "Message-ID": "<1477503907-11306-1-git-send-email-yongwang@vmware.com>", "X-Mailer": "git-send-email 1.9.1", "MIME-Version": "1.0", "Content-Type": "text/plain", "Received-SPF": "None (EX13-EDG-OU-001.vmware.com: yongwang@vmware.com does not\n\tdesignate permitted sender hosts)", "Cc": "dev@dpdk.org", "Subject": "[dpdk-dev] [PATCH] net/vmxnet3: fix mbuf release on reset/stop", "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": "During device reset/stop, vmxnet3 releases all mbufs in tx and\nrx cmd ring. For rx, we should go over all ring descriptors and\nfree using rte_pktmbuf_free_seg() instead of rte_pktmbuf_free()\nas the metadata of the mbuf might not be properly initialized\n(initialization after mempool creation is done in the rx routine)\nand the mbuf should always be a single-segment one when populated.\nFor tx, we can use the existing way as mbuf, if any, will be a\nvalid one stashed in the eop.\n\nFixes: dfaff37fc46d (\"vmxnet3: import new vmxnet3 poll mode driver implementation\")\nSigned-off-by: Yong Wang <yongwang@vmware.com>\n---\n drivers/net/vmxnet3/vmxnet3_rxtx.c | 34 +++++++++++++++++++++++++++++-----\n 1 file changed, 29 insertions(+), 5 deletions(-)", "diff": "diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c\nindex 31f396c..b109168 100644\n--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c\n+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c\n@@ -140,10 +140,10 @@ vmxnet3_txq_dump(struct vmxnet3_tx_queue *txq)\n #endif\n \n static void\n-vmxnet3_cmd_ring_release_mbufs(vmxnet3_cmd_ring_t *ring)\n+vmxnet3_tx_cmd_ring_release_mbufs(vmxnet3_cmd_ring_t *ring)\n {\n \twhile (ring->next2comp != ring->next2fill) {\n-\t\t/* No need to worry about tx desc ownership, device is quiesced by now. */\n+\t\t/* No need to worry about desc ownership, device is quiesced by now. */\n \t\tvmxnet3_buf_info_t *buf_info = ring->buf_info + ring->next2comp;\n \n \t\tif (buf_info->m) {\n@@ -157,9 +157,27 @@ vmxnet3_cmd_ring_release_mbufs(vmxnet3_cmd_ring_t *ring)\n }\n \n static void\n+vmxnet3_rx_cmd_ring_release_mbufs(vmxnet3_cmd_ring_t *ring)\n+{\n+\tuint32_t i;\n+\n+\tfor (i = 0; i < ring->size; i++) {\n+\t\t/* No need to worry about desc ownership, device is quiesced by now. */\n+\t\tvmxnet3_buf_info_t *buf_info = &ring->buf_info[i];\n+\n+\t\tif (buf_info->m) {\n+\t\t\trte_pktmbuf_free_seg(buf_info->m);\n+\t\t\tbuf_info->m = NULL;\n+\t\t\tbuf_info->bufPA = 0;\n+\t\t\tbuf_info->len = 0;\n+\t\t}\n+\t\tvmxnet3_cmd_ring_adv_next2comp(ring);\n+\t}\n+}\n+\n+static void\n vmxnet3_cmd_ring_release(vmxnet3_cmd_ring_t *ring)\n {\n-\tvmxnet3_cmd_ring_release_mbufs(ring);\n \trte_free(ring->buf_info);\n \tring->buf_info = NULL;\n }\n@@ -170,6 +188,8 @@ vmxnet3_dev_tx_queue_release(void *txq)\n \tvmxnet3_tx_queue_t *tq = txq;\n \n \tif (tq != NULL) {\n+\t\t/* Release mbufs */\n+\t\tvmxnet3_tx_cmd_ring_release_mbufs(&tq->cmd_ring);\n \t\t/* Release the cmd_ring */\n \t\tvmxnet3_cmd_ring_release(&tq->cmd_ring);\n \t}\n@@ -182,6 +202,10 @@ vmxnet3_dev_rx_queue_release(void *rxq)\n \tvmxnet3_rx_queue_t *rq = rxq;\n \n \tif (rq != NULL) {\n+\t\t/* Release mbufs */\n+\t\tfor (i = 0; i < VMXNET3_RX_CMDRING_SIZE; i++)\n+\t\t\tvmxnet3_rx_cmd_ring_release_mbufs(&rq->cmd_ring[i]);\n+\n \t\t/* Release both the cmd_rings */\n \t\tfor (i = 0; i < VMXNET3_RX_CMDRING_SIZE; i++)\n \t\t\tvmxnet3_cmd_ring_release(&rq->cmd_ring[i]);\n@@ -199,7 +223,7 @@ vmxnet3_dev_tx_queue_reset(void *txq)\n \n \tif (tq != NULL) {\n \t\t/* Release the cmd_ring mbufs */\n-\t\tvmxnet3_cmd_ring_release_mbufs(&tq->cmd_ring);\n+\t\tvmxnet3_tx_cmd_ring_release_mbufs(&tq->cmd_ring);\n \t}\n \n \t/* Tx vmxnet rings structure initialization*/\n@@ -228,7 +252,7 @@ vmxnet3_dev_rx_queue_reset(void *rxq)\n \tif (rq != NULL) {\n \t\t/* Release both the cmd_rings mbufs */\n \t\tfor (i = 0; i < VMXNET3_RX_CMDRING_SIZE; i++)\n-\t\t\tvmxnet3_cmd_ring_release_mbufs(&rq->cmd_ring[i]);\n+\t\t\tvmxnet3_rx_cmd_ring_release_mbufs(&rq->cmd_ring[i]);\n \t}\n \n \tring0 = &rq->cmd_ring[0];\n", "prefixes": [ "dpdk-dev" ] }{ "id": 16812, "url": "