From patchwork Tue Jul 16 20:13:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Guilherme G. Piccoli" X-Patchwork-Id: 1132935 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45pBS64Qtsz9sDQ; Wed, 17 Jul 2019 06:13:57 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1hnTph-0005gw-Ez; Tue, 16 Jul 2019 20:13:53 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1hnTpf-0005gh-2G for kernel-team@lists.ubuntu.com; Tue, 16 Jul 2019 20:13:51 +0000 Received: from mail-qt1-f198.google.com ([209.85.160.198]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1hnTpe-0007O9-LM for kernel-team@lists.ubuntu.com; Tue, 16 Jul 2019 20:13:50 +0000 Received: by mail-qt1-f198.google.com with SMTP id y19so19178118qtm.0 for ; Tue, 16 Jul 2019 13:13:50 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=YgvbTeoKPKIQZRuD3UsTjtMR7Q05APx/ucg0Au+VhFs=; b=kR555MyqQESdA72PQMJUkneb3GrPBPHQliqN+eceOXot3z89Qg7nh+N0OZzRLBv1qT vdcEP0PdMj1NG9GQiZoxnAfMZODWvyCLqbPC1FsS8Qi/yDVLUE6hrZ8XAHy7sJRqISIQ NSEhL/mOZtV0t0sDCpaRRgE00IiG3TJZ6xvvvE1d1wv5rjwHUFoTMy8g61yeCFpabwML bOhHzM+f5X1Nx4wl3sUigmtjRZvolmVv/ztfVVG/EET/hN12ALIVfBZIsB9WqPBh1dad 3MbbVngoSyVcZpk6MTQMaoMxMmMvvyKsqbUnKw/KRHw9fFe8XfYAzIVFivG4zegbRick ACvw== X-Gm-Message-State: APjAAAVqctTa8VgyJQi3+jU1K8Y5jZgMmJhiKcImIPnhG0LZK+XgDs9Y 2drDJ7DI89uH10OaWGhFwpZEpuJyHCh588ZLMayiaG7Sz6lOAwa20JEeHY8LwMkAdaXSPIOgZx2 9mZCT/0RcdZhoyzaYbTXeiiEO5oofaXYzdFCjxvPOTw== X-Received: by 2002:aed:2f03:: with SMTP id l3mr24892244qtd.264.1563308029623; Tue, 16 Jul 2019 13:13:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqyjwsVOuk7Fhglhskdl2IxCX715dJMuUs/OpndicLB1smSL9/t4rCi1NmVBG6zBYz0yQN/5LQ== X-Received: by 2002:aed:2f03:: with SMTP id l3mr24892228qtd.264.1563308029431; Tue, 16 Jul 2019 13:13:49 -0700 (PDT) Received: from localhost (201-42-108-61.dsl.telesp.net.br. [201.42.108.61]) by smtp.gmail.com with ESMTPSA id n5sm12200149qta.29.2019.07.16.13.13.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jul 2019 13:13:48 -0700 (PDT) From: "Guilherme G. Piccoli" To: kernel-team@lists.ubuntu.com Subject: [SRU B/D][Unstable][PATCH 1/1] ixgbevf: Use cached link state instead of re-reading the value for ethtool Date: Tue, 16 Jul 2019 17:13:42 -0300 Message-Id: <20190716201343.29258-2-gpiccoli@canonical.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190716201343.29258-1-gpiccoli@canonical.com> References: <20190716201343.29258-1-gpiccoli@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gpiccoli@canonical.com Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Alexander Duyck BugLink: https://bugs.launchpad.net/bugs/1836760 Change the ethtool link settings call to just read the cached state out of the adapter structure instead of trying to recheck the value from the PF. Doing this should prevent excessive reading of the mailbox. Signed-off-by: Alexander Duyck Reviewed-by: "Guilherme G. Piccoli" Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher (cherry picked from commit 1e1b0c658d9bb364b4a2a4b08a760d3e4c239bdc) Signed-off-by: Guilherme G. Piccoli Acked-by: Stefan Bader --- drivers/net/ethernet/intel/ixgbevf/ethtool.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbevf/ethtool.c b/drivers/net/ethernet/intel/ixgbevf/ethtool.c index 5399787e07af..54459b69c948 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ethtool.c +++ b/drivers/net/ethernet/intel/ixgbevf/ethtool.c @@ -85,22 +85,16 @@ static int ixgbevf_get_link_ksettings(struct net_device *netdev, struct ethtool_link_ksettings *cmd) { struct ixgbevf_adapter *adapter = netdev_priv(netdev); - struct ixgbe_hw *hw = &adapter->hw; - u32 link_speed = 0; - bool link_up; ethtool_link_ksettings_zero_link_mode(cmd, supported); ethtool_link_ksettings_add_link_mode(cmd, supported, 10000baseT_Full); cmd->base.autoneg = AUTONEG_DISABLE; cmd->base.port = -1; - hw->mac.get_link_status = 1; - hw->mac.ops.check_link(hw, &link_speed, &link_up, false); - - if (link_up) { + if (adapter->link_up) { __u32 speed = SPEED_10000; - switch (link_speed) { + switch (adapter->link_speed) { case IXGBE_LINK_SPEED_10GB_FULL: speed = SPEED_10000; break;