Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/41922/?format=api
http://patchwork.dpdk.org/api/patches/41922/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20180629092944.15576-10-johndale@cisco.com/", "project": { "id": 1, "url": "http://patchwork.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": "<20180629092944.15576-10-johndale@cisco.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20180629092944.15576-10-johndale@cisco.com", "date": "2018-06-29T09:29:38", "name": "[v2,09/15] net/enic: support mbuf fast free offload", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "2c9e8c2e30790d00423fcb5d14cb896b24e9057a", "submitter": { "id": 359, "url": "http://patchwork.dpdk.org/api/people/359/?format=api", "name": "John Daley (johndale)", "email": "johndale@cisco.com" }, "delegate": { "id": 319, "url": "http://patchwork.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20180629092944.15576-10-johndale@cisco.com/mbox/", "series": [ { "id": 308, "url": "http://patchwork.dpdk.org/api/series/308/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=308", "date": "2018-06-29T09:29:29", "name": "enic PMD fixes and performance improvements", "version": 2, "mbox": "http://patchwork.dpdk.org/series/308/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/41922/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/41922/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 7A9CE1B486;\n\tFri, 29 Jun 2018 11:33:15 +0200 (CEST)", "from alln-iport-4.cisco.com (alln-iport-4.cisco.com\n\t[173.37.142.91]) by dpdk.org (Postfix) with ESMTP id 44CA31B3A8\n\tfor <dev@dpdk.org>; Fri, 29 Jun 2018 11:33:13 +0200 (CEST)", "from alln-core-2.cisco.com ([173.36.13.135])\n\tby alln-iport-4.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t29 Jun 2018 09:33:12 +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 w5T9XCwT009307;\n\tFri, 29 Jun 2018 09:33:12 GMT", "by cisco.com (Postfix, from userid 392789)\n\tid 1539220F2001; Fri, 29 Jun 2018 02:33:12 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n\td=cisco.com; i=@cisco.com; l=5909; q=dns/txt; s=iport;\n\tt=1530264793; x=1531474393;\n\th=from:to:cc:subject:date:message-id:in-reply-to: references;\n\tbh=jBqCOrh7SeVAQAlLW1+spwQIm+yLivdRaFPXWyJCDfo=;\n\tb=W6Igni1LqA3bfKYhpo9NvtIjOZUlSKIYzBnvW7nK6RX3hHdoi8gPGnTX\n\tbDbeib+oOa/uUcoomJtU0Smnzv57DeDXziXe7oNTimBrB89jrnCMoV068\n\tEtPqWQoao15vC0WDlD7DivIu0DViCdwtanrChpsDtQO103qNEX24pzrqM U=;", "X-IronPort-AV": "E=Sophos;i=\"5.51,285,1526342400\"; d=\"scan'208\";a=\"136327474\"", "From": "John Daley <johndale@cisco.com>", "To": "ferruh.yigit@intel.com", "Cc": "dev@dpdk.org, Hyong Youb Kim <hyonkim@cisco.com>", "Date": "Fri, 29 Jun 2018 02:29:38 -0700", "Message-Id": "<20180629092944.15576-10-johndale@cisco.com>", "X-Mailer": "git-send-email 2.16.2", "In-Reply-To": "<20180629092944.15576-1-johndale@cisco.com>", "References": "<20180628031940.17397-1-johndale@cisco.com>\n\t<20180629092944.15576-1-johndale@cisco.com>", "Subject": "[dpdk-dev] [PATCH v2 09/15] net/enic: support mbuf fast free offload", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "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-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/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: Hyong Youb Kim <hyonkim@cisco.com>\n\nSigned-off-by: Hyong Youb Kim <hyonkim@cisco.com>\nReviewed-by: John Daley <johndale@cisco.com>\n---\n\nv2: documented new feature in enic.ini file\n\n doc/guides/nics/features/enic.ini | 1 +\n drivers/net/enic/base/vnic_wq.h | 1 +\n drivers/net/enic/enic.h | 1 +\n drivers/net/enic/enic_ethdev.c | 11 ++++++++---\n drivers/net/enic/enic_res.c | 2 ++\n drivers/net/enic/enic_rxtx.c | 30 +++++++++++++++++++++++++++++-\n 6 files changed, 42 insertions(+), 4 deletions(-)", "diff": "diff --git a/doc/guides/nics/features/enic.ini b/doc/guides/nics/features/enic.ini\nindex ae46d299a..31a3fb5cf 100644\n--- a/doc/guides/nics/features/enic.ini\n+++ b/doc/guides/nics/features/enic.ini\n@@ -6,6 +6,7 @@\n [Features]\n Link status = Y\n Link status event = Y\n+Fast mbuf free = Y\n Rx interrupt = Y\n Queue start/stop = Y\n MTU update = Y\ndiff --git a/drivers/net/enic/base/vnic_wq.h b/drivers/net/enic/base/vnic_wq.h\nindex 86ac10e28..6622a8a2d 100644\n--- a/drivers/net/enic/base/vnic_wq.h\n+++ b/drivers/net/enic/base/vnic_wq.h\n@@ -48,6 +48,7 @@ struct vnic_wq {\n \tunsigned int socket_id;\n \tconst struct rte_memzone *cqmsg_rz;\n \tuint16_t last_completed_index;\n+\tuint64_t offloads;\n };\n \n static inline unsigned int vnic_wq_desc_avail(struct vnic_wq *wq)\ndiff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h\nindex b611f0a24..af790fc2e 100644\n--- a/drivers/net/enic/enic.h\n+++ b/drivers/net/enic/enic.h\n@@ -183,6 +183,7 @@ struct enic {\n \n \tuint64_t rx_offload_capa; /* DEV_RX_OFFLOAD flags */\n \tuint64_t tx_offload_capa; /* DEV_TX_OFFLOAD flags */\n+\tuint64_t tx_queue_offload_capa; /* DEV_TX_OFFLOAD flags */\n \tuint64_t tx_offload_mask; /* PKT_TX flags accepted */\n };\n \ndiff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c\nindex 117b362de..ef18f8802 100644\n--- a/drivers/net/enic/enic_ethdev.c\n+++ b/drivers/net/enic/enic_ethdev.c\n@@ -185,17 +185,21 @@ static int enicpmd_dev_tx_queue_setup(struct rte_eth_dev *eth_dev,\n \tuint16_t queue_idx,\n \tuint16_t nb_desc,\n \tunsigned int socket_id,\n-\t__rte_unused const struct rte_eth_txconf *tx_conf)\n+\tconst struct rte_eth_txconf *tx_conf)\n {\n \tint ret;\n \tstruct enic *enic = pmd_priv(eth_dev);\n+\tstruct vnic_wq *wq;\n \n \tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n \t\treturn -E_RTE_SECONDARY;\n \n \tENICPMD_FUNC_TRACE();\n \tRTE_ASSERT(queue_idx < enic->conf_wq_count);\n-\teth_dev->data->tx_queues[queue_idx] = (void *)&enic->wq[queue_idx];\n+\twq = &enic->wq[queue_idx];\n+\twq->offloads = tx_conf->offloads |\n+\t\teth_dev->data->dev_conf.txmode.offloads;\n+\teth_dev->data->tx_queues[queue_idx] = (void *)wq;\n \n \tret = enic_alloc_wq(enic, queue_idx, socket_id, nb_desc);\n \tif (ret) {\n@@ -477,6 +481,7 @@ static void enicpmd_dev_info_get(struct rte_eth_dev *eth_dev,\n \tdevice_info->max_mac_addrs = ENIC_MAX_MAC_ADDR;\n \tdevice_info->rx_offload_capa = enic->rx_offload_capa;\n \tdevice_info->tx_offload_capa = enic->tx_offload_capa;\n+\tdevice_info->tx_queue_offload_capa = enic->tx_queue_offload_capa;\n \tdevice_info->default_rxconf = (struct rte_eth_rxconf) {\n \t\t.rx_free_thresh = ENIC_DEFAULT_RX_FREE_THRESH\n \t};\n@@ -765,7 +770,7 @@ static void enicpmd_dev_txq_info_get(struct rte_eth_dev *dev,\n \tENICPMD_FUNC_TRACE();\n \tqinfo->nb_desc = wq->ring.desc_count;\n \tmemset(&qinfo->conf, 0, sizeof(qinfo->conf));\n-\tqinfo->conf.offloads = enic->tx_offload_capa;\n+\tqinfo->conf.offloads = wq->offloads;\n \t/* tx_thresh, and all the other fields are not applicable for enic */\n }\n \ndiff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c\nindex d1113b2f1..11d66a626 100644\n--- a/drivers/net/enic/enic_res.c\n+++ b/drivers/net/enic/enic_res.c\n@@ -183,7 +183,9 @@ int enic_get_vnic_config(struct enic *enic)\n \t * Default hardware capabilities. enic_dev_init() may add additional\n \t * flags if it enables overlay offloads.\n \t */\n+\tenic->tx_queue_offload_capa = DEV_TX_OFFLOAD_MBUF_FAST_FREE;\n \tenic->tx_offload_capa =\n+\t\tenic->tx_queue_offload_capa |\n \t\tDEV_TX_OFFLOAD_MULTI_SEGS |\n \t\tDEV_TX_OFFLOAD_VLAN_INSERT |\n \t\tDEV_TX_OFFLOAD_IPV4_CKSUM |\ndiff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c\nindex 549288c20..89a1e66fe 100644\n--- a/drivers/net/enic/enic_rxtx.c\n+++ b/drivers/net/enic/enic_rxtx.c\n@@ -471,6 +471,31 @@ enic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,\n \treturn nb_rx;\n }\n \n+static void enic_fast_free_wq_bufs(struct vnic_wq *wq, u16 completed_index)\n+{\n+\tunsigned int desc_count, n, nb_to_free, tail_idx;\n+\tstruct rte_mempool *pool;\n+\tstruct rte_mbuf **m;\n+\n+\tdesc_count = wq->ring.desc_count;\n+\tnb_to_free = enic_ring_sub(desc_count, wq->tail_idx, completed_index)\n+\t\t\t\t + 1;\n+\ttail_idx = wq->tail_idx;\n+\twq->tail_idx += nb_to_free;\n+\twq->ring.desc_avail += nb_to_free;\n+\tif (wq->tail_idx >= desc_count)\n+\t\twq->tail_idx -= desc_count;\n+\t/* First, free at most until the end of ring */\n+\tm = &wq->bufs[tail_idx];\n+\tpool = (*m)->pool;\n+\tn = RTE_MIN(nb_to_free, desc_count - tail_idx);\n+\trte_mempool_put_bulk(pool, (void **)m, n);\n+\tn = nb_to_free - n;\n+\t/* Then wrap and free the rest */\n+\tif (unlikely(n))\n+\t\trte_mempool_put_bulk(pool, (void **)wq->bufs, n);\n+}\n+\n static inline void enic_free_wq_bufs(struct vnic_wq *wq, u16 completed_index)\n {\n \tstruct rte_mbuf *buf;\n@@ -518,7 +543,10 @@ unsigned int enic_cleanup_wq(__rte_unused struct enic *enic, struct vnic_wq *wq)\n \tcompleted_index = *((uint32_t *)wq->cqmsg_rz->addr) & 0xffff;\n \n \tif (wq->last_completed_index != completed_index) {\n-\t\tenic_free_wq_bufs(wq, completed_index);\n+\t\tif (wq->offloads & DEV_TX_OFFLOAD_MBUF_FAST_FREE)\n+\t\t\tenic_fast_free_wq_bufs(wq, completed_index);\n+\t\telse\n+\t\t\tenic_free_wq_bufs(wq, completed_index);\n \t\twq->last_completed_index = completed_index;\n \t}\n \treturn 0;\n", "prefixes": [ "v2", "09/15" ] }{ "id": 41922, "url": "