Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1261/?format=api
https://patches.dpdk.org/api/patches/1261/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1415831647-11139-3-git-send-email-huawei.xie@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": "<1415831647-11139-3-git-send-email-huawei.xie@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1415831647-11139-3-git-send-email-huawei.xie@intel.com", "date": "2014-11-12T22:34:07", "name": "[dpdk-dev,2/2] examples/vhost: use factorized default Rx/Tx configuration", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "301eecd02398ce328230a513e97c6004908f36b6", "submitter": { "id": 16, "url": "https://patches.dpdk.org/api/people/16/?format=api", "name": "Huawei Xie", "email": "huawei.xie@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1415831647-11139-3-git-send-email-huawei.xie@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/1261/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/1261/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 2ED9A7E9D;\n\tWed, 12 Nov 2014 23:25:09 +0100 (CET)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 2E5FD7E75\n\tfor <dev@dpdk.org>; Wed, 12 Nov 2014 23:25:06 +0100 (CET)", "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga101.jf.intel.com with ESMTP; 12 Nov 2014 14:35:01 -0800", "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby orsmga001.jf.intel.com with ESMTP; 12 Nov 2014 14:35:00 -0800", "from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com\n\t[10.239.29.90])\n\tby shvmail01.sh.intel.com with ESMTP id sACMYwLr026975;\n\tThu, 13 Nov 2014 06:34:58 +0800", "from shecgisg003.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid sACMYuSw011187; Thu, 13 Nov 2014 06:34:58 +0800", "(from hxie5@localhost)\n\tby shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id sACMYuYI011183; \n\tThu, 13 Nov 2014 06:34:56 +0800" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.07,371,1413270000\"; d=\"scan'208\";a=\"606902612\"", "From": "Huawei Xie <huawei.xie@intel.com>", "To": "dev@dpdk.org", "Date": "Thu, 13 Nov 2014 06:34:07 +0800", "Message-Id": "<1415831647-11139-3-git-send-email-huawei.xie@intel.com>", "X-Mailer": "git-send-email 1.7.4.1", "In-Reply-To": "<1415831647-11139-1-git-send-email-huawei.xie@intel.com>", "References": "<1415831647-11139-1-git-send-email-huawei.xie@intel.com>", "Subject": "[dpdk-dev] [PATCH 2/2] examples/vhost: use factorized default Rx/Tx\n\tconfiguration", "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": "Refer to Pablo's commit:\n \"use factorized default Rx/Tx configuration\n\n For apps that were using default rte_eth_rxconf and rte_eth_txconf\n structures, these have been removed and now they are obtained by\n calling rte_eth_dev_info_get, just before setting up RX/TX queues.\"\n\nmove zero copy's deferred start set up ahead.\n\nSigned-off-by: Huawei Xie <huawei.xie@intel.com>\n---\n examples/vhost/main.c | 78 +++++++++++++++------------------------------------\n 1 file changed, 22 insertions(+), 56 deletions(-)", "diff": "diff --git a/examples/vhost/main.c b/examples/vhost/main.c\nindex 2b1bf02..fa36913 100644\n--- a/examples/vhost/main.c\n+++ b/examples/vhost/main.c\n@@ -79,25 +79,6 @@\n \t+ RTE_PKTMBUF_HEADROOM)\n #define MBUF_CACHE_SIZE_ZCP 0\n \n-/*\n- * RX and TX Prefetch, Host, and Write-back threshold values should be\n- * carefully set for optimal performance. Consult the network\n- * controller's datasheet and supporting DPDK documentation for guidance\n- * on how these parameters should be set.\n- */\n-#define RX_PTHRESH 8 /* Default values of RX prefetch threshold reg. */\n-#define RX_HTHRESH 8 /* Default values of RX host threshold reg. */\n-#define RX_WTHRESH 4 /* Default values of RX write-back threshold reg. */\n-\n-/*\n- * These default values are optimized for use with the Intel(R) 82599 10 GbE\n- * Controller and the DPDK ixgbe PMD. Consider using other values for other\n- * network controllers and/or network drivers.\n- */\n-#define TX_PTHRESH 36 /* Default values of TX prefetch threshold reg. */\n-#define TX_HTHRESH 0 /* Default values of TX host threshold reg. */\n-#define TX_WTHRESH 0 /* Default values of TX write-back threshold reg. */\n-\n #define MAX_PKT_BURST 32 \t\t/* Max burst size for RX/TX */\n #define BURST_TX_DRAIN_US 100 \t/* TX drain every ~100us */\n \n@@ -217,32 +198,6 @@ static uint32_t burst_rx_retry_num = BURST_RX_RETRIES;\n /* Character device basename. Can be set by user. */\n static char dev_basename[MAX_BASENAME_SZ] = \"vhost-net\";\n \n-\n-/* Default configuration for rx and tx thresholds etc. */\n-static struct rte_eth_rxconf rx_conf_default = {\n-\t.rx_thresh = {\n-\t\t.pthresh = RX_PTHRESH,\n-\t\t.hthresh = RX_HTHRESH,\n-\t\t.wthresh = RX_WTHRESH,\n-\t},\n-\t.rx_drop_en = 1,\n-};\n-\n-/*\n- * These default values are optimized for use with the Intel(R) 82599 10 GbE\n- * Controller and the DPDK ixgbe/igb PMD. Consider using other values for other\n- * network controllers and/or network drivers.\n- */\n-static struct rte_eth_txconf tx_conf_default = {\n-\t.tx_thresh = {\n-\t\t.pthresh = TX_PTHRESH,\n-\t\t.hthresh = TX_HTHRESH,\n-\t\t.wthresh = TX_WTHRESH,\n-\t},\n-\t.tx_free_thresh = 0, /* Use PMD default values */\n-\t.tx_rs_thresh = 0, /* Use PMD default values */\n-};\n-\n /* empty vmdq configuration structure. Filled in programatically */\n static struct rte_eth_conf vmdq_conf_default = {\n \t.rxmode = {\n@@ -410,7 +365,9 @@ port_init(uint8_t port)\n {\n \tstruct rte_eth_dev_info dev_info;\n \tstruct rte_eth_conf port_conf;\n-\tuint16_t rx_rings, tx_rings;\n+\tstruct rte_eth_rxconf *rxconf;\n+\tstruct rte_eth_txconf *txconf;\n+\tint16_t rx_rings, tx_rings;\n \tuint16_t rx_ring_size, tx_ring_size;\n \tint retval;\n \tuint16_t q;\n@@ -418,6 +375,21 @@ port_init(uint8_t port)\n \t/* The max pool number from dev_info will be used to validate the pool number specified in cmd line */\n \trte_eth_dev_info_get (port, &dev_info);\n \n+\trxconf = &dev_info.default_rxconf;\n+\ttxconf = &dev_info.default_txconf;\n+\trxconf->rx_drop_en = 1;\n+\n+\t/*\n+\t * Zero copy defers queue RX/TX start to the time when guest\n+\t * finishes its startup and packet buffers from that guest are\n+\t * available.\n+\t */\n+\tif (zero_copy) {\n+\t\trxconf->rx_deferred_start = 1;\n+\t\trxconf->rx_drop_en = 0;\n+\t\ttxconf->tx_deferred_start = 1;\n+\t}\n+\n \t/*configure the number of supported virtio devices based on VMDQ limits */\n \tnum_devices = dev_info.max_vmdq_pools;\n \n@@ -460,14 +432,16 @@ port_init(uint8_t port)\n \t/* Setup the queues. */\n \tfor (q = 0; q < rx_rings; q ++) {\n \t\tretval = rte_eth_rx_queue_setup(port, q, rx_ring_size,\n-\t\t\t\t\t\trte_eth_dev_socket_id(port), &rx_conf_default,\n+\t\t\t\t\t\trte_eth_dev_socket_id(port),\n+\t\t\t\t\t\trxconf,\n \t\t\t\t\t\tvpool_array[q].pool);\n \t\tif (retval < 0)\n \t\t\treturn retval;\n \t}\n \tfor (q = 0; q < tx_rings; q ++) {\n \t\tretval = rte_eth_tx_queue_setup(port, q, tx_ring_size,\n-\t\t\t\t\t\trte_eth_dev_socket_id(port), &tx_conf_default);\n+\t\t\t\t\t\trte_eth_dev_socket_id(port),\n+\t\t\t\t\t\ttxconf);\n \t\tif (retval < 0)\n \t\t\treturn retval;\n \t}\n@@ -2920,14 +2894,6 @@ MAIN(int argc, char *argv[])\n \t\tchar pool_name[RTE_MEMPOOL_NAMESIZE];\n \t\tchar ring_name[RTE_MEMPOOL_NAMESIZE];\n \n-\t\t/*\n-\t\t * Zero copy defers queue RX/TX start to the time when guest\n-\t\t * finishes its startup and packet buffers from that guest are\n-\t\t * available.\n-\t\t */\n-\t\trx_conf_default.rx_deferred_start = (uint8_t)zero_copy;\n-\t\trx_conf_default.rx_drop_en = 0;\n-\t\ttx_conf_default.tx_deferred_start = (uint8_t)zero_copy;\n \t\tnb_mbuf = num_rx_descriptor\n \t\t\t+ num_switching_cores * MBUF_CACHE_SIZE_ZCP\n \t\t\t+ num_switching_cores * MAX_PKT_BURST;\n", "prefixes": [ "dpdk-dev", "2/2" ] }{ "id": 1261, "url": "