Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4887425ybf; Wed, 4 Mar 2020 12:44:30 -0800 (PST) X-Google-Smtp-Source: ADFU+vvxdyZGqZd+DrAMUIl2TFz9PVMPTWhescc2R1L6z9/ytMXwS3H/QQaE1G5DBOLwe8Tm6TDg X-Received: by 2002:aca:fdc6:: with SMTP id b189mr3003522oii.10.1583354670562; Wed, 04 Mar 2020 12:44:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583354670; cv=none; d=google.com; s=arc-20160816; b=b1fzDdikVN0DSXI9/e8IMck8pBlhvQ/UxpYodfg/qRWUiEo8f8b6uVJ5RpBDxnnKwf qXwI/vzpKXyi5Pc9NWgapxAXQyQAHDZNq/DkRb2wcw35eMtYeX1kIK4hb9tM4+emYH9K IosP2D8XWJoVPVE9KW8rDkFC9osKFoEwr9gOww/Eq6u7s8+ig9SHTfaEwH2LVAieG+hP FH7yjw+seuTmvqUz8AMgNb8ubqgqNfSDvcdm0HEap+4R1VvQNE3RfiwqRLI8HIyUADva XOcCD4lRRWKzc/2KXUWIpXVvHmT9kjQXsjHS7LCQ7FGw2ujU8uGX0vFETyxvNaMY8qnx VLjg== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=0OZQImmCMy5wMxnPq36M6NHrUziOzGvZ6Fk3jvk2RHg=; b=jVroHW6fCDWzKeoDTBuroID6NYESOW9Xn9YOfq4NmwRx1nnxbANPMPkDTwdYBSeGIn Ec1kE9SvJ5MpvIbJwMqzgDZjI98RWOcF+FpWfTWWpLJlXYDXcBIVPAdyCZFMSw4qMlhc cwsabiz1dFihi3HbaPH6bo8o2DWYeLbzY6Yz8VIGhhbJQZ7nSe2vAXGY68kZ3khay5Yg m4QA3DXyiw/fNYa8g1GU5l4qF7aFvLMut0QXOtTqCP0HEqqcTXkYaKl+BaAfqWTDR0jw rjOtmvG9i4tZKL/e8TZBoc6vx16tgHnvRBvLnYFrJnI6g12/uujLZNEOtP5LmAY8+v2T GGLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lC96RYk9; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u201si2039036oif.120.2020.03.04.12.44.08; Wed, 04 Mar 2020 12:44:30 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=lC96RYk9; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728609AbgCDUoD (ORCPT + 99 others); Wed, 4 Mar 2020 15:44:03 -0500 Received: from mail-oi1-f173.google.com ([209.85.167.173]:33908 "EHLO mail-oi1-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728539AbgCDUoC (ORCPT ); Wed, 4 Mar 2020 15:44:02 -0500 Received: by mail-oi1-f173.google.com with SMTP id g6so3564738oiy.1 for ; Wed, 04 Mar 2020 12:44:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=0OZQImmCMy5wMxnPq36M6NHrUziOzGvZ6Fk3jvk2RHg=; b=lC96RYk91X2RaFEc6ZHqDvBdaP5GXbY1sIrZjJOex3LRJQsoKqNpjl0lsoKoG9CNNC pCFSVO02jjdI7b01mUiWFXxBWTjSNhzXKYDmTqScFZZnEROkC/2NqXBcDqU265VbOq1n pzu/DPbOp3B3UemFX485n1q6ZNb9MOW9UO9D+5ajDAQUOTrORimd+qGJTm1IU/Ogh2n/ 7NlwR8XR3mZ/aJQjaTUJlx6/Q58ukH8+6d0qtjLsjjpwaa5XCrTJFGsBzON9XYjR4+uS /PfWppuSXqC6W1VGbONy1tX+ggFDDnVZgdXC7OpyoNa7E5PTvVgg/jlhX4HLGv3p4iw7 uHDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=0OZQImmCMy5wMxnPq36M6NHrUziOzGvZ6Fk3jvk2RHg=; b=sf2JVtjxpAnsenOQegbLhPjQUJwwRK/+PIeQ5Ztv+kFlgzmvPoib0Q4V5aVI9XMg9g 9qTEwOb6zpczYQR/8SbqfHjIPIMRImdkOOtmHy5JGsBe7G/lwrCy2Cwoa3K3j16+O3+J u4MXTfqt6+5NXxjGTYpPxvnTjeCn7DBiORXShjGjz4CQUrIsC5Rr/xOeei5QxfYuc2LI DtvBoLJgwrfRAuTK5rx1Cx1uOzl3GHSATxtNZKYn3v6PdB9SSHU9S4q4HzeqKdqxyvFF iLtJtp8+zNbXY4NkBYDyPiDHBjj0rO62VlVTsfpeLM+vu40cpguQodAxTsvG1QsPp9ns hIjw== X-Gm-Message-State: ANhLgQ2Alg1E2jmaDMhq04Y34koFQBJR/ljOhkMLIhUItUYs2I5CwUlr F2xWxYlsrDi2ljf8TMXFedmd/1KCj9DmplldK5fyrIZD X-Received: by 2002:a05:6808:10b:: with SMTP id b11mr3140918oie.110.1583354641984; Wed, 04 Mar 2020 12:44:01 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Luiz Augusto von Dentz Date: Wed, 4 Mar 2020 12:43:50 -0800 Message-ID: Subject: Re: Get negotiated ATT MTU? To: Emil Lenngren Cc: Jamie Mccrae , Bluez mailing list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Emil, On Wed, Mar 4, 2020 at 10:47 AM Emil Lenngren wro= te: > > Hi, > > Den ons 4 mars 2020 kl 18:36 skrev Luiz Augusto von Dentz > : > > > > Hi Emil, > > > > On Wed, Mar 4, 2020 at 7:56 AM Emil Lenngren = wrote: > > > > > > Hi, > > > > > > Den ons 4 mars 2020 kl 11:55 skrev Jamie Mccrae : > > > > > > > > Hi, > > > > > It should be fine also if the remote end sends an Exchange MTU re= quest > > > > > at the beginning of the connection since we can then immediately = send > > > > > a response and assign the MTU property without waiting for the > > > > > Exchange MTU response (that corresponds to our request). > > > > > > > > > > Let me know if you think I've missed some edge case... > > > > > > > > In the core specification 5.2 volume 3 part A, there is a command, = L2CAP_CREDIT_BASED_RECONFIGURE_REQ, which allows for the MTU to be changed = after it has been established. This requires an enhanced ATT service howeve= r, but it means that the initial MTU is subject to change. > > > > > > I just read the L2CAP/ATT/GATT parts in the new spec. Is EATT > > > implemented yet for the dbus-api, and will it affect the API? Anyway, > > > for EATT it's a requirement that the MTU can only increase, never > > > decrease, which shouldn't cause issues for apps. But change my "ATT > > > MTU exchanged" property name proposal to "Initial ATT MTU exchanged" > > > then, if waiting for the ServicesResolved wouldn't be enough, and set > > > it true immediately if EATT is used and after an Exchange MTU > > > procedure for unenhanced ATT. Then update the ATT MTU property when > > > the MTU is increased. > > > > It completely transparent to D-Bus, so if we do expose the MTU it > > should probably be reporting the biggest MTU of all connected channel, > > Is there ever any reason for one application to have more than one ATT > bearer? I thought the idea of EATT was to allow one ATT bearer per > application. EATT is meant to allow multiple outstanding requests, it probably would not escale if we would add an API to have a bearer per application so we just use the extra bearers as a pool. > > while it is possible to reconfigre the MTU with > > L2CAP_CREDIT_BASED_RECONFIGURE_REQ I doubt we would be exposing this > > sort of operation to applications, we have to keep in mind multiple > > application can request a change for their own needs so like Exchange > > MTU bluetoothd will be taking care of setting the MTU, > > I think it's fine that bluetoothd chooses the MTU. I don't see any > reason that the application should choose MTU (assuming bluetoothd > sets a big value). > > > that said with > > EATT incoming and outgoing MTUs don't need to be symmetric like the > > unenhanced bearer. > > While that is true on the L2CAP layer, it's not true on the GATT layer: > > Vol 3 Part G section 5.3.1: > "The ATT_MTU for the Enhanced ATT bearer shall be set to the minimum of t= he > MTU field values of the two devices; these values come from the L2CAP_- > CREDIT_BASED_CONNECTION_REQ and L2CAP_CREDIT_BASED_- > CONNECTION_RSP signaling packets or the latest L2CAP_CREDIT_- > BASED_RECONFIGURE_REQ packets." > > So if the peripheral sets its receive MTU to 48 and the central sets > its receive MTU to 517, then 48 will be used in both directions. This is kind of an artificial limitation that the author decided to impose on the bearer, but if it was adopted like that so be it. --=20 Luiz Augusto von Dentz