Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp791656ybh; Thu, 12 Mar 2020 11:11:50 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtlE01qnRsYZPkhSQgwQtX4Xgbimg3MKQgcWx72RM6vqaqTn2jo0A7vr5ZUZDuX5xyTDyNp X-Received: by 2002:a9d:560b:: with SMTP id e11mr7000214oti.226.1584036710485; Thu, 12 Mar 2020 11:11:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584036710; cv=none; d=google.com; s=arc-20160816; b=bJVkTYUlZb3UDRrBoi9IW8ojHoRW8aTA2KqrTIPjlylHdHzFXH+oH8SU1zyLzeqj/H I/jMYBNxrMRywuv5321lItrJNSsnfnutR4Ggd4t2UsfYzI8t873a/r5wEVyWlyD8BMy2 A3xufN1WaPeU2oNI70yNcYTvySojClonm46EykYC5iDdmwyo+nhtx6LPwSRjyfuFNdio IDp1N07og6348bgDdhT/+NJ5vyG9pW0FLvQ7//RwKKUn9zDirBlcEjGlnOpbi8H70/Rt G58vfyK9YARDrZspfJXSYnIH+ENgBeP6oxi8+5a8Ez1E4jc87YiYFIzY/ZI4lJAWwntK tmOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=1r2hqBwaO/kXT5sadF+nxqNCtN3Dus3oicu3doTosoE=; b=jgarvbz+HnUOd+O6HWFNVWvz1ijLJIb/jSGRckQ1MAU8xFA0ERih2YJ628XceH5GHT usX7gMgNseRijl0mzEA+WxMTRYRY+pVPPB6LfTSMlJl3YnZwaBcs4GP6eNTXgBSonzIA hofY4tSoZAfGnZvEE3n/5DUxxhxGP7ASHcjTTcdtyOLoEv/wEts9T+QXkqCF9Dt9F57p h2MeOcQBM1hTnx4KyY3H1xBnhdjFwPUbXQ1+KH3rTIFwzaVOB9Q1nTTB3njA3OyXydvQ E09akr99kbxacE4O9t6UW2Ld+2k0jHaFYXsaJqfgbMkY7NIL5GnyouBwuOGXOciq2slC f9sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=j9EWbDux; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 5si3071481otm.88.2020.03.12.11.11.08; Thu, 12 Mar 2020 11:11:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=j9EWbDux; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726526AbgCLSLD (ORCPT + 99 others); Thu, 12 Mar 2020 14:11:03 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:46192 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726436AbgCLSLC (ORCPT ); Thu, 12 Mar 2020 14:11:02 -0400 Received: by mail-pf1-f195.google.com with SMTP id c19so3636365pfo.13 for ; Thu, 12 Mar 2020 11:11:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1r2hqBwaO/kXT5sadF+nxqNCtN3Dus3oicu3doTosoE=; b=j9EWbDuxdtPVrVMGo4g9ExD52Du4/T/igLgDcH42KRTjU6y75HsFQkhrQ/bwHZ3/O6 7mkGbWdalaG0JS7k3bYNBIm66Z8Iml9+4mPN8AmEuunwcmVpaSYTdHXLemTTceKsBsU+ plUohAf86OM+LkovQFpdDLktjvutMG0n3IurE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1r2hqBwaO/kXT5sadF+nxqNCtN3Dus3oicu3doTosoE=; b=E7rhBvGaTmN0Tu/ZlDknBQ1Ylk22DtOG8efK7eZtw6kjrhw8S53/+FuDRQFCoNPhu2 iJkocDY81Q0LzWSAPNQAg0i45jh5UTGcTWikNuFKaHyVaDRTR1JUspvceLDlEgf+oD3h 4gOOAdti5jbnwsnLdeW4eINNg93lrc2/lf4BuuXABD7uq9AmVYm0nugxyX4HRWw7faGz IQFH8NqUO+tvnvTxwX7CNZ7yCf3z2d7ELbYv0kh9vvRx+RPQFJngz0t3Ri6gSwrjs6bN JLocefCymo10T8L9fAQvHPAl0DOSzxqyfICwPm69m+199x6lts4/N1b7N60A+64fQEbK zfMQ== X-Gm-Message-State: ANhLgQ3/N806v085AUh56ySYpyXw3zjjJ76B8tHyZjhWkKoTOzUuigwb /ad+XO2u1cLXAYqJIFQdn+Dz1g== X-Received: by 2002:a62:144c:: with SMTP id 73mr7218549pfu.265.1584036661706; Thu, 12 Mar 2020 11:11:01 -0700 (PDT) Received: from apsdesk.mtv.corp.google.com ([2620:15c:202:1:e09a:8d06:a338:aafb]) by smtp.gmail.com with ESMTPSA id b18sm56787876pfd.63.2020.03.12.11.11.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2020 11:11:01 -0700 (PDT) From: Abhishek Pandit-Subedi To: marcel@holtmann.org, linux-bluetooth@vger.kernel.org Cc: chromeos-bluetooth-upstreaming@chromium.org, Abhishek Pandit-Subedi , "David S. Miller" , Johan Hedberg , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jakub Kicinski Subject: [PATCH 0/1] Bluetooth: Prioritize sco traffic on slow interfaces Date: Thu, 12 Mar 2020 11:10:54 -0700 Message-Id: <20200312181055.94038-1-abhishekpandit@chromium.org> X-Mailer: git-send-email 2.25.1.481.gfbce0eb801-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi linux-bluetooth, While investigating supporting Voice over HCI/UART, we discovered that it is possible for SCO packet deadlines to be missed in some conditions where large ACL packets are being transferred. For UART, at a baudrate of 3000000, a single 1024 byte packet will take ~3.4ms to transfer. Sending two ACL packets of max size would cause us to miss the timing for SCO (which is 3.75ms) in the worst case. To mitigate this, we change hci_tx_work to prefer scheduling SCO/eSCO over ACL/LE and modify the hci_sched_{acl,le} routines so that they will only send one packet before checking whether a SCO packet is queued. ACL packets should still get sent at a similar rate (depending on number of ACL packets supported by controller) since the loop will continue until there is no more quota left for ACL and LE packets. To test this patch, I played some music over SCO (open youtube and a video conference page at the same time) while using an LE keyboard. There were no discernible slowdowns caused by this change. Thanks Abhishek Abhishek Pandit-Subedi (1): Bluetooth: Prioritize SCO traffic on slow interfaces include/net/bluetooth/hci_core.h | 1 + net/bluetooth/hci_core.c | 91 +++++++++++++++++++++++++------- 2 files changed, 73 insertions(+), 19 deletions(-) -- 2.25.1.481.gfbce0eb801-goog