Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3962286pxb; Mon, 4 Oct 2021 13:48:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTsvLlPdtCCOWQIrPtIqBxIHtLDjl9tR42OhrK/LztSrNDbCr7kP+FwmYFaHdqTu9fnRMN X-Received: by 2002:a50:fc8e:: with SMTP id f14mr20738716edq.87.1633380487005; Mon, 04 Oct 2021 13:48:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633380486; cv=none; d=google.com; s=arc-20160816; b=flGvI2aWanTTvverZ/xV379kc9r0G/aJ5TO7dRGfmGhn7BkuX7sd9CMjt0mpeJfKHY 0Oc3G7stQQ8+kSDvmfObJqXezNxQnltjctaIkkSNPreezuJH2WSOH/ORnV9Vf/0eEbOS MhFZcfxqE/mu5xsc3/5fVb7Q8+SeWYR7photqzV00Tatni4sMEyIHEtABJeQlpXQirb8 99XoAobe996rP16B2b7AfAg73d3CeY9VgoY7WqOFri2Gj9qWxbozHyChKA/1qBuKl+t5 YOjeWiVBNFqSbQUGr6gvkBJkX/M2SrUPOc+nWpqqgVkIK++1MlLBHVBJyhREdh6zzvCH 0qUg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gTXT6G0GShb8bxizTCZhRB9116IMpgh0Y1PX1Me+hmY=; b=G7Ycmn0gUu1eV94SeRFlLqhxVMWEHXQiN7HXh3HP1AyphLMl1GBqZ2i7R2AUJCvY6T uzWDRsvBmmIJ6WGooicUSTYiZ86c9C/HbqqmzkrllW2BGIEQTL50+GzYV5potibukk+k UqxmhyEFQ7pMzFSrWbaN3shsjNPKcyISp0Rv0DcvDR6yvm19EAghSga+JtzGXlPrGC2v cCfiL+132G3/AA7vnaFHcxeeQWcddZpko1GhWLNONufwECjkNjjurXfZdaCF+L2p2Px+ asaK77dqXIxQjnfhUyzMvmGlE/VJT99b5zaOWSkSFITue5PzqD4yVTk34xv/6TXkpYeB UNkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SEvc+ZPt; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hk24si19439042ejb.480.2021.10.04.13.47.39; Mon, 04 Oct 2021 13:48:06 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SEvc+ZPt; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238208AbhJDNkF (ORCPT + 99 others); Mon, 4 Oct 2021 09:40:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:48814 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237912AbhJDNho (ORCPT ); Mon, 4 Oct 2021 09:37:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6F8E0613DB; Mon, 4 Oct 2021 13:17:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633353435; bh=6znmiAQI0D3L8XyYriWdU5mi/p9+rpxvrGDto5V/CtA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SEvc+ZPtYuFUChIrG1facdIsIjG3zFPCf4XqON8Q5z/7DDgS3zC25d2SwoJtXvZxh SrS1QBTv/ka5d1jhYKreQ1B76iMM9t1f/g6kX5JBR8ihTfTjl2aaIe1ICNXJ1KrKMC sMVkCjV8xtDcVlXbT8AvpnNoWoeFZ+GEyk2zaJVY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jian Shen , Guangbin Huang , "David S. Miller" , Sasha Levin Subject: [PATCH 5.14 126/172] net: hns3: dont rollback when destroy mqprio fail Date: Mon, 4 Oct 2021 14:52:56 +0200 Message-Id: <20211004125049.041036533@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211004125044.945314266@linuxfoundation.org> References: <20211004125044.945314266@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jian Shen [ Upstream commit d82650be60ee92e7486f755f5387023278aa933f ] 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- .../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 5fadfdbc4858..e4f87ffd41ac 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c @@ -493,12 +493,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