From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3234C43218 for ; Fri, 26 Apr 2019 02:37:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B871F206BA for ; Fri, 26 Apr 2019 02:37:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=netronome-com.20150623.gappssmtp.com header.i=@netronome-com.20150623.gappssmtp.com header.b="swQlCevC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729341AbfDZCho (ORCPT ); Thu, 25 Apr 2019 22:37:44 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:38226 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726006AbfDZChn (ORCPT ); Thu, 25 Apr 2019 22:37:43 -0400 Received: by mail-qt1-f196.google.com with SMTP id d13so2527985qth.5 for ; Thu, 25 Apr 2019 19:37:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=Dmt86cvAtAKBxNH5qe3yzo7tNTPBM5j4xs//7OU8lNU=; b=swQlCevC/BDwMOtwX1AFdQBwadRT2sG2XrgFaTVYn9D6dWzId9g/6Fcj7xIkx4x4j0 +vB8SGlksa8DtMmKhE+xOJPt5jC6L+UxNIKnw7LyuFLEMDRBAUh6JHQ9N13EkiGEYLmq 5Kga85CShqXbIGV+YkqHDbd/fM2aNXCutXPaGI1nCX3YKzDvu7EJlPC6c63/mmXCd13q LlhPc4DhtoMgcQM2cJH8kGViTKa5UkGqXeTe3U7Qv6cW/5In2G+QP2dZVp7zLWUT5dA4 HQ/vsbhrPFJuTTOWEjQQPPP6bSW4246cGD9riC+pMr/572dMEUsIX0F0t1iIwVnJkvc7 va9w== 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:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=Dmt86cvAtAKBxNH5qe3yzo7tNTPBM5j4xs//7OU8lNU=; b=dGf/JjU7S5rLu40hiau8NIGdbJlkThl3nL/yzSLILpugIUDu3TbuyivtLM99TL+cBT TdFhekzbSKkVOV1qj0GfA0hzZ3cntFklLIuPCudGMcDWi+fFeVcGFfQ9kexH9t40CrPl 2D96fnWnafPVO5ewh1KUAU7/LO/uENS7Q0gTey6zi9F3k+goa614WagSte2jMObrkqWt 7m9wZVBIHFWB8xFJw7ptDIpfhV72p5Ifdyu1nPuATtJm36ZlsC88GhjYVjbk3ZoUZwqr oxRZ5ofZPB0xQLUwQrj8erTr7XlQJpxrOqmFTarf4OjS+guD1WYY+zcZtZeKIuGLy24o EL8A== X-Gm-Message-State: APjAAAWn/+GBHqFBj9ibf6O0PlD31TwG8qUO6BvDrOzvolDbZLKOWhqY rqq6lrhVeN7vl2vjDvgmb764tw== X-Google-Smtp-Source: APXvYqwbeQZy+YtvbvBua5Qp4ztaknJZbk889BorpNYMjQDiRvIks2hVU1yV7v9t/3PjugTYcyU6Lg== X-Received: by 2002:ac8:2234:: with SMTP id o49mr2911305qto.104.1556246262764; Thu, 25 Apr 2019 19:37:42 -0700 (PDT) Received: from cakuba.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id g17sm192646qki.61.2019.04.25.19.37.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2019 19:37:42 -0700 (PDT) Date: Thu, 25 Apr 2019 19:37:37 -0700 From: Jakub Kicinski To: Saeed Mahameed Cc: Moshe Shemesh , "davem@davemloft.net" , Jiri Pirko , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH net-next] devlink: Execute devlink health recover as a work Message-ID: <20190425193737.131be39f@cakuba.netronome.com> In-Reply-To: References: <1556189823-5368-1-git-send-email-moshe@mellanox.com> <20190425143847.417033ab@cakuba.netronome.com> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, 26 Apr 2019 01:42:34 +0000, Saeed Mahameed wrote: > > > @@ -4813,7 +4831,11 @@ static int > > > devlink_nl_cmd_health_reporter_recover_doit(struct sk_buff *skb, > > > if (!reporter) > > > return -EINVAL; > > > > > > - return devlink_health_reporter_recover(reporter, NULL); > > > + if (!reporter->ops->recover) > > > + return -EOPNOTSUPP; > > > + > > > + queue_work(devlink->reporters_wq, &reporter->recover_work); > > > + return 0; > > > } > > > > So the recover user space request will no longer return the status, > > and > > it will not actually wait for the recover to happen. Leaving user > > pondering - did the recover run and fail, or did it nor get run > > yet... > > > > wait_for_completion_interruptible_timeout is missing from the design ? Perhaps, but I think its better to avoid the async execution of the recover all together. Perhaps its better to refcount the reporters on the call to recover_doit? Or some such.. :)