From patchwork Mon Oct 3 10:51:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Pirko X-Patchwork-Id: 12997454 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 04B4DC4332F for ; Mon, 3 Oct 2022 10:52:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229596AbiJCKwM (ORCPT ); Mon, 3 Oct 2022 06:52:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229451AbiJCKwK (ORCPT ); Mon, 3 Oct 2022 06:52:10 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EF4653032 for ; Mon, 3 Oct 2022 03:52:09 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id c93so5169804edf.11 for ; Mon, 03 Oct 2022 03:52:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=tV8RQ8wQKtXZ0tWqNwcRmnxwJvvFr184uepBD40zDNU=; b=vpq6l7OA8SGC8ENlYHQTIIHLUmNwnIDu7io42RoqBrQLr4u256zn996/9Cxq20bN6j K9yQg4wMthbB0Nlc6P0kFvIwTtvVGMygiKhFYzYdYTOtWm95ffVOcSPXfnB2NZd8Wa7g Jppk8of2QrouSKXIGg6lb83cgPZ+dmG81LMWGuiNCEtossvUswU+luWLRAGVj8Jeefgn tuQt/15Y3GtpqKwMyxG3wq8gxQugosGLqwsO1mAszaCNGOsojpWxXF+/v70TJgxZuKCn NLFAwoXl0uijJ7nuWr5TW/BI+vQsLJ8VJZAFPLcUy0M54M+HpL6XbifAGUi5IDTyjyzZ 8o6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=tV8RQ8wQKtXZ0tWqNwcRmnxwJvvFr184uepBD40zDNU=; b=LCQoPfrPxvRFRKILPjRxgKZ3Igl7klw2JxBI9dc9C0SleqMWTD8hY4vUmSqDiD4LYG OciT8WB1lhUPa21c6pOQRZnM4VK+yn7lgoF86AOpfzOoyaHkWspcRxCHl1lmIlJkhHbU El1N8UtHfUJGMZz7pJTPLcxtsBuazfA6gAPrXMYwz+rqMi4ejFVe88vDKLL5R8KFkbe9 HF3umcymwbnkYafhSB2nl2jCL+lVwV6GreJWbUi0o4jimU2R6fR9IoweScvG469MXMek 5Xs3zE1wBPWMQsdmKbs48IXHlt0dORLl9/jcvxjQAET5tMAe3SoD6M8yWVW3wtlPO7RE 072A== X-Gm-Message-State: ACrzQf0mH8vjoMduPHq2iHlMdH7MYmdbTPIl1nD9wBuSHXVC9yVLSSIA TCcNewohWwls6odmDi14sHT4og== X-Google-Smtp-Source: AMsMyM4ZKxD3wwVIm8mQvXmKU1ygkE9tDN2UNsGRLg0HQPUGkdGCMI0DdJ6oOvAh04BwGp8VmJue9A== X-Received: by 2002:a05:6402:1555:b0:458:ed89:24e9 with SMTP id p21-20020a056402155500b00458ed8924e9mr5074223edx.55.1664794328275; Mon, 03 Oct 2022 03:52:08 -0700 (PDT) Received: from localhost ([86.61.181.4]) by smtp.gmail.com with ESMTPSA id tl25-20020a170907c31900b0078b1bb98615sm1925358ejc.51.2022.10.03.03.52.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Oct 2022 03:52:07 -0700 (PDT) From: Jiri Pirko To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com, tariqt@nvidia.com, moshe@nvidia.com, saeedm@nvidia.com, linux-rdma@vger.kernel.org Subject: [patch net-next v2 02/13] net: devlink: move port_type_warn_schedule() call to __devlink_port_type_set() Date: Mon, 3 Oct 2022 12:51:53 +0200 Message-Id: <20221003105204.3315337-3-jiri@resnulli.us> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20221003105204.3315337-1-jiri@resnulli.us> References: <20221003105204.3315337-1-jiri@resnulli.us> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Jiri Pirko As __devlink_port_type_set() is going to be called directly from netdevice notifier event handle in one of the follow-up patches, move the port_type_warn_schedule() call there. Signed-off-by: Jiri Pirko --- net/core/devlink.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/net/core/devlink.c b/net/core/devlink.c index 7e7645ae3d89..218cb1cdb50e 100644 --- a/net/core/devlink.c +++ b/net/core/devlink.c @@ -10000,7 +10000,11 @@ static void __devlink_port_type_set(struct devlink_port *devlink_port, { ASSERT_DEVLINK_PORT_REGISTERED(devlink_port); - devlink_port_type_warn_cancel(devlink_port); + if (type == DEVLINK_PORT_TYPE_NOTSET) + devlink_port_type_warn_schedule(devlink_port); + else + devlink_port_type_warn_cancel(devlink_port); + spin_lock_bh(&devlink_port->type_lock); devlink_port->type = type; switch (type) { @@ -10095,7 +10099,6 @@ EXPORT_SYMBOL_GPL(devlink_port_type_ib_set); void devlink_port_type_clear(struct devlink_port *devlink_port) { __devlink_port_type_set(devlink_port, DEVLINK_PORT_TYPE_NOTSET, NULL); - devlink_port_type_warn_schedule(devlink_port); } EXPORT_SYMBOL_GPL(devlink_port_type_clear);