From patchwork Thu Jun 30 08:23:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 12901406 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 67697C43334 for ; Thu, 30 Jun 2022 08:24:09 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.358298.587435 (Exim 4.92) (envelope-from ) id 1o6pSv-0000KI-8B; Thu, 30 Jun 2022 08:23:57 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 358298.587435; Thu, 30 Jun 2022 08:23:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o6pSv-0000KB-5F; Thu, 30 Jun 2022 08:23:57 +0000 Received: by outflank-mailman (input) for mailman id 358298; Thu, 30 Jun 2022 08:23:55 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o6pSt-0000Hf-6u for xen-devel@lists.xenproject.org; Thu, 30 Jun 2022 08:23:55 +0000 Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id f7988413-f84d-11ec-bdce-3d151da133c5; Thu, 30 Jun 2022 10:23:51 +0200 (CEST) Received: from mail-mw2nam12lp2048.outbound.protection.outlook.com (HELO NAM12-MW2-obe.outbound.protection.outlook.com) ([104.47.66.48]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Jun 2022 04:23:50 -0400 Received: from DS7PR03MB5608.namprd03.prod.outlook.com (2603:10b6:5:2c9::18) by SJ0PR03MB5421.namprd03.prod.outlook.com (2603:10b6:a03:289::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.17; Thu, 30 Jun 2022 08:23:49 +0000 Received: from DS7PR03MB5608.namprd03.prod.outlook.com ([fe80::40af:d5f4:95eb:d534]) by DS7PR03MB5608.namprd03.prod.outlook.com ([fe80::40af:d5f4:95eb:d534%7]) with mapi id 15.20.5395.015; Thu, 30 Jun 2022 08:23:49 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f7988413-f84d-11ec-bdce-3d151da133c5 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1656577433; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=LiQtz8zgdXUTY6GP7spjzbqn2+XZTbP5Ey9lVx8mnXY=; b=h84DVu3Fki86Wa5Y2yoK6xA2biwKEvtM1g7INMlrGsDjpp0xFsgIlE2f ub32ubf2fdcJZ3kKYLJ/Yjq01EgZ3kmq7LEZi1PVjOP22h7G+bksVx/QR fZMQb+HVLk/SZjdKhZnp2SfTQMqu6eOv1pUFsf941/+Ium5O2eWM8W14Q g=; X-IronPort-RemoteIP: 104.47.66.48 X-IronPort-MID: 74792292 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:Zq9CN69Jm8bjULZSfpfNDrUDnX+TJUtcMsCJ2f8bNWPcYEJGY0x3z WQeD2yPa/6MM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yiXE32uWy5hNgtPuxvZKGcTJoMkILTfHjBquee1aKvS/lQFwhNvqxEchkd HKrRtlF8Nv60nJdmXwmhfp0xmI6kda11bSjXujxVfzq83wQzw3T+Bbg5hCTxff4008+Plhza NixQuixtZqJCKFuB64y8nDVhlsmEbxi2Eli/Qvg3tWVpZbQKNNrLYY4FheHP47bW/HAbgcYa dT5fznlbdrmQvwVQGYgoAv+q3nYp0LJGbIfqBY0fblkAS/nxhCvjklLYIk7zU9HakGOuh5Dt T/Q9pVfY51P78rhNpGdYE8qOuMexjwqEH3QRWvCGWiMp07EFTwjLOyyIkJxYiRCe81Jd0J6d /8bG8= X-IronPort-AV: E=Sophos;i="5.92,233,1650945600"; d="scan'208";a="74792292" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h1nJANIOw43GRn2uUJN7wZbfABXSrBiBRQtmUp8PY1kseLDK1fu3OKKm9C8qqG6iBfQ7QIl7L76O9f20yt+WeFNg/ipthcCJmkCjfCX/WNrBnXD5h8cEpkaA3zf/WhsgJmVoERF6rsrQ0b2BWawpvC5eYb9iBHw4ruq6x97GW3fgp5fkp9KkteLXe8lpO6L034X1bMdZGa0FhWZFffaw1UFqVBt/YhS18v6Jt1HxaTUH1QwPkM1yJGoFVOks1czlEFOwzs6biLddXzsr/Btmr+uWEcmM6k+xPbEHHCMs2B1U7PYwaU7lT3MJBLwTEomBBM0J5JSTuCKEjrU57WkuJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nfkwqWP0v5owMG2H+4Xard4Xv9SJblLQOcMul3+LP/Y=; b=KC9NwnBLvnbSW6CZ7AE7P1414OY0URnwlZscOV8xThzqNlHU/P7XKDQ2YThlZXbEKCBUSsLJp2SkBVmvQ+r6kJYUZzaHE2PSmhBEF8zshixmR2fsCQswtKTSmDT55uHMrkk66pTO3lG9nHtbQnNHvbzZ266VOP+rl8gQ8yc89ynBDVAUaQhyVN8jWzoU8agBkjWAC7/IDl4lwmk/RyDZExRgjrE9uUusYXX2CAEMUFS3DnPXVg/5oDHyqQ5llTsADygOXowmnaGzlTVHwWFt1QVuZ+pYicA1yiV29yo1MqwoRYN6bwHeyzFa8DeVLFmy6JTPiWZd3GDtcRspM+EKwg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nfkwqWP0v5owMG2H+4Xard4Xv9SJblLQOcMul3+LP/Y=; b=fGdOMJO3S7DtpsE9USz4zqXp1EcwE7r3muu23nU/dnAkFndejhQ3/f0dKHSmNH+VvEtDFxsP3p1IN07lZc48JqquQ/WRU3LJ34mt3l+VfjfxgQMtmHP1/utyKipguSfOW04GfefviuSz9FPfZMSLWzeeuExeN5lhmYXdGs0A5gs= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com; From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Roger Pau Monne , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH v2 1/2] console/serial: set the default transmit buffer size in Kconfig Date: Thu, 30 Jun 2022 10:23:29 +0200 Message-Id: <20220630082330.82706-2-roger.pau@citrix.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220630082330.82706-1-roger.pau@citrix.com> References: <20220630082330.82706-1-roger.pau@citrix.com> X-ClientProxiedBy: LO2P265CA0191.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a::35) To DS7PR03MB5608.namprd03.prod.outlook.com (2603:10b6:5:2c9::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2698f678-b027-4984-cf69-08da5a71dbce X-MS-TrafficTypeDiagnostic: SJ0PR03MB5421:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BHSWxp5hLoF8OqI9xBXAXYzQevNpji3uhDrxM0cIBpx6cpTGFp3dXSKlHQqfp1FVyWeoaXIDtLanh0s305BOjcMGgjAx9nvP+DRxwfdPX+0kXQ+IkWrOrCnzqGzz53MfMWqNssikfM+mylwXF6ZjkTzoDgYA8gVgi1xriMbCfTyGHA7PXWTjUwZ0yeegaQ6Vj9vN5MhwLK4egh4h32t7WMlwQM7Cu3Tq/y6kksI54xgqJZ045/fVioaIxPvk+4JP3WxZhJzL2FJUuBXchRyPojyDRohKu5U/GeW2yUQnhK/3jkthkJVtXMyyZ8dul+x+P+1V6SfZnJuj0X5D5HXA/d4XckXkiUlsNw8lnPURGsjR/U9FrOFMfrzotJ3BcvI/H4HPrgqsZQfodVFAjI4mKPTshrd5OUEHvxkh3W7MuNJbHqUBsF14Qbub5SISR/hxStOHTQ0NHaWTBf8xz2AbLCDkI5sPYF1N8Nsnz6tI31gqfo80SDq13psbUzUqL8u5qFLofsHNAL/K30D+mynoTZG94VYK1ZkVrHV3KEPGgK3YxJ24nHoadslb0qVhHNsDlt0gxT3F2EwFMlnrMoVve4BTX3rSQxF1iOj+caELxwHIYKt5y5ixvZBAnv/wb5I62Hej/MPuWxLBQxA+AKFdjhyJgyeckOg2alBW7SrA1orQh933yTHeBpd/tvitXZUJd+MSbdGTdbcbAo7n4T8l+s+k7GqQm8wn+HRPOklHvJgzB/t0+beW97mDhfCxFMTAmbQXu3CUi5XxkUHTvCarIg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR03MB5608.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(39860400002)(136003)(366004)(376002)(346002)(396003)(2906002)(86362001)(6666004)(478600001)(6506007)(2616005)(1076003)(5660300002)(8936002)(186003)(6916009)(82960400001)(38100700002)(6512007)(41300700001)(316002)(26005)(66946007)(6486002)(4326008)(36756003)(8676002)(66476007)(54906003)(66556008)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?09QTTKA3cLKkMTb2/kF8/sirjUly?= =?utf-8?q?AWRPVX1XtCZmYjUqljG/aW0ha3U+8PB6FHixGSsMFK1rZqQgvIwpnubvPpjJbSM1H?= =?utf-8?q?rYFvKr0xZg0OWfGgafUcfWNg9Dw+gxF7ssAZRRTK9ItlprnPG2BgAUo+o4jI/l1IS?= =?utf-8?q?6acUnDrNw/yhudRW/G5GQ1VJhqZoNR+wkTCvI9wG4YMcFQGx33eV4/+9lyzP28S6Z?= =?utf-8?q?mMOKgbi8yxJ3TtaZo8Yt4YhnIpBDONPcAIYzPusscyUa1fWI97db6QFB+pa97Copq?= =?utf-8?q?PEA6w+tPu3l5xcdvUGijGxAiBDzsdqyqPXTr928vlSOK7g2lLvIn7lEFd6UJNLPlQ?= =?utf-8?q?erIYnDiU85Jw6DBRW70e//1jyWhE+e5iirfr722KapQtP4Y5CFnMWjwZpfkBigaVn?= =?utf-8?q?vbdekg9JO8ZSdJlE+gPBELqnIBFzEOc0xeMys6nuzSIPm3qr87IvJApLBv5kOP840?= =?utf-8?q?GAvI8tZa5QWIJEhWVkg/i4y/QcWaPxP6aqtsIiWMgrT4N//f8R17aGPhDWXh7Sam/?= =?utf-8?q?k/puFZwCrfZi6/um5MPFrR2wE/JySU8oUkPZCiOCyHxpfJhRglEkijiQTXPeAxwkn?= =?utf-8?q?WX+rXCi/1e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IU/K4nTglevwVCkJjVwOLKfXN4ZGPla4N8CqZL/PLDyrRL?= =?utf-8?q?Hm6CEN6MsKSUDWU0PPXHLxXKUxs/VRIFAA=3D=3D?= X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2698f678-b027-4984-cf69-08da5a71dbce X-MS-Exchange-CrossTenant-AuthSource: DS7PR03MB5608.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2022 08:23:49.3632 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AvpSPhxgA8qTtLtALqQPyq67qLP6ANBQN6S+gGXUP1T1a6/JVgektJWoREviMYYf4uNuzZSzGUkzN6aKy4HJ/A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5421 Take the opportunity to convert the variable to read-only after init. No functional change intended. Signed-off-by: Roger Pau Monné Reviewed-by: Jan Beulich --- Changes since v1: - Fix help message about rounded boundary, do not round up the default value (will be done at runtime). - Use kiB instead of KB. --- xen/drivers/char/Kconfig | 10 ++++++++++ xen/drivers/char/serial.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/xen/drivers/char/Kconfig b/xen/drivers/char/Kconfig index e5f7b1d8eb..dec58bc993 100644 --- a/xen/drivers/char/Kconfig +++ b/xen/drivers/char/Kconfig @@ -74,3 +74,13 @@ config HAS_EHCI help This selects the USB based EHCI debug port to be used as a UART. If you have an x86 based system with USB, say Y. + +config SERIAL_TX_BUFSIZE + int "Size of the transmit serial buffer" + default 16384 + help + Controls the default size of the transmit buffer (in bytes) used by + the serial driver. Note the value provided will be rounded down to + the nearest power of 2. + + Default value is 16384 (16kiB). diff --git a/xen/drivers/char/serial.c b/xen/drivers/char/serial.c index 5ecba0af33..f6c944bd30 100644 --- a/xen/drivers/char/serial.c +++ b/xen/drivers/char/serial.c @@ -16,7 +16,7 @@ /* Never drop characters, even if the async transmit buffer fills. */ /* #define SERIAL_NEVER_DROP_CHARS 1 */ -unsigned int __read_mostly serial_txbufsz = 16384; +unsigned int __ro_after_init serial_txbufsz = CONFIG_SERIAL_TX_BUFSIZE; size_param("serial_tx_buffer", serial_txbufsz); #define mask_serial_rxbuf_idx(_i) ((_i)&(serial_rxbufsz-1))