Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3820416pxb; Tue, 17 Nov 2020 04:34:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJxyWan7s3zwyhoX5dkflgJcVyzXzAHeYA2x28gpwSi0+MA3z5ERtLblZVG3ng8CoAOlymMo X-Received: by 2002:a17:906:b783:: with SMTP id dt3mr18701230ejb.534.1605616478270; Tue, 17 Nov 2020 04:34:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605616478; cv=none; d=google.com; s=arc-20160816; b=jQ3qvTFdZkpA+xZBU+oa25BUhcS2prPYz6S4Bm3kv3lUr2IT7vjCZPsBSeEgkykOgX HGS/+ZmHK/5+zV7eWt2Vnh1XcnL8S1iViccsituKBT9wwUwA1LdPKZbZ86N5yoejudHl 5LXRZ0lylAW66hJLBHD8iqHi7Yx+9Fvq3mgdyosesWdyyiYcCJnBJZ2hDvUPYBBVJrD4 10wJ8P2v3jIRI0tBosh3T30VbwrdERER/b7w0gEz1MXaI+leTCJowNlc6F7jGdKBrbRm yxSTCk2IgF3Ym8e1zKJrVaOuA7AuClWDRI39zye7cuwPFwqdO1s97o4RGg2o6IIRTRbH UZKw== 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:cc:to:from:subject :message-id; bh=2xZkrBllSo3X8dh7BHPq1kGwnjxtKJVBDUj45shpZc4=; b=S6h98eGBi45m4c3bb1dyiEPRwATMR5tNi59ujWD2v6sE55uFwaR84zbDhV896TDSFQ XgjPqyKU85TewoXGVPKw4Rxgdc6+HogBsh5HQEpX4xLMNEkV6RFpooPf9u7pFinvIqSs IftD/pUadlrWFRcRbZHhoJzY4imnMo0GEo711tTV/TlNky9RvgofwAgfMy6TV9vBcex+ JNOJXJ5zADzuVPZAeezSyJ0ceMb66tEachIJoTSrPdEngzsKoaglS1HwU+NOzSFOX9vi lKtfzC6g9tJwDwh8SnCgjahSFrdYsTrtKcoA9pQZMS7VehvOkDofKB/AoKqbFlWvAbTm DbDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hr12si13608099ejc.562.2020.11.17.04.33.58; Tue, 17 Nov 2020 04:34:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727801AbgKQMcF (ORCPT + 99 others); Tue, 17 Nov 2020 07:32:05 -0500 Received: from atl4mhfb03.myregisteredsite.com ([209.17.115.119]:35840 "EHLO atl4mhfb03.myregisteredsite.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726315AbgKQMcF (ORCPT ); Tue, 17 Nov 2020 07:32:05 -0500 X-Greylist: delayed 376 seconds by postgrey-1.27 at vger.kernel.org; Tue, 17 Nov 2020 07:32:04 EST Received: from jax4mhob03.registeredsite.com (jax4mhob03.myregisteredsite.com [64.69.218.83]) by atl4mhfb03.myregisteredsite.com (8.14.4/8.14.4) with ESMTP id 0AHCPlHN029969 for ; Tue, 17 Nov 2020 07:25:48 -0500 Received: from mailpod.hostingplatform.com ([10.30.71.85]) by jax4mhob03.registeredsite.com (8.14.4/8.14.4) with ESMTP id 0AHCPjYi030304 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 17 Nov 2020 07:25:45 -0500 Received: (qmail 51589 invoked by uid 0); 17 Nov 2020 12:25:45 -0000 X-TCPREMOTEIP: 208.85.15.155 X-Authenticated-UID: sbrown@opensat.com Received: from unknown (HELO 155-15-85-208.altiusbb.net) (sbrown@opensat.com@208.85.15.155) by 0 with ESMTPA; 17 Nov 2020 12:25:45 -0000 Received: from localhost (localhost [127.0.0.1]) by 155-15-85-208.altiusbb.net (Postfix) with ESMTP id B28DF154055F; Tue, 17 Nov 2020 07:25:44 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at ewol.com X-Spam-Flag: NO X-Spam-Score: -2.9 X-Spam-Level: X-Spam-Status: No, score=-2.9 tagged_above=-999 required=6.31 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9] autolearn=ham autolearn_force=no Received: from 155-15-85-208.altiusbb.net ([127.0.0.1]) by localhost (fl-server.ewol.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9S241725A3Nj; Tue, 17 Nov 2020 07:25:38 -0500 (EST) Received: from w7.lan (w7.lan [192.168.1.9]) by 155-15-85-208.altiusbb.net (Postfix) with ESMTP id 738BC1540385; Tue, 17 Nov 2020 07:25:38 -0500 (EST) Message-ID: <5f6e9b95f48fd4c8488bfbbf85ca900db57dbf82.camel@ewol.com> Subject: Re: [PATCH BlueZ v5 10/10] mesh: Refactor heartbeat pub/sub From: Steve Brown To: Inga Stotland , linux-bluetooth@vger.kernel.org Cc: brian.gix@intel.com Date: Tue, 17 Nov 2020 07:25:38 -0500 In-Reply-To: <20200807013834.123263-11-inga.stotland@intel.com> References: <20200807013834.123263-1-inga.stotland@intel.com> <20200807013834.123263-11-inga.stotland@intel.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.1-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Inga, This patch breaks heartbeat subscription set for me. Subscription isn't enabled in net.c:mesh_net_set_heartbeat_sub() unless sub->dst != dst. That is a change from prior to refactoring and seems wrong. Steve On Thu, 2020-08-06 at 18:38 -0700, Inga Stotland wrote: > Move heartbeat publication/subscription timers and housekeeping > to net.c since this is where the trigger events and control messages > are handled. Configuration server (cfgmod-server.c) stays > responsible for parsing the set pub/sub message parameters and > assemblying the pub/sub status messages. > > Also, make sure that the correct message status is reported. > --- >  mesh/cfgmod-server.c | 307 ++++++++++++++--------------------------- > -- >  mesh/net.c           | 273 ++++++++++++++++++++++++++++---------- >  mesh/net.h           |  48 ++++--- >  3 files changed, 328 insertions(+), 300 deletions(-) > > diff --git a/mesh/cfgmod-server.c b/mesh/cfgmod-server.c > index ea0741969..ffeb0afeb 100644 > --- a/mesh/cfgmod-server.c > +++ b/mesh/cfgmod-server.c > ------------- snip ---------------------------- > +               return 0; >   > -       if (hb->sub_dst != dst) { > -               if (IS_GROUP(hb->sub_dst)) > -                       mesh_net_dst_unreg(net, hb->sub_dst); > -               if (IS_GROUP(dst)) > -                       mesh_net_dst_reg(net, dst); > -       } > +       period_log = pkt[4]; >   > -       hb->sub_enabled = !!period_log; > -       hb->sub_src = src; > -       hb->sub_dst = dst; > -       hb->sub_count = 0; > -       hb->sub_period = log_to_uint32(period_log, 1); > -       hb->sub_min_hops = 0x00; > -       hb->sub_max_hops = 0x00; > +       if (period_log > 0x11) > +               return 0; >   > -       gettimeofday(&time_now, NULL); > -       hb->sub_start = time_now.tv_sec; > +       net = node_get_net(node); >   > ------------------ snip ------------------------ > diff --git a/mesh/net.c b/mesh/net.c > index 9b4454fee..633727601 100644 > --- a/mesh/net.c > +++ b/mesh/net.c > ------------------- snip ---------------- > + > +       } else if (sub->dst != dst) { > +               if (IS_GROUP(sub->dst)) > +                       mesh_net_dst_unreg(net, sub->dst); > + > +               if (IS_GROUP(dst)) > +                       mesh_net_dst_reg(net, dst); > + > +               sub->enabled = !!period_log; > +               sub->src = src; > +               sub->dst = dst; > +               sub->count = 0; > +               sub->period = log_to_uint32(period_log); > +               sub->min_hops = 0x00; > +               sub->max_hops = 0x00; > +               gettimeofday(&time_now, NULL); > +               sub->start = time_now.tv_sec; > +       } > + --------------------- snip --------------------