Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1038961/?format=api
{ "id": 1038961, "url": "http://patchwork.ozlabs.org/api/patches/1038961/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190208205101.12078-13-anirudh.venkataramanan@intel.com/", "project": { "id": 46, "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api", "name": "Intel Wired Ethernet development", "link_name": "intel-wired-lan", "list_id": "intel-wired-lan.osuosl.org", "list_email": "intel-wired-lan@osuosl.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20190208205101.12078-13-anirudh.venkataramanan@intel.com>", "list_archive_url": null, "date": "2019-02-08T20:50:59", "name": "[S12,12/14] ice: Determine descriptor count and ring size based on PAGE_SIZE", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "324b91a33a3dbc7ee211603408bb9e89da01d92f", "submitter": { "id": 73601, "url": "http://patchwork.ozlabs.org/api/people/73601/?format=api", "name": "Anirudh Venkataramanan", "email": "anirudh.venkataramanan@intel.com" }, "delegate": { "id": 68, "url": "http://patchwork.ozlabs.org/api/users/68/?format=api", "username": "jtkirshe", "first_name": "Jeff", "last_name": "Kirsher", "email": "jeffrey.t.kirsher@intel.com" }, "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190208205101.12078-13-anirudh.venkataramanan@intel.com/mbox/", "series": [ { "id": 90914, "url": "http://patchwork.ozlabs.org/api/series/90914/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=90914", "date": "2019-02-08T20:50:49", "name": "Bug fixes and minor feature updates for ice", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/90914/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1038961/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1038961/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@osuosl.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.138; helo=whitealder.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com" ], "Received": [ "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 43x6pY2VPxz9sMp\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 9 Feb 2019 07:53:25 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id EBB3388062;\n\tFri, 8 Feb 2019 20:53:23 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id aUmCQbK2wLKt; Fri, 8 Feb 2019 20:53:22 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 664A28816A;\n\tFri, 8 Feb 2019 20:53:21 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id E2F4E1BF97C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 8 Feb 2019 20:51:10 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 1D0BC88161\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 8 Feb 2019 20:51:06 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id aBs0UeN7DRUQ for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 8 Feb 2019 20:51:05 +0000 (UTC)", "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id BD20C88178\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 8 Feb 2019 20:51:04 +0000 (UTC)", "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t08 Feb 2019 12:51:03 -0800", "from shasta.jf.intel.com ([10.166.241.11])\n\tby fmsmga002.fm.intel.com with ESMTP; 08 Feb 2019 12:51:02 -0800" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.58,348,1544515200\"; d=\"scan'208\";a=\"141869799\"", "From": "Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Fri, 8 Feb 2019 12:50:59 -0800", "Message-Id": "<20190208205101.12078-13-anirudh.venkataramanan@intel.com>", "X-Mailer": "git-send-email 2.14.5", "In-Reply-To": "<20190208205101.12078-1-anirudh.venkataramanan@intel.com>", "References": "<20190208205101.12078-1-anirudh.venkataramanan@intel.com>", "Subject": "[Intel-wired-lan] [PATCH S12 12/14] ice: Determine descriptor count\n\tand ring size based on PAGE_SIZE", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>", "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>", "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>" }, "content": "From: Brett Creeley <brett.creeley@intel.com>\n\nCurrently we set the default number of Tx and Rx descriptors to 128 by\ndefault. For Rx this amounts to a full page (assuming 4K pages) because\neach Rx descriptor is 32 Bytes, but for Tx it only amounts to a half\npage because each Tx descriptor is 16 Bytes (assuming 4K pages).\nInstead of assuming 4K pages, determine the ring size and the number of\ndescriptors for Tx and Rx based on a calculation using the PAGE_SIZE,\nICE_MAX_NUM_DESC, and ICE_REQ_DESC_MULTIPLE. This change is being made\nto improve the performance of the driver when using the default\nsettings.\n\nSigned-off-by: Brett Creeley <brett.creeley@intel.com>\nSigned-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice.h | 16 ++++++++++++++--\n drivers/net/ethernet/intel/ice/ice_lib.c | 28 ++++++++++++++++++++++++----\n drivers/net/ethernet/intel/ice/ice_txrx.c | 10 +++++-----\n 3 files changed, 43 insertions(+), 11 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h\nindex 02cbd7d92491..652dbfb5ab4e 100644\n--- a/drivers/net/ethernet/intel/ice/ice.h\n+++ b/drivers/net/ethernet/intel/ice/ice.h\n@@ -42,10 +42,21 @@\n \n extern const char ice_drv_ver[];\n #define ICE_BAR0\t\t0\n-#define ICE_DFLT_NUM_DESC\t128\n #define ICE_REQ_DESC_MULTIPLE\t32\n #define ICE_MIN_NUM_DESC\tICE_REQ_DESC_MULTIPLE\n #define ICE_MAX_NUM_DESC\t8160\n+/* set default number of Rx/Tx descriptors to the minimum between\n+ * ICE_MAX_NUM_DESC and the number of descriptors to fill up an entire page\n+ */\n+#define ICE_DFLT_NUM_RX_DESC\tmin_t(u16, ICE_MAX_NUM_DESC, \\\n+\t\t\t\t ALIGN(PAGE_SIZE / \\\n+\t\t\t\t\t sizeof(union ice_32byte_rx_desc), \\\n+\t\t\t\t\t ICE_REQ_DESC_MULTIPLE))\n+#define ICE_DFLT_NUM_TX_DESC\tmin_t(u16, ICE_MAX_NUM_DESC, \\\n+\t\t\t\t ALIGN(PAGE_SIZE / \\\n+\t\t\t\t\t sizeof(struct ice_tx_desc), \\\n+\t\t\t\t\t ICE_REQ_DESC_MULTIPLE))\n+\n #define ICE_DFLT_TRAFFIC_CLASS\tBIT(0)\n #define ICE_INT_NAME_STR_LEN\t(IFNAMSIZ + 16)\n #define ICE_ETHTOOL_FWVER_LEN\t32\n@@ -259,7 +270,8 @@ struct ice_vsi {\n \tu16 num_rxq;\t\t\t /* Used Rx queues */\n \tu16 req_txq;\t\t\t /* User requested Tx queues */\n \tu16 req_rxq;\t\t\t /* User requested Rx queues */\n-\tu16 num_desc;\n+\tu16 num_rx_desc;\n+\tu16 num_tx_desc;\n \tstruct ice_tc_cfg tc_cfg;\n } ____cacheline_internodealigned_in_smp;\n \ndiff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c\nindex 40e9df15777b..864007bc945e 100644\n--- a/drivers/net/ethernet/intel/ice/ice_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_lib.c\n@@ -276,7 +276,26 @@ static int ice_vsi_alloc_arrays(struct ice_vsi *vsi, bool alloc_qvectors)\n }\n \n /**\n- * ice_vsi_set_num_qs - Set num queues, descriptors and vectors for a VSI\n+ * ice_vsi_set_num_desc - Set number of descriptors for queues on this VSI\n+ * @vsi: the VSI being configured\n+ */\n+static void ice_vsi_set_num_desc(struct ice_vsi *vsi)\n+{\n+\tswitch (vsi->type) {\n+\tcase ICE_VSI_PF:\n+\t\tvsi->num_rx_desc = ICE_DFLT_NUM_RX_DESC;\n+\t\tvsi->num_tx_desc = ICE_DFLT_NUM_TX_DESC;\n+\t\tbreak;\n+\tdefault:\n+\t\tdev_dbg(&vsi->back->pdev->dev,\n+\t\t\t\"Not setting number of Tx/Rx descriptors for VSI type %d\\n\",\n+\t\t\tvsi->type);\n+\t\tbreak;\n+\t}\n+}\n+\n+/**\n+ * ice_vsi_set_num_qs - Set number of queues, descriptors and vectors for a VSI\n * @vsi: the VSI being configured\n *\n * Return 0 on success and a negative value on error\n@@ -297,7 +316,6 @@ static void ice_vsi_set_num_qs(struct ice_vsi *vsi)\n \t\t\tvsi->alloc_rxq = vsi->req_rxq;\n \t\t\tvsi->num_rxq = vsi->req_rxq;\n \t\t}\n-\t\tvsi->num_desc = ALIGN(ICE_DFLT_NUM_DESC, ICE_REQ_DESC_MULTIPLE);\n \t\tvsi->num_q_vectors = max_t(int, pf->num_lan_rx, pf->num_lan_tx);\n \t\tbreak;\n \tcase ICE_VSI_VF:\n@@ -315,6 +333,8 @@ static void ice_vsi_set_num_qs(struct ice_vsi *vsi)\n \t\t\t vsi->type);\n \t\tbreak;\n \t}\n+\n+\tice_vsi_set_num_desc(vsi);\n }\n \n /**\n@@ -1237,7 +1257,7 @@ static int ice_vsi_alloc_rings(struct ice_vsi *vsi)\n \t\tring->ring_active = false;\n \t\tring->vsi = vsi;\n \t\tring->dev = &pf->pdev->dev;\n-\t\tring->count = vsi->num_desc;\n+\t\tring->count = vsi->num_tx_desc;\n \t\tvsi->tx_rings[i] = ring;\n \t}\n \n@@ -1256,7 +1276,7 @@ static int ice_vsi_alloc_rings(struct ice_vsi *vsi)\n \t\tring->vsi = vsi;\n \t\tring->netdev = vsi->netdev;\n \t\tring->dev = &pf->pdev->dev;\n-\t\tring->count = vsi->num_desc;\n+\t\tring->count = vsi->num_rx_desc;\n \t\tvsi->rx_rings[i] = ring;\n \t}\n \ndiff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c\nindex c289d97f477d..fad308c936b2 100644\n--- a/drivers/net/ethernet/intel/ice/ice_txrx.c\n+++ b/drivers/net/ethernet/intel/ice/ice_txrx.c\n@@ -236,9 +236,9 @@ int ice_setup_tx_ring(struct ice_ring *tx_ring)\n \tif (!tx_ring->tx_buf)\n \t\treturn -ENOMEM;\n \n-\t/* round up to nearest 4K */\n+\t/* round up to nearest page */\n \ttx_ring->size = ALIGN(tx_ring->count * sizeof(struct ice_tx_desc),\n-\t\t\t 4096);\n+\t\t\t PAGE_SIZE);\n \ttx_ring->desc = dmam_alloc_coherent(dev, tx_ring->size, &tx_ring->dma,\n \t\t\t\t\t GFP_KERNEL);\n \tif (!tx_ring->desc) {\n@@ -339,9 +339,9 @@ int ice_setup_rx_ring(struct ice_ring *rx_ring)\n \tif (!rx_ring->rx_buf)\n \t\treturn -ENOMEM;\n \n-\t/* round up to nearest 4K */\n-\trx_ring->size = rx_ring->count * sizeof(union ice_32byte_rx_desc);\n-\trx_ring->size = ALIGN(rx_ring->size, 4096);\n+\t/* round up to nearest page */\n+\trx_ring->size = ALIGN(rx_ring->count * sizeof(union ice_32byte_rx_desc),\n+\t\t\t PAGE_SIZE);\n \trx_ring->desc = dmam_alloc_coherent(dev, rx_ring->size, &rx_ring->dma,\n \t\t\t\t\t GFP_KERNEL);\n \tif (!rx_ring->desc) {\n", "prefixes": [ "S12", "12/14" ] }