Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3302960rwd; Mon, 22 May 2023 11:33:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6jJOrYsPjxIYCNIq+zGNWr+wndtI9QZmq8/gOrVpvNfvlogapX6pJYiAbudi+n+JejohZN X-Received: by 2002:a17:902:e889:b0:1a5:2993:8aa6 with SMTP id w9-20020a170902e88900b001a529938aa6mr13579077plg.63.1684780394465; Mon, 22 May 2023 11:33:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684780394; cv=none; d=google.com; s=arc-20160816; b=VMjdVaf8ysPxqFLmsygrgje8bi+BZjAmVQWxbrfkPF8NgjDpg45pA53MB2mNa+e+LR +uFz4bCT03c7uPWPVCuB/4B1k/IMkoZY5s7yGoyp7G4WTNBo8OIAKYYYMgLtEeMqsc/4 Jc/V56KjehqkShxqyxiUX3c+IoTGiYyFryBwpO0C6WGHhf6I0yuKTwibfvmrjw2/BZX+ WP82LWr8wWKQ7h21IXrmk2uHL6v83zALxAnXXUDRb32y9TaC19bZ46NjRz+4KZfhK8Az 1h7gvRsD0BQ1fz/eZVO6fuFLw8goz8SMMjbMGUbEBZWIkNkWpauXdPaGULRMcTmzF/BT ysSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=E3BUnIse4XpIguUjz9qDWD9DlcWFkt2RaMopnw4xGdA=; b=h5Kzq3k/cl3LFDdn/fuFgIHI4ZAZ8gIjmTnB47MOoO/uqAxjp0qgKDor8NfD6BqIS6 UIYJnn0LulyB4XKkbMqqi6qmbr7duRhVzYz0jcr4BKSaCyxerj2629hfaoa591VHHlcz qs3qHPWsWBngxNt8gbUK1XHKkhDgtoK7QpCFG0d6WWuOjaH2XSvOzvdNGW0eSUQdVIJb 2jvUr2i0Rm+itBrED49gmx2jNzHmcUBpeQzqK59SGD342My12XT90h48Gu7foYyQXVvY CWj7o4kShaWt55hdBMadBKQdd57r/2QbUpUmy/IEReUMkyJ8vXxVFMwyOXpatA5nVPkM xkdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=smK+7lnT; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j7-20020a170902758700b001a6527f6adbsi4744644pll.137.2023.05.22.11.32.49; Mon, 22 May 2023 11:33:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=smK+7lnT; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S233598AbjEVS2k (ORCPT + 99 others); Mon, 22 May 2023 14:28:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233298AbjEVS2k (ORCPT ); Mon, 22 May 2023 14:28:40 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 977C012B for ; Mon, 22 May 2023 11:28:37 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4f3b5881734so3249832e87.0 for ; Mon, 22 May 2023 11:28:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684780116; x=1687372116; 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=E3BUnIse4XpIguUjz9qDWD9DlcWFkt2RaMopnw4xGdA=; b=smK+7lnTrURKLQW/yETMbsLStOanLDicDopSRp5iHhZ6dSfAMYFgGiLUN06qIziaEQ lTSQVd0v3bBfTiMj29LZJrlwnnSjWdUv33HzDU/qbC7i0GedW/O5a5pL58D/Vk/U+EZL bG33+olWyn3m7uLh2qZVnxm1QElnsMFMN4uqdBZ+ZswhL2S4N+ULGmCqQXHZkiF7c46J ieDaW16nLVdTG2ubJqHuySHmPWH9hHhFrCC4XR33gB8mhSkx4iyQ9coEA+5ZmWdser6+ sw40z9ENPdJ+1G6tPNGhSGUFD5zq0yNpOzN88ZV2N+FBoSodz7u9ND884DvqlqgzY+Z5 /Ipw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684780116; x=1687372116; 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=E3BUnIse4XpIguUjz9qDWD9DlcWFkt2RaMopnw4xGdA=; b=avxZxaBpI+Tv0g6AckwJBIwkq6hG90++x006TVWb2qNNDH+sKGi56b2sL1kBHPzn5V 3r8oGEJdGi4HdddgloDxrIWvyeSltuaAL4jgzULdpWlE4EnC+W4I4ivHBxclq5M9poR/ LtWwRRU77E5nslXiAmbYa0/ZNsEmH8cBfRFHKgMTcVAg5OTQzMbxJ7qJ9t8f73aUALcT PftkUpM68F3VykBQC0DI6ILM88dd093fsA8EzeXCxDrAEOrrMOjdLse8+2g+5xUtEPbg AqihiVfJvsw0menjABejC2rElrAjHFw0XBQ2twOIuDEZ6eFnsP3NmVpMQMJGwZdlIC/W t2Ww== X-Gm-Message-State: AC+VfDwNVyMUCdmJG+cr4mlsPtsv7jM9Bb52kZ3URBXFunCjPpq514wX diQvcR8V4S7GMPKs8pSKKJjgtyYBG+5/of7bSsyo1Edm X-Received: by 2002:a2e:98d4:0:b0:2af:1c91:d712 with SMTP id s20-20020a2e98d4000000b002af1c91d712mr4353225ljj.39.1684780115357; Mon, 22 May 2023 11:28:35 -0700 (PDT) MIME-Version: 1.0 References: <024df2d86c14fc811701ba27bfa576476bc9c0d6.1684682575.git.pav@iki.fi> In-Reply-To: From: Luiz Augusto von Dentz Date: Mon, 22 May 2023 11:28:23 -0700 Message-ID: Subject: Re: [PATCH BlueZ 5/5] iso-tester: add tests for multiple simultaneous CIG To: Pauli Virtanen Cc: linux-bluetooth@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Pauli, On Sun, May 21, 2023 at 8:32=E2=80=AFAM Pauli Virtanen wrote: > > Add tests connecting two CIS using different CIG_ID, with fixed and > auto-allocated IDs. > > ISO Connect2 CIG 0x01/0x02 Seq - Success > ISO Connect2 CIG auto/auto Seq - Success > > The CIS are connected sequentially so that the first is closed after the > second is connected. In the auto/auto case the kernel shall pick a new > CIG_ID since the first CIG_ID is no longer in a configurable state. Is this somewhat similar to AC 7(i) but using different CIGs? I suspect this is not covered on BAP, although it is a valid audio configuration, perhaps we could use AC 7(i)-alt or something. > --- > > Notes: > The second tests hits a bug in kernel CIG auto-allocation, which alwa= ys > picks CIG_ID 0 even if it is not in a configurable state. > > ISO Connect2 CIG auto/auto Seq - Success - setup complete > ISO Connect2 CIG auto/auto Seq - Success - run > Connecting to 00:AA:01:01:00:00... > Connect 0 in progress > Connecting to 00:AA:01:02:00:01... > Connect 1 in progress > Successfully connected > Step 1 > Connect failed: Device or resource busy (16) > Expect error: Success (0) !=3D Device or resource busy (16) > > tools/iso-tester.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 48 insertions(+) > > diff --git a/tools/iso-tester.c b/tools/iso-tester.c > index 164cb465f..fc2a84215 100644 > --- a/tools/iso-tester.c > +++ b/tools/iso-tester.c > @@ -64,6 +64,11 @@ > QOS_IO(_interval, _latency, _sdu, _phy, _rtn), \ > QOS_IO(_interval, _latency, _sdu, _phy, _rtn)) > > +#define QOS_2(_interval, _latency, _sdu, _phy, _rtn) \ > + QOS_FULL(0x02, BT_ISO_QOS_CIS_UNSET, \ > + QOS_IO(_interval, _latency, _sdu, _phy, _rtn), \ > + QOS_IO(_interval, _latency, _sdu, _phy, _rtn)) > + > #define QOS_1_1(_interval, _latency, _sdu, _phy, _rtn) \ > QOS_FULL(0x01, 0x01, \ > QOS_IO(_interval, _latency, _sdu, _phy, _rtn), \ > @@ -109,6 +114,7 @@ > #define QOS_16_1_1 QOS(7500, 8, 30, 0x02, 2) > #define QOS_16_2_1 QOS(10000, 10, 40, 0x02, 2) > #define QOS_1_16_2_1 QOS_1(10000, 10, 40, 0x02, 2) > +#define QOS_2_16_2_1 QOS_2(10000, 10, 40, 0x02, 2) > #define QOS_1_1_16_2_1 QOS_1_1(10000, 10, 40, 0x02, 2) > #define QOS_24_1_1 QOS(7500, 8, 45, 0x02, 2) > #define QOS_24_2_1 QOS(10000, 10, 60, 0x02, 2) > @@ -546,6 +552,20 @@ static const struct iso_client_data connect_1_16_2_1= =3D { > .expect_err =3D 0 > }; > > +static const struct iso_client_data connect_2_16_2_1 =3D { > + .qos =3D QOS_1_16_2_1, > + .qos_2 =3D QOS_2_16_2_1, > + .expect_err =3D 0, > + .mcis =3D true, > +}; > + > +static const struct iso_client_data connect_2a_16_2_1 =3D { > + .qos =3D QOS_16_2_1, > + .qos_2 =3D QOS_16_2_1, > + .expect_err =3D 0, > + .mcis =3D true, > +}; > + > static const struct iso_client_data connect_1_1_16_2_1 =3D { > .qos =3D QOS_1_1_16_2_1, > .expect_err =3D 0 > @@ -2126,6 +2146,25 @@ static void test_connect2(const void *test_data) > setup_connect_many(data, 2, num, funcs); > } > > +static gboolean iso_connect2_seq_cb(GIOChannel *io, GIOCondition cond, > + gpointer user_dat= a) > +{ > + struct test_data *data =3D tester_get_data(); > + > + data->io_id[0] =3D 0; > + > + setup_connect(data, 1, iso_connect2_cb); > + > + return iso_connect(io, cond, user_data); > +} > + > +static void test_connect2_seq(const void *test_data) > +{ > + struct test_data *data =3D tester_get_data(); > + > + setup_connect(data, 0, iso_connect2_seq_cb); > +} > + > static void test_bcast(const void *test_data) > { > struct test_data *data =3D tester_get_data(); > @@ -2264,6 +2303,15 @@ int main(int argc, char *argv[]) > test_iso("ISO QoS - Invalid", &connect_invalid, setup_powered, > test_connect); > > + test_iso2("ISO Connect2 CIG 0x01/0x02 Seq - Success", &connect_2_= 16_2_1, > + setup_powered, > + test_connect2_seq= ); > + > + test_iso2("ISO Connect2 CIG auto/auto Seq - Success", > + &connect_2a_16_2_= 1, > + setup_powered, > + test_connect2_seq= ); > + > test_iso_rej("ISO Connect - Reject", &connect_reject, setup_power= ed, > test_connect, BT_HCI_ERR_CONN_FAILED_TO_ESTABLISH= ); > > -- > 2.40.1 > --=20 Luiz Augusto von Dentz