Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp446862pxb; Wed, 29 Sep 2021 02:41:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzldeBHgiOab+OzhCzz+ixdcvgqRXaL1pwX3aJVYRihnHj4QBAMZOnSKChgn4Owwx2B5HRM X-Received: by 2002:a17:902:708b:b0:13e:1a20:f1b0 with SMTP id z11-20020a170902708b00b0013e1a20f1b0mr9231280plk.51.1632908518811; Wed, 29 Sep 2021 02:41:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632908518; cv=none; d=google.com; s=arc-20160816; b=tkcD8Oa2SbbwDrAUN6Azyw2o1YE93WgQUT62KLsXuGjxgqMNE5+5onLHlLrmEEMqrp 8qFZSL7mY/2IBypd7Bjf+YhalXPWD685eAeZXKvblv4DH0FxxyYmRQLTziVJ3GsbWys2 J1MQ6V9uGlIS5fqfQeN+ifvGYARJBQPWZ3k7Psqp7eQGIMEpDJPQgyQthNMhBzD9gCBh ni5Tpz3BT+8tgovyJ27fOU/0J7CBIFIg6Phwv+yg2xGRG4r9eleTAfDAhv/ahrp6Yks1 2OBj/XGxdNv9cB+QKk1qUyhzue5+VT8w0GYC4S/5mhYJw1y4ij0xHuImRsWLBs4Z7/Ct xRoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=zrjLqxmaVaKz4AH4kjk26U6ovjUs+cHSLaEG7XuY6BA=; b=uZO8jC67cEmGIjiufmxp3JM+LSm9EcyeN5sZCxS6QiiBDQedLLeiZWtQUENImsbv01 vBoVf2k+JhvhTkspiDKnO8P9w/nMDi96oUl9Fi/GHHGn3ixCVTfuT+eoyIOtufj5CH1c SgYBiYAKWYdSeoGhceZanWYspsC0e2JIl2G+zpTp043eHLRv1KVW3OSru6Tnio3iHid0 r4QHY20XIyYaNjG+bHTXd0f5QYztzrm5f2xKeGaKYi9cYL7oEs1xbKr1+DGGszszs8rH CsaPbev17j1Un67swz02k4KVgfK2ZG8cUZQDbCR5/5AsBj2T8UxYcF6dGXAWC/z4vGBK EpJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 22si1103003pjd.46.2021.09.29.02.41.44; Wed, 29 Sep 2021 02:41:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245213AbhI2JmF (ORCPT + 99 others); Wed, 29 Sep 2021 05:42:05 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:12970 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245088AbhI2Jlv (ORCPT ); Wed, 29 Sep 2021 05:41:51 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4HKBCF1Vy4zWCST; Wed, 29 Sep 2021 17:38:49 +0800 (CST) Received: from kwepemm600016.china.huawei.com (7.193.23.20) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Wed, 29 Sep 2021 17:40:08 +0800 Received: from localhost.localdomain (10.67.165.24) by kwepemm600016.china.huawei.com (7.193.23.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Wed, 29 Sep 2021 17:40:07 +0800 From: Guangbin Huang To: , CC: , , , Subject: [PATCH net 3/8] net: hns3: don't rollback when destroy mqprio fail Date: Wed, 29 Sep 2021 17:35:51 +0800 Message-ID: <20210929093556.9146-4-huangguangbin2@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210929093556.9146-1-huangguangbin2@huawei.com> References: <20210929093556.9146-1-huangguangbin2@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemm600016.china.huawei.com (7.193.23.20) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jian Shen For destroy mqprio is irreversible in stack, so it's unnecessary to rollback the tc configuration when destroy mqprio failed. Otherwise, it may cause the configuration being inconsistent between driver and netstack. As the failure is usually caused by reset, and the driver will restore the configuration after reset, so it can keep the configuration being consistent between driver and hardware. Fixes: 5a5c90917467 ("net: hns3: add support for tc mqprio offload") Signed-off-by: Jian Shen Signed-off-by: Guangbin Huang --- .../ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c index 96f96644abab..351b8f179a29 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c @@ -514,12 +514,17 @@ static int hclge_setup_tc(struct hnae3_handle *h, return hclge_notify_init_up(hdev); err_out: - /* roll-back */ - memcpy(&kinfo->tc_info, &old_tc_info, sizeof(old_tc_info)); - if (hclge_config_tc(hdev, &kinfo->tc_info)) - dev_err(&hdev->pdev->dev, - "failed to roll back tc configuration\n"); - + if (!tc) { + dev_warn(&hdev->pdev->dev, + "failed to destroy mqprio, will active after reset, ret = %d\n", + ret); + } else { + /* roll-back */ + memcpy(&kinfo->tc_info, &old_tc_info, sizeof(old_tc_info)); + if (hclge_config_tc(hdev, &kinfo->tc_info)) + dev_err(&hdev->pdev->dev, + "failed to roll back tc configuration\n"); + } hclge_notify_init_up(hdev); return ret; -- 2.33.0