Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2415417lqo; Mon, 13 May 2024 19:17:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVMA6MkvIK749PKTLG+mv0G8sNJFEGMXEAZTxPyocIVc/RCSwQ3FObbWxdpiG3/eSeV7Vk5CvDzVwA4uzrJPmWa6cbUcDfj5sWOvUzoIQ== X-Google-Smtp-Source: AGHT+IE9tEFHqIO9uyXy4FMEwaxocImjezpho+tzCRwnqJLz1wT6u/Bq2xuFmf8VmD0Zs3UA3GBy X-Received: by 2002:a2e:878d:0:b0:2d8:5af9:90c5 with SMTP id 38308e7fff4ca-2e520289226mr96830071fa.39.1715653042595; Mon, 13 May 2024 19:17:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715653042; cv=pass; d=google.com; s=arc-20160816; b=aEEcjHzzO4GM4+9QT97CNxyFNFFgukAbseoKLWGJN277fwbOysIXWaaeXkmfPW/BrA V8rGNjMUwvpHJ39pqASPitDge3pFkll5DL07bcHLUVhaOgDwTkKdIdS36gQ23XP0wzsE etjUnSYucK0m5FQ8VpcI+rjuzypCy235QqSrb52P4uJYSY5Ag11q+Qm9XmB5QOWA3ADI RCE4ij0GwtxbHgDbujEcrq4NXoCNTz4i1DjAkQd1ZvUer2h1IJiusm7iS+gdmXAmSKBE GWPx6H3mB9JVOe1NNH6S3fLz8wJKSLa0mqQgt4JZByJ/lmTafsngEscYrCBSBXeOOgyu Ze4w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=aOU3sr0VwyeQ5VPfDspJSP2TH2XsFUIDFfay9rLOt6Q=; fh=m9ypl2h/km/xBKMbPHW1zglz1RBBCSQmvNffzwKAIp0=; b=BoWn5wRFA7dqkmN0Bdkk+mZwJ6qtecgAvmcz9y2DIi8IgwDGShJPDpnGVO9krzTWtw 7dt5lVhemOoBnUTc9PoF5kyntA1u49HP9oQZwbVOrupsCWv5ML/N8ChhUT9i7om6J8pr 9FICmCAQs0xDNbn7KRqLYaGthmqdyEnF+2XgZ0NRn5oM7AndXLg4Eq2jrazfoM1Mjufr kQEZcMPsPfho19hm8dzWPUyEC2wxnlPoSksoQWkcAoKcX6c4Vx7jsMqvRHNGw1iR+yil Uvkw2jlJj7I4IfDyeRYqKBN20eiGY4PrNCy3qDY+SfEIljJ+ZAikRJkBO0669IhvZ5X9 u0Rw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HUs+DTMe; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-bluetooth+bounces-4585-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4585-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a179461b4si558076666b.123.2024.05.13.19.17.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 19:17:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-4585-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HUs+DTMe; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-bluetooth+bounces-4585-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4585-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 2A6C31F219B4 for ; Tue, 14 May 2024 02:17:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E44ACAD55; Tue, 14 May 2024 02:17:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HUs+DTMe" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 949191C36; Tue, 14 May 2024 02:17:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715653037; cv=none; b=sS2R3gOx9gIuNDAO5w+TKmwk8rMM9r553ES41ykAWBUKJ/Cd/82sa/NyOaxrO7QzWqWicYDy59NkxAoVJ5hNCDYE+TKvsnV0y+GdgJPD2VE+bw5J+FUAEf68odGbUvIrKK/alu5bvVJAbtLpqkDY9Ww+kH9dz90yaZuBE/26194= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715653037; c=relaxed/simple; bh=8lCoZs3r2WSbncL4Yblb+n5qHniaUx60epd3ZlZAIFU=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Dz/xZkoeRLVFA57uATwkynnhxB1tA/m95OzXU77FtfTIM7+Ua7GK4+qlDVuJd43SCkrUMlTFSz6EAGF7tO8Y9FKyKdHET0JfpOKu4cMjLpm1ID2PdfWhqxg0DplkeRWrklxASFU19/j3s09hUQuTOvvDW2jSzT+POEQYCnYyZ30= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=HUs+DTMe; arc=none smtp.client-ip=209.85.208.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f172.google.com with SMTP id 38308e7fff4ca-2e1fa1f1d9bso89326281fa.0; Mon, 13 May 2024 19:17:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715653034; x=1716257834; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=aOU3sr0VwyeQ5VPfDspJSP2TH2XsFUIDFfay9rLOt6Q=; b=HUs+DTMeF3cQ1hVzbe8c1A8nzA+OK9GCj8ruWZ3GIxpS9bQqm0ZTWUMwmeMXUCqIB3 rXwoyaXkXjrArGHi9Cg69GCKMbA+4e3Kn5UUU3Gu2h4oQ+OOKw0dbE94KXJeYv9DdqAj gwcZZHnZDChJBxsBmB1VRMwFVm5XVbXFvrEpIvNv3DeLo4XKe49xoMwQZJlGP5pU+7+r ItQAfWl+7hddTv+tLwKuhFCk95QJRBgyISQQE2n8WJZxjp7SlAQadSqMZlI0+MJswbhp QbwH3YW9Wd+TkbUoAlZDGA+rqp9M1wT3uf58N+2jJUvwYhmXHf30XizPboJDTSUyMbz6 ciFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715653034; x=1716257834; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aOU3sr0VwyeQ5VPfDspJSP2TH2XsFUIDFfay9rLOt6Q=; b=u9uZS4USgpPxjHD0C2qHXuZrv642luUWMHL2Mp49vQGB+uhPJf9zzrZH+nTvkj0jzc mPlkYJrYpUqe9KYeVmOt9BnQx0YLpdirEdVbvcdITG6jfp4zdxFn709cYHsIwyKbtpgr q9WbiRN3QJNN5tZcw7pZRQxutRVgDu9pj3ZAgYe18Fw5RYdRFDqhM2MJPq5pwynhUM/P MlVXuLHCS3msqA18fIjpjmyoSOe0uFeVQ4Le6PMYKjfm74tBx/YTXVvuM01FtrBhpaWB t2BGJoYEYljqTSYrVRBKTnvlG4dngJhTlZTP70GZ03Ozv2P9tffsLf4BGm2Ovk4OTr0e zjcQ== X-Forwarded-Encrypted: i=1; AJvYcCVLz0XWmkzjpjkDnGKUudhcz3kDPI0iAqvZmzY7XTBSdZukcutbwzKTj0PC5UTlcEEkzANXQxn2sCD7H7kDStGS9EnoG1M+w89tH0Qj5fgIQxBFnOme09C2kL5zWbPF5Kx8SntHksDk X-Gm-Message-State: AOJu0YyJV0hwM5CJWLDsalGUIIXCpBy111PApXK9Vo+feXyR4UL5s2P6 MMPQqwESxj07DuhyTF8Pr+RJJiDAg1plATfP85r1d0N2cUnKK5UXJvXsivRk5CxQXHoWuxZHg9p /NGNcBJ8UeD+BflNbjqhDrqkxM+Y= X-Received: by 2002:a2e:4a02:0:b0:2e6:be3c:9d4d with SMTP id 38308e7fff4ca-2e6be3ce5demr17037401fa.12.1715653033495; Mon, 13 May 2024 19:17:13 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240510211431.1728667-1-luiz.dentz@gmail.com> <20240513142641.0d721b18@kernel.org> <20240513154332.16e4e259@kernel.org> <6642bf28469d6_203b4c294bc@willemb.c.googlers.com.notmuch> <6642c7f3427b5_20539c2949a@willemb.c.googlers.com.notmuch> In-Reply-To: <6642c7f3427b5_20539c2949a@willemb.c.googlers.com.notmuch> From: Luiz Augusto von Dentz Date: Mon, 13 May 2024 22:17:00 -0400 Message-ID: Subject: Re: pull request: bluetooth-next 2024-05-10 To: Willem de Bruijn Cc: Jakub Kicinski , davem@davemloft.net, linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, Pauli Virtanen Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Willem, On Mon, May 13, 2024 at 10:09=E2=80=AFPM Willem de Bruijn wrote: > > Luiz Augusto von Dentz wrote: > > Hi Willem, > > > > On Mon, May 13, 2024 at 9:32=E2=80=AFPM Willem de Bruijn > > wrote: > > > > > > Jakub Kicinski wrote: > > > > On Mon, 13 May 2024 18:09:31 -0400 Luiz Augusto von Dentz wrote: > > > > > > There is one more warning in the Intel driver: > > > > > > > > > > > > drivers/bluetooth/btintel_pcie.c:673:33: warning: symbol 'cause= s_list' > > > > > > was not declared. Should it be static? > > > > > > > > > > We have a fix for that but I was hoping to have it in before the = merge > > > > > window and then have the fix merged later. > > > > > > > > > > > It'd also be great to get an ACK from someone familiar with the= socket > > > > > > time stamping (Willem?) I'm not sure there's sufficient detail = in the > > > > > > commit message to explain the choices to: > > > > > > - change the definition of SCHED / SEND to mean queued / compl= eted, > > > > > > while for Ethernet they mean queued to qdisc, queued to HW. > > > > > > > > > > hmm I thought this was hardware specific, it obviously won't work > > > > > exactly as Ethernet since it is a completely different protocol s= tack, > > > > > or are you suggesting we need other definitions for things like T= X > > > > > completed? > > > > > > > > I don't know anything about queuing in BT, in terms of timestamping > > > > the SEND - SCHED difference is supposed to indicate the level of > > > > host delay or host congestion. If the queuing in BT happens mostly = in > > > > the device HW queue then it may make sense to generate SCHED when > > > > handing over to the driver. OTOH if the devices can coalesce or del= ay > > > > completions the completion timeout may be less accurate than stampi= ng > > > > before submitting to HW... I'm looking for the analysis that the ch= oices > > > > were well thought thru. > > > > > > SCM_TSTAMP_SND is taken before an skb is passed to the device. > > > This matches request SOF_TIMESTAMPING_TX_SOFTWARE. > > > > > > A timestamp returned on transmit completion is requested as > > > SOF_TIMESTAMPING_TX_HARDWARE. We do not have a type for a software > > > timestamp taken at tx completion cleaning. If anything, I would think > > > it would be a passes as a hardware timestamp. > > > > In that case I think we probably misinterpret it, at least I though > > that TX_HARDWARE would really be a hardware generated timestamp using > > it own clock > > It normally is. It is just read from the tx descriptor on completion. > > We really don't have a good model for a software timestamp taken at > completion processing. > > It may be worthwhile more broadly, especially for devices that do not > support true hardware timestamps. > > Perhaps we should add an SCM_TSTAMP_TXCOMPLETION for this case. And a > new SOF_TIMESTAMPING option to go with it. Similar to what we did for > SCM_STAMP_SCHED. > > > if you are saying that TX_HARDWARE is just marking the > > TX completion of the packet at the host then we can definitely align > > with the current exception, that said we do have a command to actually > > read out the actual timestamp from the BT controller, that is usually > > more precise since some of the connection do require usec precision > > which is something that can get skew by the processing of HCI events > > themselves, well I guess we use that if the controller supports it and > > if it doesn't then we do based on the host timestamp when processing > > the HCI event indicating the completion of the transmission. > > > > > Returning SCHED when queuing to a device and SND later on receiving > > > completions seems like not following SO_TIMESTAMPING convention to me= . > > > But I don't fully know the HCI model. > > > > > > As for the "experimental" BT_POLL_ERRQUEUE. This is an addition to th= e > > > ABI, right? So immutable. Is it fair to call that experimental? > > > > I guess you are referring to the fact that sockopt ID reserved to > > BT_POLL_ERRQUEUE cannot be reused anymore even if we drop its usage in > > the future, yes that is correct, but we can actually return > > ENOPROTOOPT as it current does: > > > > if (!bt_poll_errqueue_enabled()) > > return -ENOPROTOOPT > > I see. Once applications rely on a feature, it can be hard to actually > deprecate. But in this case it may be possible. > > > Anyway I would be really happy to drop it so we don't have to worry > > about it later. > > > > > It might be safer to only suppress the sk_error_report in > > > sock_queue_err_skb. Or at least in bt_sock_poll to check the type of > > > all outstanding errors and only suppress if all are timestamps. > > > > Or perhaps we could actually do that via poll/epoll directly? Not that > > it would make it much simpler since the library tends to wrap the > > usage of poll/epoll but POLLERR meaning both errors or errqueue events > > is sort of the problem we are trying to figure out how to process them > > separately. > > The process would still be awoken, of course. If bluetoothd can just > be modified to ignore the reports, that would indeed be easiest from > a kernel PoV. @Pauli Virtanen tried that but apparently it would keep waking up the process until the errqueue is fully read, maybe we are missing something, or glib is not really doing a good job wrt to poll/epoll handling. --=20 Luiz Augusto von Dentz