Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp817826ybn; Wed, 2 Oct 2019 06:42:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqwxUmeimVYerreUzXKmUTdlKjoB3Aw7HSdBdLRhVhQ3dDCM0cEuk7LOB9B1A07yxw1WpJID X-Received: by 2002:a50:f152:: with SMTP id z18mr3745926edl.141.1570023772085; Wed, 02 Oct 2019 06:42:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570023772; cv=none; d=google.com; s=arc-20160816; b=fThfzOkaRU0q6BTmpAyDs/K5GspsEbyWOHVkRqCZieRc4wgbDDmog8rYgSTE9531AZ L7I5PmIwJphy/nlh0YzYNyR3UWq8lvAMtd3CQE4g/UItKERxmy9dVFOyEYygTD8FUd1L n+JyEUvPA34RRC55zKGz6RpH5rSliZxOkekqqJ3o3Z7eput7ush7dKJHmnyzCgeIkOdJ 6E92Wqv2tWM2rqslsBNrTiMRw9/ij3YPdiyamOEM8xw5ccOlQRYVuFXbldhluO1q6roT BkV1JmgfQaqp1bxel2jQ4Rjfga2d+H5B9dU+UB4SUrbewj9pTQ5yULZ9EnzSVBfrlYUF reKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=0FtEYUu/cXLCU2Wx/FRgEyJ+h1UqlVRpNKuJsg7dsZM=; b=Sk4obFrxrXueAYkZHlPIFiXG6KlC1iH2xYKC5EBvUjdO3zlE/A8rb3K9wP8NsOLT82 9x71bTNuPfxWv3bY15NgNLpmkW8DT3Kuwr5otZg6w8ig0ri7TT/A/MnAWmaNMeMOqAFu FMJNTBq/coCjPPWMZhrULkMh4omgxyCEwr8ehegEbDC7B/kkFzK1vaSx1DaUMjWd6N4M oTR3yxv2KDO6OPE6C+g8Gddqj38zVJavzqGkyJDEn8N1akszdwuh7r7pEW+sgispqfGX /LFpp0WraKge7kv4uRsueaN9TYFGZcuu8SkihjRyGC7/vVjbr3U6Vq4StrEwdGw8DsWE 3ijw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@silvair-com.20150623.gappssmtp.com header.s=20150623 header.b=U51mhLQZ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d15si11107597edb.7.2019.10.02.06.42.12; Wed, 02 Oct 2019 06:42:52 -0700 (PDT) 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=@silvair-com.20150623.gappssmtp.com header.s=20150623 header.b=U51mhLQZ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727771AbfJBNb1 (ORCPT + 99 others); Wed, 2 Oct 2019 09:31:27 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:33573 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726948AbfJBNb1 (ORCPT ); Wed, 2 Oct 2019 09:31:27 -0400 Received: by mail-lf1-f68.google.com with SMTP id y127so12771315lfc.0 for ; Wed, 02 Oct 2019 06:31:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silvair-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=0FtEYUu/cXLCU2Wx/FRgEyJ+h1UqlVRpNKuJsg7dsZM=; b=U51mhLQZDXDq/uBscDo7ainXu45o15EqkJxFOo1pcR+XnS2EuGGCJ1O5wgbjFpkqeS 8Cr/hflQZtV5OmTy1ncn3OiqZZBQL4dq52M4cPDICltN0ojM3xXrrQmEqgl7nXVHlK5a ognGSf046RrTibUFGyu00l3s2wR6NMx+h2E6Ca4E83PrzKTNl7lGCaVLeSZcNcWqZ5GU Pirmpq9eG2pICMO+gv9wmSGpG20qIgclfiUAFJbvID3Yvub7yJ1rNhV9tU0s1Y/dmiT9 JQj7XSFqEMsfihnrSi+u/Jw426qZF0sF6ktwYUtfFnudE9otAm3cL+neHoUVxGGm8wHa J6lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=0FtEYUu/cXLCU2Wx/FRgEyJ+h1UqlVRpNKuJsg7dsZM=; b=S5neAEyLyPEZoeQUDdibhLftDscfA7bc5XYnEy2uQ3ysrfTgcxHTm1kTQ5tJZgkSdv pmm783+JtO10wPYIxOcLNwyzMsKYq8dtP4It01QRlOqK8fJEQAGroKhHV5KV2c6ferkI ud51ryG7XLJv9kfNw9dRPDeQog8Xi5JhwwFc8HDl76Gx+89nuKTSKhTQyRPxV/49Fj0U LHte6xMTwlFnlFcbYMmJkRYOBxaBEl3rx4JUq3hq4EKvSqGZCcoX9lhu8bgBzo1+bxv/ gNgo2H3Co0tgf1cW6HA1Vzl/k+ZL2k1lrs4H2GmeDdKIKcJGc3OKBi1/4kqNX+WNb8AS A31w== X-Gm-Message-State: APjAAAX2cKm7s+D3vWUUhCPQGB+52ke1/vEOLSJxpoGLpsEdFUeModwl sexIwApZ1eP5Ixm9U9YzfUo30Q== X-Received: by 2002:ac2:5dd6:: with SMTP id x22mr2338967lfq.71.1570023085295; Wed, 02 Oct 2019 06:31:25 -0700 (PDT) Received: from mlowasrzechonek2133 ([217.153.94.18]) by smtp.gmail.com with ESMTPSA id m17sm6183743lje.0.2019.10.02.06.31.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2019 06:31:24 -0700 (PDT) Date: Wed, 2 Oct 2019 15:31:22 +0200 From: "michal.lowas-rzechonek@silvair.com" To: "Gix, Brian" Cc: "linux-bluetooth@vger.kernel.org" Subject: Re: [PATCH BlueZ v2] mesh: Fix IV Recovery procedure when IV Update is in progress Message-ID: <20191002133122.xha64n3el4klliul@mlowasrzechonek2133> Mail-Followup-To: "Gix, Brian" , "linux-bluetooth@vger.kernel.org" References: <20190909192509.15007-1-michal.lowas-rzechonek@silvair.com> <547a20d9ff42c6b404bfc646812a243cc2469708.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <547a20d9ff42c6b404bfc646812a243cc2469708.camel@intel.com> User-Agent: NeoMutt/20180716 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Brian, On 10/01, Gix, Brian wrote: > The problem, I think, is using the iv_upd_state (which we need to do > IV Index recovery) as a proxy for the actual state of the IVU bit. Agreed. The IV Recovery flag should be tracked separately from IV Update state. FYI: We ended up implementing two separate state machines to process IV Update procedure: one for 'not synced' and one for 'synced' operation. Node starts in 'not synced' machine and moves to 'synced' when it receives its first SNB. The move is one-way, so it's not possible to move from 'synced' back to 'not synced' without resetting the node. Both machines are fairly simple and nearly identical... but moving from 'not synced' to 'synced' is far from trivial. In the end, the whole machinery is rather complex. Reflecting this approach in BlueZ would require quite an invasive patchset, essentially reworking the whole IV Update logic. I'm going to try to document the whole solution and get back to you. regards -- Michał Lowas-Rzechonek Silvair http://silvair.com Jasnogórska 44, 31-358 Krakow, POLAND