From patchwork Mon Sep 3 10:21:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 145777 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp2313303ljw; Mon, 3 Sep 2018 03:23:20 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZR6DcwoU+X2woVMwiCm7E19rUFjsj76m7XbHkdpsI0KvPISDB4PVwYISHmE6tno+k1N85i X-Received: by 2002:a17:902:aa05:: with SMTP id be5-v6mr26424942plb.313.1535970200520; Mon, 03 Sep 2018 03:23:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535970200; cv=none; d=google.com; s=arc-20160816; b=kb7f+SNM6aDUsKlcdBSYnCF6nx2mZ5il34ROvjLaWHVyn8q6OJM371DK6Qiby6ZOXB b6Pj5WPsjny3TfChmdtofPO2tA4k9xhP+TGD8AkAcJuG2YeW6RasiARBh+bZGz/DSe7Q NXsrOfYs2qbD7hlthF3u9fY+UZGBoACWqD7MPcvrjrjm06+rgUJX41xh33o3N4n2oNKV HHFkllTJmI9eq3d8mDs9X4scvn6FvFATXc4g7VDDIE05FTyFwsFNJZq28NmdG0P9eJDo bmKxQt0Jfm/I1PesMwfk1WsdvvppkpVBc8ycaWGEcZIQKilb10zPOQknQgPDR0oeGTj5 EkYg== 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 v1-v6si19009850pfc.23.2018.09.03.03.23.20; Mon, 03 Sep 2018 03:23:20 -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 S1727957AbeICOms (ORCPT + 32 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 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(-) -- 2.7.4 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)