Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4063202ybb; Mon, 23 Mar 2020 12:46:05 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu3OvgSNticC05DSM30zywwmk2WDLmKX6gCsjekwfdEDlGRe///Vktfxv0E3/wZbs2FA0HG X-Received: by 2002:aca:3089:: with SMTP id w131mr772776oiw.121.1584992765263; Mon, 23 Mar 2020 12:46:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584992765; cv=none; d=google.com; s=arc-20160816; b=HOuzr1vMAKwPmeMff02+3/tFNaqFWKXEn9t4jNieDEh71Nv1kZwz5Yzt1GrxRM87X2 ECxj27nV3lX5E2WgISNgL+00jfhtR43YOCbPUr+BR2lm4JNJJyyVn0NwTlTRW+N/YS5U tHrPfr/WL5AxgQGXH18EtA/T6EkSqPgo+mIl0dAse68r9PjspAj1yXr6jXI7v+EM4tZU 21keNfiRuuh3DmsfFcM7Uo8Ajau+xP8RIWc3mwWbDC/M2cOypID/r8JMp/lQ5WxGiyBr ouaI7M/9aXAlltwmbAySrziFov4l4VNJ04NRT8rrnhTKIzvjH8nWccjfUhnMmDtz2gZ4 PSuw== 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=80B/TTFy4vFKz8L9+3RjvU1r3boBA5t0X4WLtGJoAss=; b=ioHodJKzTWE2TOKKtqvQxiaEB3HLQnHBz4Qg4OkgA4Aj/nTveQDFj5SpZbcNGzkGYZ SLSnfxiSWqdqmN8Jq6k4RbDKeMKWkNNOo8b5u9yWVDloQiDtM2rTvaJDAclsdeB5nQd2 PtlI7Uf+qIEsvNFxOq56dlixKQW7egdzFWVXV1hHl8Xm9i9xYdKdXNj00Df8RAatviEl Ie5hvaNuFJp9KuDYxlUdufTDenqUSsYzhcYFtQY3bnRuOSJaFsopgRMRzM9V5JqtvCtW eSER/iW+oeFoHAvHB+TmRDtv8wUdN0A24Ol+JFAhTQvWPqnuEdeltvvrJLoLFWq53ahv g3FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LmlNw6qh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 i21si1766091otc.183.2020.03.23.12.45.51; Mon, 23 Mar 2020 12:46:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=LmlNw6qh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1727132AbgCWTpR (ORCPT + 99 others); Mon, 23 Mar 2020 15:45:17 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:39799 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727093AbgCWTpQ (ORCPT ); Mon, 23 Mar 2020 15:45:16 -0400 Received: by mail-pf1-f195.google.com with SMTP id d25so8002770pfn.6 for ; Mon, 23 Mar 2020 12:45:14 -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=80B/TTFy4vFKz8L9+3RjvU1r3boBA5t0X4WLtGJoAss=; b=LmlNw6qhloEXhNPwTTRoJnnY1RRSyI1vukop6LWemBIZ7WiAYP8MMBU/tDoetPZ7Ic DnB+YTC9QVV0DcZQDAHwAIeiGxDBVqSHVfMD45MqIJtHOtVLZ1vD1QURpLlWad+NBdQF l49NVuqzu4uUXjB25TU+fNg80eeNR+Qh0jwHU= 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=80B/TTFy4vFKz8L9+3RjvU1r3boBA5t0X4WLtGJoAss=; b=m3d/IJksLPgYCf1yLMggC49Ogs+O1b7z8AqaLyK9aAASBc3IvFyZUoveuUwy5PZNYL TQt5nXoSMjcqzgZHkssFNa0cfErDleJg2tlRUoApvaD37N9YUh3qfclxi35PqrQiuGni eKN8/bEPRHD94mZ4V8DBA7c9pHOFHo2pp2gJzRfdzak8yMiBRP/99yaJO3MzeIlUBiXT EtEjYMLXNLkOZVVtDzkZ499J7gOOqmc63M8hfM9NfOaZd9e/TWX6qh7Ss8ZZn1wbRoKo xKPA7y1Eomtxo8uECOmZFfdu2ek0f+jYbUAjMKK54EXerBpwwarqLhMMF1GuQbTNt9TH HOEw== X-Gm-Message-State: ANhLgQ1RR/dTBRzM4s3IgfvJmWxKDccpJjvma42BaFJOquIOdzyZUkFP pXk9VfmNPaEhutD4dKb7ud5nhQ== X-Received: by 2002:aa7:84cc:: with SMTP id x12mr7601806pfn.82.1584992714004; Mon, 23 Mar 2020 12:45:14 -0700 (PDT) Received: from apsdesk.mtv.corp.google.com ([2620:15c:202:1:e09a:8d06:a338:aafb]) by smtp.gmail.com with ESMTPSA id s98sm344857pjb.46.2020.03.23.12.45.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2020 12:45:13 -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 v3 0/1] Bluetooth: Prioritize sco traffic on slow interfaces Date: Mon, 23 Mar 2020 12:45:06 -0700 Message-Id: <20200323194507.90944-1-abhishekpandit@chromium.org> X-Mailer: git-send-email 2.25.1.696.g5e7596f4ac-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marcel, 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 and mouse. There were no discernible slowdowns caused by this change. Thanks Abhishek Changes in v3: * Removed hci_sched_sync Changes in v2: * Refactor to check for SCO/eSCO after each ACL/LE packet sent * Enabled SCO priority all the time and removed the sched_limit variable Abhishek Pandit-Subedi (1): Bluetooth: Prioritize SCO traffic net/bluetooth/hci_core.c | 106 +++++++++++++++++++++------------------ 1 file changed, 57 insertions(+), 49 deletions(-) -- 2.25.1.696.g5e7596f4ac-goog