Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp244293rwl; Wed, 29 Mar 2023 00:47:56 -0700 (PDT) X-Google-Smtp-Source: AKy350bhFgp1/vKWMUxyA5vZt0jTGDEi7nppf5ntprR36fJkdNcSLdk1D6v6sNbf1YHoun4YXx0+ X-Received: by 2002:a62:3041:0:b0:627:ee6a:2a40 with SMTP id w62-20020a623041000000b00627ee6a2a40mr17191838pfw.10.1680076076278; Wed, 29 Mar 2023 00:47:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680076076; cv=none; d=google.com; s=arc-20160816; b=Dlv4H5aBapNELtH3iXsvQ0t4SEoyzoCZraitG9QAcfAXctjamjCm85AZBT5ld3UFJ6 rKfg9EhUqaCgp54UuT6Wvvd5aXXTJWyNKKxJ8NFuWFyoEd2ThtiEeKHkUREpYue6OQ9S TCyr6HYduoYEEFiHIs0Wtl4S58zjmsYWU5mrUXaxcsflbPVWGvs9jYcuUpnnQ2aGDp3E ShKZXQAG9flvhYDjksnwTbZbmykAs2KdfUy0uKfecksH4IKOS656YaGe04owwOJvCbv2 aBSwWTDfxS8fyFIAmqrA+GFypzyzxQ/qopox1YjlXHn2U4LGJvwG/3+rjyKYNHU9/cfd 9Dsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=J8mch85k0Qehgo377STToKSqjeALcbIq9uBEryIIF5Q=; b=qY1Wh6aFAzeNGJRF+w0THLyQN8O08NTNsT4x7PXCaKzulfLrJ27seBY65U5PC1iPVq eaQ8mvEsd2jw5xWe3yDnpGGh0Zq/kCdyOCg10N+VHgvKgwtjhH5655PPoNqw+kMpV3dU SLFWr2IFl+ICEOwHADBT2VJZH58jGgBlyBM8nFwBAI/YmsRBH0nu355bojUyNgFDps/C +90zFE+mFOXKGV9zBai6dZGg0XSxirLMY8vVpBMmcBEFvJil8/7llQSBNA2h1+7sS0L1 zihP61idEa7EpvW/0B5R+UpvrJ+7ZbBGjH9LybUVmDAdfec+vmePD3XuArsLPZkHLGtu 1NsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=stBkacp9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x18-20020aa79412000000b006246677ca3dsi11391563pfo.287.2023.03.29.00.47.45; Wed, 29 Mar 2023 00:47:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@kernel.org header.s=k20201202 header.b=stBkacp9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230190AbjC2HgJ (ORCPT + 99 others); Wed, 29 Mar 2023 03:36:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229812AbjC2Hfw (ORCPT ); Wed, 29 Mar 2023 03:35:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 607D446BB; Wed, 29 Mar 2023 00:33:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EFF5B61AE1; Wed, 29 Mar 2023 07:33:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91FC4C433EF; Wed, 29 Mar 2023 07:33:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680075198; bh=9t0eHIsz0o5SNikX6I93qBW5h+kCwz8SzMCmVMOCLls=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=stBkacp9IN/w1iQ3Yzd+ZCk5NdOPY0qg6fQTPfUiyARToJcY4Vg0kOf8SN/aQWi+9 XJhA21H7Is6ncWw62ClA2U1Qwo533fhFgwN6fRVD/FXRvPH2hPQzzQKQOqSqhe3nXD CNfybADiTkE0XneBJGK6cPq4Z0XTLkR2aLRa/25xgMkaQ8zFsWZA/cy8ko05ZuUYzi 9jCQjIklkQL7aXcIsN1G0yFNM32VHwKq0ZdYtYgnhrU6+DpIGSXJmyZILBGlDIKu4j LHn4SVDDDWjRABb5xvscAI0tBxk6+PVlo8CNQWbZtYVJrnTEZb9k9YJt423Cp6/jxK w0U7Ya3w0lxSA== Date: Wed, 29 Mar 2023 10:33:13 +0300 From: Leon Romanovsky To: Veerasenareddy Burru Cc: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Abhijit Ayarekar , Sathesh B Edara , Satananda Burla , "linux-doc@vger.kernel.org" , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Subject: Re: [EXT] Re: [PATCH net-next v4 8/8] octeon_ep: add heartbeat monitor Message-ID: <20230329073313.GG831478@unreal> References: <20230322091958.13103-1-vburru@marvell.com> <20230322091958.13103-9-vburru@marvell.com> <20230323104703.GD36557@unreal> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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-kernel@vger.kernel.org On Thu, Mar 23, 2023 at 06:14:10PM +0000, Veerasenareddy Burru wrote: > > > > -----Original Message----- > > From: Leon Romanovsky > > Sent: Thursday, March 23, 2023 3:47 AM > > To: Veerasenareddy Burru > > Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Abhijit Ayarekar > > ; Sathesh B Edara ; > > Satananda Burla ; linux-doc@vger.kernel.org; David S. > > Miller ; Eric Dumazet ; > > Jakub Kicinski ; Paolo Abeni > > Subject: [EXT] Re: [PATCH net-next v4 8/8] octeon_ep: add heartbeat > > monitor > > > > External Email > > > > ---------------------------------------------------------------------- > > On Wed, Mar 22, 2023 at 02:19:57AM -0700, Veerasenareddy Burru wrote: > > > Monitor periodic heartbeat messages from device firmware. > > > Presence of heartbeat indicates the device is active and running. > > > If the heartbeat is missed for configured interval indicates firmware > > > has crashed and device is unusable; in this case, PF driver stops and > > > uninitialize the device. > > > > > > Signed-off-by: Veerasenareddy Burru > > > Signed-off-by: Abhijit Ayarekar > > > --- > > > v3 -> v4: > > > * 0007-xxx.patch in v3 is 0008-xxx.patch in v4. > > > > > > v2 -> v3: > > > * 0009-xxx.patch in v2 is now 0007-xxx.patch in v3 due to > > > 0007 and 0008.patch from v2 are removed in v3. > > > > > > v1 -> v2: > > > * no change <...> > > > + struct octep_device *oct = container_of(work, struct octep_device, > > > + hb_task.work); > > > + > > > + int miss_cnt; > > > + > > > + atomic_inc(&oct->hb_miss_cnt); > > > + miss_cnt = atomic_read(&oct->hb_miss_cnt); > > > > miss_cnt = atomic_inc_return(&oct->hb_miss_cnt); > > > > Thanks for the feedback. Will fix it. > > > > + if (miss_cnt < oct->conf->max_hb_miss_cnt) { > > > > How is this heartbeat working? You increment on every entry to > > octep_hb_timeout_task(), After max_hb_miss_cnt invocations, you will stop > > your device. > > > > Thanks > > > > Yes, device will be stopped after max_hb_miss_cnt heartbeats are missed. If I read code correctly, device will stop after octep_hb_timeout_task() calls which happens every msecs_to_jiffies(oct->conf->hb_interval * 1000. You don't cancel/resechdule job if timeout doesn't happen. Thanks > > > > + queue_delayed_work(octep_wq, &oct->hb_task, > > > + msecs_to_jiffies(oct->conf->hb_interval * > > 1000));