From patchwork Wed Nov 2 16:02:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Pirko X-Patchwork-Id: 13028340 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 045E5C43219 for ; Wed, 2 Nov 2022 16:02:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231171AbiKBQCU (ORCPT ); Wed, 2 Nov 2022 12:02:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231178AbiKBQCR (ORCPT ); Wed, 2 Nov 2022 12:02:17 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 437842B636 for ; Wed, 2 Nov 2022 09:02:16 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id 5so10953068wmo.1 for ; Wed, 02 Nov 2022 09:02:16 -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 :message-id:reply-to; bh=X1MyJqO1mdXn8/laNFPE2bRj0/yLyArfqMTcNfqAWXY=; b=5ZSd+8BZbC24G3hbjqtLLcA9qcMb2v+6qeZbrlQUpJeEz1lGdpVdvaX6LEV02EzS7t 9OEPRh50svPbCNop7fylt9dJB5OxIHTvPK+ABvyF2BAAsKd0So4MuwzUm9k/1/HJORDU v9JDjG22glSbM0HQ9ixLj18TjKSNR43hrE8nyJt9lRiqh6ByDINsj5+nEmYTVPn3Qhxr 63r+5scySM14zvSedDCBdNMewOQDoiucPwnJOJzfOXShsYW8vgxBmM4XsE/KZ3p7ksT4 /CL57UjU02qvgYQC7/PXLgBrXVcxT1AsnehtxQEuKghi1/fn2lU8ohZsbJqYWVHmK18z +99A== 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:message-id:reply-to; bh=X1MyJqO1mdXn8/laNFPE2bRj0/yLyArfqMTcNfqAWXY=; b=jk0HwuQoBz6HQ1wbUBpPmqsj4FKnKvOj96/Di/UPeTi9vEX1XZTxUKoD351iO5blId CESB0L4n27ytsEEpljIwwPeHnFkndkxXiJRcPTZzwJudl/qE/xm/2dcBpYfsq5/fksQP xTxTnWWEqN+hBvNv7j6pJCVfy8qhW1kgXXkXwGjHhMtBmyKRug+E8ZBGAc/wgsWJJwyg ZCXAQT6D2LfyAWQt2IzxDaAdISrpG6H355cKrBrX96eK7aQeqrI1ZQhlfzNLmSF27qNa 3xrcEw4RkYvb2LTMYncDcAwf7Ko4VOmc9RTSteQGuJ1b+j+U8DlNqY/5WQDu+4QZnRD/ eU5A== X-Gm-Message-State: ACrzQf1d7Jqzszg0vjT8kPet4VDeJfpdZzZ/sNDdyIj3ZiZd1NvZPdm5 EQBrQO6UgLgDFTL0hTyziL0Smw== X-Google-Smtp-Source: AMsMyM5Diub71WltbaxQ+S2Rmu9qh1NqQ5bqtg0jFl0Na2uJtVi083hRmXXE/6FmM+HBpN5HvsJvVA== X-Received: by 2002:a05:600c:1d1c:b0:3cf:846c:5092 with SMTP id l28-20020a05600c1d1c00b003cf846c5092mr3693954wms.160.1667404935880; Wed, 02 Nov 2022 09:02:15 -0700 (PDT) Received: from localhost ([86.61.181.4]) by smtp.gmail.com with ESMTPSA id g19-20020a05600c4ed300b003c6f426467fsm2743204wmq.40.2022.11.02.09.02.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 09:02:15 -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 v4 02/13] net: devlink: move port_type_warn_schedule() call to __devlink_port_type_set() Date: Wed, 2 Nov 2022 17:02:00 +0100 Message-Id: <20221102160211.662752-3-jiri@resnulli.us> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221102160211.662752-1-jiri@resnulli.us> References: <20221102160211.662752-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 868d04c2164f..3ba3435e2cd5 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);