Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1547567imm; Mon, 3 Sep 2018 03:24:49 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYaFfmF3fKpYbcl1l4zxubIp7A5QJMTnhM/n3hjojQKjIIdaLJnIMttmKcxqw6HEF4AFqSC X-Received: by 2002:a63:5d1c:: with SMTP id r28-v6mr25818667pgb.445.1535970289221; Mon, 03 Sep 2018 03:24:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535970289; cv=none; d=google.com; s=arc-20160816; b=LTcXz/Pzj5GhGlo5SMvB02pQdccGUXd6tTTDIECnBHKHmIZCvNH484EfBvRQ3BhYDr cQIgB1Gpjq22yqycUpyvtvCUpFYG9+GJkHSn08i5+M2d2yFXjG7nkkxfqy9Qkj3JOUeR FXtnaaW//5kW7X90TgMuOcOblh3OM15k1xbM+oXZIwAPxqYf8+AXHIiLAGwXkqp3taZv 8zeSRMWKrWNJcwbvTFEcWGagNnQKrZvln2MyGjUbMJxz7j3YHiBlp0KjDfWw8JLmm7Xw I/j01M0xo9RuuN5KM+nSR4lLr50b90i3LVhhEKlD4bwp3vKrKI6LYY6OJ2djGth1JJwi Wg6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=NARclp6CMBZmTDrQhBg/OJWdI42gnniny4O52dyw5eA=; b=t8Z+RLWknN08iAmRohkYINEoQsQyGHRpFuDE0lq0/jFSmcmSuAM6EgjxxlPlFPzSPl oUyq3cW7AjxYAaU3IZ20xv1tYc+W75CzHp1klYwblqc7uZzkfhNWAPlonfdFfxQ3TIIa ABsxXiu80fEoq3V2BtSun7BLhVGlWawzsxTmzqWiMyQWtA1qFxkIDV3gV20/XDvGWMXf 2vWSo/l59t2L47QabK6RULH3b54VLfaL7jGVdmLN9bqtGclc8BXV+VNwED2NNI+gP0zg oVEkNO3409v7YTggHFUrTlZ05dukLMKwweyXvWOOCWj/2ctrvVicaZJHEaB0BJfMcIxU 9suw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y7-v6si15182545pgp.551.2018.09.03.03.24.34; Mon, 03 Sep 2018 03:24:49 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727953AbeICOms (ORCPT + 99 others); Mon, 3 Sep 2018 10:42:48 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:51606 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726052AbeICOms (ORCPT ); Mon, 3 Sep 2018 10:42:48 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id CF47123D4876F; Mon, 3 Sep 2018 18:23:14 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.226.54) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.399.0; Mon, 3 Sep 2018 18:23:06 +0800 From: Salil Mehta To: CC: , , , , , , , Yunsheng Lin Subject: [PATCH net-next 06/11] net: hns3: Fix ping exited problem when doing lp selftest Date: Mon, 3 Sep 2018 11:21:51 +0100 Message-ID: <20180903102156.18676-7-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180903102156.18676-1-salil.mehta@huawei.com> References: <20180903102156.18676-1-salil.mehta@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.202.226.54] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yunsheng Lin 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 --- 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 14797b9..7143e39 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c @@ -294,7 +294,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 */ @@ -332,7 +332,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.7.4