Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp174155imd; Wed, 31 Oct 2018 16:48:56 -0700 (PDT) X-Google-Smtp-Source: AJdET5dhBzqCRUm7uyYRZ4bg4Qe6FoKqZ71rVGPIRtO52VaNALGK2rf3dEOw/tQNqNgJ/EUdJ9gO X-Received: by 2002:a63:e00d:: with SMTP id e13-v6mr4987126pgh.114.1541029736105; Wed, 31 Oct 2018 16:48:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541029736; cv=none; d=google.com; s=arc-20160816; b=Gah3sK6aD4fmh+aTAyjiMVw/QWmbHp0FEQxC6fN02y7QEtGuhj8ikOWNICKgay1RG2 ugRB0F4aypxwLEVhnrNWWcqv/Y1yFh0qVHpTAtEQXvvKfg2diZvQmKKYe4ops69QSh5N Zp6cqmwh1ES96/+HwLWf+vgIiT6w1pFGXUKzKHoHRNW+YQNhyCe3Aatea131hBc2BIw+ TebhZ7I12IBhWN1TxrFEFrAGpj/8ptaC9quQ/otnHPAZ8rBjspb6abZRTSFwpvNGSyOs 0QpNf4dHOwSWpKv/ilS2nd9W4M7IA+YJcqfufrY246XcQn+9KJlTQMDVzZD6WA0w9LNl dlyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=TdsC7d9m9vmxLbahSogghYMfYnJukppQBV9V8ydFZ2E=; b=B81ImU0qRh3KT4CCSElJ1bPZ55UkBIwtcNW5ZTSefTMMTjSpG9ptS+3i4iqIFCVDdg Drju4aZVqzONFRSj5ONgYCmC6l7Y8x1hFh1xuoUUsa4dj1n2CIgnlCxv5dqmuzQYoXA0 1k3VqmgCMy+0ZTYexD4qKGHq/5FfkyHEuV5PdQVTm6qXSI0z9DRIQxZrfWgmP65QC1OP UyQ/WRBzQTC470Cswgd8sE17f9ARaroHoZVKVocD2zekFRB6FuOlGROjpRWNYltVQ48O tze/mgxhh4zLtGkgtgQtxUnRE3aVISe5JT0bv/d//PO1nH/B9vmiE4hs7pkprM5pb194 HB6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=barcdA2m; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f7-v6si28213038pgn.108.2018.10.31.16.48.38; Wed, 31 Oct 2018 16:48:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=barcdA2m; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728675AbeKAIsi (ORCPT + 99 others); Thu, 1 Nov 2018 04:48:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:54302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728421AbeKAIG5 (ORCPT ); Thu, 1 Nov 2018 04:06:57 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6231420821; Wed, 31 Oct 2018 23:06:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027207; bh=TUnXhI48oaPfDy/oQ4SSiNhnBxSo98XCW7v+gTXWXkU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=barcdA2mqeU5M+v5l4pSKbg5N4UZar5SJMPVUxt9s7lkrEo1YONOfrX1p65wkpoWr +jRyVeuG+vv/dy9ugIgXWEm/qdDWD4yfkGw1xEAP6uXI598MyIQ5DQ1ikiMQeXHz2W +OXImbC9Ki9yP1Ak+BMsxLWn/uLY2lt60sH7XukI= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Yunsheng Lin , Peng Li , Salil Mehta , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL 4.19 070/146] net: hns3: Fix ping exited problem when doing lp selftest Date: Wed, 31 Oct 2018 19:04:25 -0400 Message-Id: <20181031230541.28822-70-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031230541.28822-1-sashal@kernel.org> References: <20181031230541.28822-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yunsheng Lin [ Upstream commit 3f8601f0f5716c4e63a9f215bbc581df42859d61 ] When ping is runnig and user executes the loopback selftest, the ping cmd will stop and exit. This patch fixes it by using the hns3_nic_net_open/stop to offline the netdev when doing loopback selftest. Fixes: c39c4d98dc65 ("net: hns3: Add mac loopback selftest support in hns3 driver") Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c index f70ee6910ee2..9684ad015c42 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c @@ -309,7 +309,7 @@ static void hns3_self_test(struct net_device *ndev, h->flags & HNAE3_SUPPORT_SERDES_LOOPBACK; if (if_running) - dev_close(ndev); + ndev->netdev_ops->ndo_stop(ndev); #if IS_ENABLED(CONFIG_VLAN_8021Q) /* Disable the vlan filter for selftest does not support it */ @@ -347,7 +347,7 @@ static void hns3_self_test(struct net_device *ndev, #endif if (if_running) - dev_open(ndev); + ndev->netdev_ops->ndo_open(ndev); } static int hns3_get_sset_count(struct net_device *netdev, int stringset) -- 2.17.1