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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64A72C61DB3 for ; Fri, 6 Jan 2023 21:23:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235677AbjAFVW7 (ORCPT ); Fri, 6 Jan 2023 16:22:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235567AbjAFVW4 (ORCPT ); Fri, 6 Jan 2023 16:22:56 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F7F455B6 for ; Fri, 6 Jan 2023 13:22:55 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id D5AD6B81E0F for ; Fri, 6 Jan 2023 21:22:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48368C433D2; Fri, 6 Jan 2023 21:22:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673040172; bh=vvTtcLoqLCFtCJpjRCawFmNwJAFr43YQ0R50HfWmIRA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=u5r8psYJCH0DewCrUiA/CZN5ILjSjWER/DaovjFmoD2wiEKoF4X9Va05C+LjS4Fb6 7/mnR2P+H0ONU94htKfWM6U6i72tJhBX57RsCayCWN6LQxqY9rSCKuG9S2d+WVYl02 F0pBukoGKedMJq0QhGoB1I/cr+qD8PUjQkE79dICaJFCl/SvCO/L+hNmEqmQFOWhVG 0EkGYqp9l8a363/cXz1OnL0Df9Ynqfiz4yJaWzOSfuU8rh2seGeSBcJbXeF/mUiPUX Jy6QWoTmGknIK77I18K31YFDloVMvAeqABaspHID+LxvPAjqnMM2TqVX/uTS/3A9dJ HpgB0aJ/3bcCg== Date: Fri, 6 Jan 2023 13:22:51 -0800 From: Jakub Kicinski To: Jiri Pirko Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com, jacob.e.keller@intel.com Subject: Re: [PATCH net-next 7/9] devlink: allow registering parameters after the instance Message-ID: <20230106132251.29565214@kernel.org> In-Reply-To: References: <20230106063402.485336-1-kuba@kernel.org> <20230106063402.485336-8-kuba@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, 6 Jan 2023 13:55:53 +0100 Jiri Pirko wrote: > >@@ -5263,7 +5263,13 @@ static void devlink_param_notify(struct devlink *devlink, > > WARN_ON(cmd != DEVLINK_CMD_PARAM_NEW && cmd != DEVLINK_CMD_PARAM_DEL && > > cmd != DEVLINK_CMD_PORT_PARAM_NEW && > > cmd != DEVLINK_CMD_PORT_PARAM_DEL); > >- ASSERT_DEVLINK_REGISTERED(devlink); > >+ > >+ /* devlink_notify_register() / devlink_notify_unregister() > >+ * will replay the notifications if the params are added/removed > >+ * outside of the lifetime of the instance. > >+ */ > >+ if (!devl_is_registered(devlink)) > >+ return; > > This helper would be nice to use on other places as well. > Like devlink_trap_group_notify(), devlink_trap_notify() and others. I > will take care of that in a follow-up. Alternatively we could reorder back to registering sub-objects after the instance and not have to worry about re-sending notifications :S