[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 1/2] console/serial: set the default transmit buffer size in Kconfig


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Thu, 30 Jun 2022 10:23:29 +0200
  • 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
  • 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-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h1nJANIOw43GRn2uUJN7wZbfABXSrBiBRQtmUp8PY1kseLDK1fu3OKKm9C8qqG6iBfQ7QIl7L76O9f20yt+WeFNg/ipthcCJmkCjfCX/WNrBnXD5h8cEpkaA3zf/WhsgJmVoERF6rsrQ0b2BWawpvC5eYb9iBHw4ruq6x97GW3fgp5fkp9KkteLXe8lpO6L034X1bMdZGa0FhWZFffaw1UFqVBt/YhS18v6Jt1HxaTUH1QwPkM1yJGoFVOks1czlEFOwzs6biLddXzsr/Btmr+uWEcmM6k+xPbEHHCMs2B1U7PYwaU7lT3MJBLwTEomBBM0J5JSTuCKEjrU57WkuJQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Thu, 30 Jun 2022 08:23:58 +0000
  • Ironport-data: A9a23:Zq9CN69Jm8bjULZSfpfNDrUDnX+TJUtcMsCJ2f8bNWPcYEJGY0x3z WQeD2yPa/6MMTGhe9kjYI7g8EhXsZfSyddjTgVorX08E34SpcT7XtnIdU2Y0wF+jyHgoOCLy +1EN7Es+ehtFie0Si+Fa+Sn9T8mvU2xbuKU5NTsY0idfic5DnZ74f5fs7Rh2NQw34PhW1rlV e7a+KUzBnf0g1aYDUpMg06zgEsHUCPa4W5wUvQWPJinjXeG/5UnJMt3yZKZdhMUdrJ8DO+iL 9sv+Znilo/vE7XBPfv++lrzWhVirrc/pmFigFIOM0SpqkAqSiDfTs/XnRfTAKtao2zhojx/9 DlCnaaOdDw2FPPmpLsMcgleCARXGr98wKCSdBBTseTLp6HHW13F5qw0SWQJZ8gf8OsxBnxS/ /sFLjxLdgqEm++93LO8TK9rm9gnK87oeogYvxmMzxmAVapgHc+FHfuMuY8wMDQY36iiGd7EY MUUc3x3ZQnoaBxTIFYHTpk5mY9Eg1GgL2IJ8gjE/8Lb5UDCzRM2yYHfLuCId4S6VOJsmxeb+ n3ZqjGR7hYycYb3JSC+2mKhgKrDkD32XKoWFaak7bh6jVuL3GsRBRYKE1yhrpGRiESzRtZeI Ew84Tc1oO4580nDZtvgWxy1plaUsxhaXMBfe8Uh8x2EwKfQ5wefB0AHQyRHZdhgs9U5LRQ10 neZktWvAiZg2IB5UlqY/7aQ6DatYy4cKDZYYTdeFVdVpd7+vIs0kxTDCM55F7K4hcH0Hje2x C2WqC85hPMYistjO7iHwG0rSgmE/vDhJjPZLC2ONo55xmuVvLKYWrE=
  • Ironport-hdrordr: A9a23:VSU0+KoWYL+cDEUYXyIZqGYaV5uwL9V00zEX/kB9WHVpm5Oj+v xGzc5w6farsl0ssREb9uxo9pPwI080kqQFm7X5XI3SJzUO3VHFEGgM1/qH/9SNIU3DH6tmpN 5dmstFeaLN5CZB/KHHCWCDer5PoeVvsprY/ds2p00dMT2CAJsQijuRZDzrcXGfE2J9dOcE/d enl7x6jgvlXU5SQtWwB3EDUeSGj9rXlKj+aRpDIxI88gGBgR6h9ba/SnGjr18jegIK5Y1n3X nOkgT/6Knmm/anyiXE32uWy5hNgtPuxvZKGcTJoMkILTfHjBquee1aKvS/lQFwhNvqxEchkd HKrRtlF8Nv60nJdmXwmhfp0xmI6kda11bSjXujxVfzq83wQzw3T+Bbg5hCTxff4008+Plhza NixQuixtZqJCKFuB64y8nDVhlsmEbxi2Eli/Qvg3tWVpZbQKNNrLYY4FheHP47bW/HAbgcYa dT5fznlbdrmQvwVQGYgoAv+q3nYp0LJGbIfqBY0fblkAS/nxhCvjklLYIk7zU9HakGOuh5Dt T/Q9pVfY51P78rhNpGdYE8qOuMexjwqEH3QRWvCGWiMp07EFTwjLOyyIkJxYiRCe81Jd0J6d /8bG8=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Take the opportunity to convert the variable to read-only after init.

No functional change intended.

Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
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))
-- 
2.36.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.