From patchwork Mon Mar 16 19:31:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 222449 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=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 BA38EC3F2CE for ; Mon, 16 Mar 2020 19:31:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8EE6C20674 for ; Mon, 16 Mar 2020 19:31:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=pensando.io header.i=@pensando.io header.b="oyUAyALl" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732449AbgCPTbp (ORCPT ); Mon, 16 Mar 2020 15:31:45 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:37892 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732429AbgCPTbp (ORCPT ); Mon, 16 Mar 2020 15:31:45 -0400 Received: by mail-pg1-f195.google.com with SMTP id x7so10296857pgh.5 for ; Mon, 16 Mar 2020 12:31:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YFwdwokeovEZ2zjrRaZ7T7a+UD0PdDiAfN6gx/7xgTo=; b=oyUAyALlXn7nqeQtperRXOrqmsCStal1U8XZFW+Hra1ipX5bc2zlePjiRP3/2Gn2QB LQZ3sE9y88M4BF6eXdHlW6K5LjkogqLJjfAC3+J/JfIW/sVPVm3wYRSaBaQxktCOD3ty CIDbVmmJ4nSOaZs2suFFyVqvC4kzlbxJpNuSQkoShMiTUs/hN53qFtab47NqdSFeiFuf rJZcDJU/1/htbdRQi3CFoZZbmpe2q2RRommhRD4rFbKaIEpnyBbIIZA22YbR9SNPvmdr b4i2OcpMgx7fkg+S35XkDt5ZWiNPaSITfXRXQQzHqzj9Sj4bHtjfi7n6PwL+AeJoEcnI 9xBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YFwdwokeovEZ2zjrRaZ7T7a+UD0PdDiAfN6gx/7xgTo=; b=p6pfzawgO98lbnZGm6NSm/wf0R7f++eIaavbrTDCkk8aRkqa6wlJA0ldbEarupYQKD otZkiNqllgxlnTONLyhuwm9jgGu5Z9MBm/RIsugGANgjmSOys0AwgkZYab3XXh1blC96 GpXfdxBKEShk82RfpY+FuSFGMg2EH0g1EiFec5ENwEXxH+TjNIT+CPBdyKYch2WydQgS 3awtAq742MPwU693d+NPoEdePpXA6G2G3F7zZ4Asa1BZF6zysQnafVNTrauvpyenSPQ4 pnfYAjJXWyb2llQVCjHxuzD6xKxeB9OUL/Sv/grnQfdaxYiDKRkfrh5N7wEAPQyjI177 CWbA== X-Gm-Message-State: ANhLgQ2ezAefrlyCTZiLUflYLjAcxADTe1deTUsELuxVEbQigft70K6r R82b9+b8GkMtV14PrpFDSRI8MwuveI0= X-Google-Smtp-Source: ADFU+vvIabp4ZAGjhR6+TSGY2pdBQgmfwHCz2H0wWtlSTj+m5XuVrvCju5PJJAImQaJNvemrQFiC8Q== X-Received: by 2002:a63:7a02:: with SMTP id v2mr1289044pgc.13.1584387102575; Mon, 16 Mar 2020 12:31:42 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id w17sm656413pfi.59.2020.03.16.12.31.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Mar 2020 12:31:42 -0700 (PDT) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net Cc: Shannon Nelson Subject: [PATCH v2 net-next 1/5] ionic: stop devlink warn on mgmt device Date: Mon, 16 Mar 2020 12:31:30 -0700 Message-Id: <20200316193134.56820-2-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200316193134.56820-1-snelson@pensando.io> References: <20200316193134.56820-1-snelson@pensando.io> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org If we don't set a port type, the devlink code will eventually print a WARN in the kernel log. Because the mgmt device is not really a useful port, don't register it as a devlink port. Fixes: b3f064e9746d ("ionic: add support for device id 0x1004") Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_devlink.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_devlink.c b/drivers/net/ethernet/pensando/ionic/ionic_devlink.c index ed14164468a1..273c889faaad 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_devlink.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_devlink.c @@ -77,12 +77,16 @@ int ionic_devlink_register(struct ionic *ionic) return err; } + /* don't register the mgmt_nic as a port */ + if (ionic->is_mgmt_nic) + return 0; + devlink_port_attrs_set(&ionic->dl_port, DEVLINK_PORT_FLAVOUR_PHYSICAL, 0, false, 0, NULL, 0); err = devlink_port_register(dl, &ionic->dl_port, 0); if (err) dev_err(ionic->dev, "devlink_port_register failed: %d\n", err); - else if (!ionic->is_mgmt_nic) + else devlink_port_type_eth_set(&ionic->dl_port, ionic->master_lif->netdev); @@ -93,6 +97,7 @@ void ionic_devlink_unregister(struct ionic *ionic) { struct devlink *dl = priv_to_devlink(ionic); - devlink_port_unregister(&ionic->dl_port); + if (ionic->dl_port.registered) + devlink_port_unregister(&ionic->dl_port); devlink_unregister(dl); }