Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1887743pxb; Fri, 25 Mar 2022 07:24:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyDiWajMxfhYjravLFeS9ave4TOctOIxfhlzxEdPmPt8h41bFbQiONJmWzzj4n/ugPP/8m X-Received: by 2002:a17:90b:3849:b0:1c7:1ffb:5347 with SMTP id nl9-20020a17090b384900b001c71ffb5347mr12891687pjb.52.1648218274135; Fri, 25 Mar 2022 07:24:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648218274; cv=none; d=google.com; s=arc-20160816; b=SPe+iEubQQ4NBs9zhNbyqtECLzbq8bs9xF4UE3F5LPfTDG0HvxV1oznqcnw3hoNktA mE27IdMOpxPRL+x192U5Vu1+cUYYAxfL6NsDWl0L+eFUoOizkZ5+RAqu1GeXO1nu72OP hHNz6LWhM8sNYHXWm0thQwQvj3kdWXC1JX84YzphYMDdOf3DsRB2JkclfI/Kiy9JcrHY YwdPjHAA/UpounAnyhfm7Jxt6dkbSizxXaiW38wRYaT3QCA/zHimTZf3IBIETwRgNYgO bFXEty06gtolLl8dGJgE8lhaeaMx4x8OagsRUwAOhDft0qdM5LIwnNp7AO4ARH4FK000 UhYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:to:from:subject:message-id :dkim-signature; bh=+t9TtPNODMLFR1Zb3Enjo1evHmtSbfolTfN3QB79Ybo=; b=IvCJ1olv2Yax3/9kbDLYkDrX/buY5/NXVmTPQ1bu1IotqI63DrXTPAzgiANezUfp1O 5Chl0vGjM7EujM4lSWt3AB5luEXVGM/Lsi+7UmPbCAXAn8h2DqEHlTW4dbw55logCUpk vqHYWT7wuIsj6ksD4qWtpVme8tSThyFVbv0x5WpkAZL8mo6Fo7khhjojairEbDQPw48Z vppwNDd5VPp+pQEo34FrqMY06hUo8ceIqvz4uImJPcyIXNAt/Of3cZrNOsZtjbuNEAMF 3K9GDZDLxxsC9kn1LwUWqK83RUSfEdtk2wEax0iBhESj19F5Lvjt0o0tfM3U+zn1XJF3 NCmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=h0sY61F7; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-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 r17-20020a170902c7d100b00153b2d16647si2170027pla.591.2022.03.25.07.24.09; Fri, 25 Mar 2022 07:24:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=20210112 header.b=h0sY61F7; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-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 S1344380AbiCWTrO (ORCPT + 70 others); Wed, 23 Mar 2022 15:47:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241263AbiCWTrO (ORCPT ); Wed, 23 Mar 2022 15:47:14 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F31058BE1C for ; Wed, 23 Mar 2022 12:45:43 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id k6so2540081plg.12 for ; Wed, 23 Mar 2022 12:45:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=+t9TtPNODMLFR1Zb3Enjo1evHmtSbfolTfN3QB79Ybo=; b=h0sY61F7Dj2BB2ci7tb0nho4jLTCvR5GMAXiydTwt2G94d3qw/ozhkMHJpfn+JH9hG zlZout4wh+A/9nX5LCIaq9D85vzqA4tzIZWyG9Ngid0qcKt94cgt1qJ5U4pcsmINNNAt +T0kHuiCWZkpoU1YiTxab6YxEOQqevDRaRljaWw5GnNaojFD6Z/KGE39s+jXcuwgNOeT vzKIEjyxjW9yhM3hRuWUrhg1OpodvDaqrCYlkXfFPWlcEd4b6GsnteNlHwAhmtfR1P44 EuI1JPy5hFubHRyGf+JlbSKMOKP/I9Vlp9lxqK2Xiymap4zao25QF2J3OJKiacUhsOwM MgMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=+t9TtPNODMLFR1Zb3Enjo1evHmtSbfolTfN3QB79Ybo=; b=6WoCadcnQPSzCnXOxfij4PbIUdG3nlpSLucotunvaeqBDIulJ3zIc5V3S5rxKVQPbK Gt14J3EYE4P62MNTCmtt+acpPNcjyiEJ5henjzBD+Nmzu95CuLJXl6tEChNnza+GQjS4 Zs4Y90dcGspWq9jDL4L86NWfL2iwqtmyapNEOllYUOudR9ROUSOvh3b5oQcCiuEEv7M0 wV3a4AE63bo63eEvACj3Lyq5M+AwvoXkT27hvxN9yBXRVAs9oEtAmHU80CEqmQrADi5/ LlcYP8lzpRlowYawUvwcNnOy4D8cxdCov+K6+vOPL3hR15YQW0cdD0s1XWEMan4mD6po 5WtQ== X-Gm-Message-State: AOAM532ozP+bGbuDYgTD62s2CmsFkuhcS5xNo/XMFe52GRdVHLKnlrPF FyGy8CV0wgjUpbvEapHJSzTFthU3Tpc= X-Received: by 2002:a17:90b:4d8c:b0:1c7:61ce:b706 with SMTP id oj12-20020a17090b4d8c00b001c761ceb706mr1458037pjb.211.1648064743254; Wed, 23 Mar 2022 12:45:43 -0700 (PDT) Received: from [192.168.254.55] ([50.45.187.22]) by smtp.gmail.com with ESMTPSA id o17-20020a639a11000000b0038160e4a2f7sm559631pge.48.2022.03.23.12.45.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Mar 2022 12:45:42 -0700 (PDT) Message-ID: <545f0fb3be911c4bed6a0dc81b0679a9824fe6c9.camel@gmail.com> Subject: Re: poor beacon/scan reliability with mac80211_hwsim From: James Prestwood To: Johannes Berg , "linux-wireless@vger.kernel.org" Date: Wed, 23 Mar 2022 12:45:42 -0700 In-Reply-To: References: <928be46d97a3da3fd677c9d87f9be6a02f4d3277.camel@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.4 (3.40.4-3.fc34) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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-wireless@vger.kernel.org Hi Johannes, On Wed, 2022-03-23 at 19:50 +0100, Johannes Berg wrote: > Hi James, > > > We use mac80211_hwsim and our own 'hwsim' daemon to test conditions > > like poor signal strength or dropped frames. For quite a while > > we've > > noticed very poor reliability related to scanning when > > HWSIM_CMD_REGISTER is used to process frames. Scan results are just > > empty. > > > > We've put in some work arounds like only registering for tests that > > absolutely need it and repeatedly scanning until the expected > > network > > is found, but there are cases where this is not possible. > > > > I'm hoping for some ideas on how to actually fix this problem > > rather > > than continue trying to come up with workarounds. I have tried > > removing > > any frame processing (just an empty function) and noticed the > > problem > > still occurs, basically just calling HWSIM_CMD_REGISTER causes > > these > > problems. > > > > I will admit this seems to happen more on slower systems, like > > inside a > > virtual machine environment, or in tests which create more than > > just a > > few radios (like ~5-6+) so it does seem like > > mac80211_hwsim/wmediumd > > processing the frame is just taking too long for beacons. > > > > That sounds like it's just scheduling? HWSIM_CMD_REGISTER makes all > the > frames go through the wmediumd (or whatever other tool you use), > including the beacons - which makes sense, but there's scheduling > overhead. Also probe requests/probe responses will go through, and we > only wait for a limited time on each channel for a response/beacon. > > Though I'm surprised the overhead and all is enough to make the jump > out > to userspace and back take 30+ milliseconds (which is the smallest > possible dwell time if you have hwsim hw-scan enabled, otherwise it's > slightly larger). Yeah I'm surprised as well. I haven't _proven_ this is the case but its really all I can think of for why scan results are missing. I don't think hw-scan is being used, we don't set ATTR_USE_SCANCTX or ATTR_CHANNELS so I guess this is the best case scenario for dwell time, hmm. > > Maybe, since beacons are sent periodically, and perhaps we can assume > the overhead is always similar, then you could do passive scanning? > > No good answers to this, I guess ... > > Though if you can run tests under UML/time-travel that would get rid > of > this problem ;-) Yeah this has been in the back of my mind for a while since it could also speed stuff not having to wait for timeouts. But with respect to this issue how could UML fix it? Pause time to allow the scheduler to catch up? > > johannes