Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1229967/?format=api
{ "id": 1229967, "url": "http://patchwork.ozlabs.org/api/patches/1229967/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200127085927.13999-9-anthony.l.nguyen@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": "<20200127085927.13999-9-anthony.l.nguyen@intel.com>", "list_archive_url": null, "date": "2020-01-27T08:59:21", "name": "[S39,09/15] ice: Don't reject odd values of usecs set by user", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "ee8e5ced7b709cea74998eca9c7f23145c2a143a", "submitter": { "id": 68875, "url": "http://patchwork.ozlabs.org/api/people/68875/?format=api", "name": "Tony Nguyen", "email": "anthony.l.nguyen@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/20200127085927.13999-9-anthony.l.nguyen@intel.com/mbox/", "series": [ { "id": 155506, "url": "http://patchwork.ozlabs.org/api/series/155506/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=155506", "date": "2020-01-27T08:59:25", "name": "[S39,01/15] ice: Validate config for SW DCB map", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/155506/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1229967/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1229967/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; spf=pass (sender SPF authorized)\n\tsmtp.mailfrom=osuosl.org (client-ip=140.211.166.133;\n\thelo=hemlock.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 hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\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 485xdk5P5Gz9sRs\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 28 Jan 2020 04:32:26 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 4E93687987;\n\tMon, 27 Jan 2020 17:32:25 +0000 (UTC)", "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id tpCoCd0ZyIq3; Mon, 27 Jan 2020 17:32:23 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 3EFAF879F0;\n\tMon, 27 Jan 2020 17:32:23 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id A08901BF977\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 27 Jan 2020 17:32:18 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 9AD8385087\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 27 Jan 2020 17:32:18 +0000 (UTC)", "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id EgE-S_U4KC4E for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 27 Jan 2020 17:32:18 +0000 (UTC)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id C10D0850AD\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 27 Jan 2020 17:32:17 +0000 (UTC)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t27 Jan 2020 09:32:10 -0800", "from unknown (HELO localhost.jf.intel.com) ([10.166.244.174])\n\tby fmsmga005.fm.intel.com with ESMTP; 27 Jan 2020 09:32:10 -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.70,370,1574150400\"; d=\"scan'208\";a=\"427350653\"", "From": "Tony Nguyen <anthony.l.nguyen@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Mon, 27 Jan 2020 00:59:21 -0800", "Message-Id": "<20200127085927.13999-9-anthony.l.nguyen@intel.com>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20200127085927.13999-1-anthony.l.nguyen@intel.com>", "References": "<20200127085927.13999-1-anthony.l.nguyen@intel.com>", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH S39 09/15] ice: Don't reject odd values of\n\tusecs set by user", "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>", "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 if a user sets an odd [tx|rx]-usecs value through ethtool,\nthe request is denied because the hardware is set to have an ITR\ngranularity of 2us. This caused poor customer experience. Fix this by\naligning to a register allowed value, which results in rounding down.\nAlso, print a once per ring container type message to be clear about\nour intentions.\n\nAlso, change the ITR_TO_REG define to be the bitwise and of the ITR\nsetting and the ICE_ITR_MASK. This makes the purpose of ITR_TO_REG more\nobvious.\n\nSigned-off-by: Brett Creeley <brett.creeley@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice_ethtool.c | 49 +++++++++++++++-----\n drivers/net/ethernet/intel/ice/ice_txrx.h | 2 +-\n 2 files changed, 39 insertions(+), 12 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c\nindex db14ec2e0b46..ae0b63d5673d 100644\n--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c\n+++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c\n@@ -3488,21 +3488,13 @@ ice_set_rc_coalesce(enum ice_container_type c_type, struct ethtool_coalesce *ec,\n \t\treturn -EINVAL;\n \t}\n \n-\t/* hardware only supports an ITR granularity of 2us */\n-\tif (coalesce_usecs % 2 != 0) {\n-\t\tnetdev_info(vsi->netdev, \"Invalid value, %s-usecs must be even\\n\",\n-\t\t\t c_type_str);\n-\t\treturn -EINVAL;\n-\t}\n-\n \tif (use_adaptive_coalesce) {\n \t\trc->itr_setting |= ICE_ITR_DYNAMIC;\n \t} else {\n-\t\t/* store user facing value how it was set */\n+\t\t/* save the user set usecs */\n \t\trc->itr_setting = coalesce_usecs;\n-\t\t/* set to static and convert to value HW understands */\n-\t\trc->target_itr =\n-\t\t\tITR_TO_REG(ITR_REG_ALIGN(rc->itr_setting));\n+\t\t/* device ITR granularity is in 2 usec increments */\n+\t\trc->target_itr = ITR_REG_ALIGN(rc->itr_setting);\n \t}\n \n \treturn 0;\n@@ -3595,6 +3587,30 @@ ice_is_coalesce_param_invalid(struct net_device *netdev,\n \treturn 0;\n }\n \n+/**\n+ * ice_print_if_odd_usecs - print message if user tries to set odd [tx|rx]-usecs\n+ * @netdev: netdev used for print\n+ * @itr_setting: previous user setting\n+ * @use_adaptive_coalesce: if adaptive coalesce is enabled or being enabled\n+ * @coalesce_usecs: requested value of [tx|rx]-usecs\n+ * @c_type_str: either \"rx\" or \"tx\" to match user set field of [tx|rx]-usecs\n+ */\n+static void\n+ice_print_if_odd_usecs(struct net_device *netdev, u16 itr_setting,\n+\t\t u32 use_adaptive_coalesce, u32 coalesce_usecs,\n+\t\t const char *c_type_str)\n+{\n+\tif (use_adaptive_coalesce)\n+\t\treturn;\n+\n+\titr_setting = ITR_TO_REG(itr_setting);\n+\n+\tif (itr_setting != coalesce_usecs && (coalesce_usecs % 2))\n+\t\tnetdev_info(netdev, \"User set %s-usecs to %d, device only supports even values. Rounding down and attempting to set %s-usecs to %d\\n\",\n+\t\t\t c_type_str, coalesce_usecs, c_type_str,\n+\t\t\t ITR_REG_ALIGN(coalesce_usecs));\n+}\n+\n /**\n * __ice_set_coalesce - set ITR/INTRL values for the device\n * @netdev: pointer to the netdev associated with this query\n@@ -3615,8 +3631,19 @@ __ice_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *ec,\n \t\treturn -EINVAL;\n \n \tif (q_num < 0) {\n+\t\tstruct ice_q_vector *q_vector = vsi->q_vectors[0];\n \t\tint v_idx;\n \n+\t\tif (q_vector) {\n+\t\t\tice_print_if_odd_usecs(netdev, q_vector->rx.itr_setting,\n+\t\t\t\t\t ec->use_adaptive_rx_coalesce,\n+\t\t\t\t\t ec->rx_coalesce_usecs, \"rx\");\n+\n+\t\t\tice_print_if_odd_usecs(netdev, q_vector->tx.itr_setting,\n+\t\t\t\t\t ec->use_adaptive_tx_coalesce,\n+\t\t\t\t\t ec->tx_coalesce_usecs, \"tx\");\n+\t\t}\n+\n \t\tice_for_each_q_vector(vsi, v_idx) {\n \t\t\t/* In some cases if DCB is configured the num_[rx|tx]q\n \t\t\t * can be less than vsi->num_q_vectors. This check\ndiff --git a/drivers/net/ethernet/intel/ice/ice_txrx.h b/drivers/net/ethernet/intel/ice/ice_txrx.h\nindex a86270696df1..3e3cc2599824 100644\n--- a/drivers/net/ethernet/intel/ice/ice_txrx.h\n+++ b/drivers/net/ethernet/intel/ice/ice_txrx.h\n@@ -222,7 +222,7 @@ enum ice_rx_dtype {\n #define ICE_ITR_GRAN_S\t\t1\t/* ITR granularity is always 2us */\n #define ICE_ITR_GRAN_US\t\tBIT(ICE_ITR_GRAN_S)\n #define ICE_ITR_MASK\t\t0x1FFE\t/* ITR register value alignment mask */\n-#define ITR_REG_ALIGN(setting)\t__ALIGN_MASK(setting, ~ICE_ITR_MASK)\n+#define ITR_REG_ALIGN(setting)\t((setting) & ICE_ITR_MASK)\n \n #define ICE_ITR_ADAPTIVE_MIN_INC\t0x0002\n #define ICE_ITR_ADAPTIVE_MIN_USECS\t0x0002\n", "prefixes": [ "S39", "09/15" ] }