Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp830202ybl; Wed, 11 Dec 2019 08:08:47 -0800 (PST) X-Google-Smtp-Source: APXvYqxRailIWk9krsZoL3QcBu3FYal0Ssl5AOTC4QK9Yvja7tQvKPucU5VmY3sVWuP3P1ajAm/p X-Received: by 2002:aca:1a10:: with SMTP id a16mr3470726oia.9.1576080527232; Wed, 11 Dec 2019 08:08:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576080527; cv=none; d=google.com; s=arc-20160816; b=m8cGUFdQsWGNZ/v21p1TmC9OSVngmizE5l4OnGPxgCI5o1FAE7N41MwuIBWSelBsGf nm9Nr3USSAY+w+3kY4EGU4nxJYu9s6sdUP0DcQBpJw6ztUVGpeQcEYxG5cWpg3KhdAYS 2JQVftproOgA0e1D4wW9Gz5BSH9T06AjBRKSC7PkrwKr3Y7KVNNSl+bYYHTRBD0u/T8p JigFYQ11NVReVgFMGJpwTlowS6n0/nFtrAvXcqcENqkAtb9TJLCqc/BQS2upNQvkKMrt j9CGE+13ug4wV8hv5hlkxvdLyIioQG8bR88Ds8nPsCcviisOtnYB6666cSgLTcm/YKer ypUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5EWQ9/4EtVQLurqqFWB8T7Bi8fpRXQT/9lyObwuzfeM=; b=U0EBqlLcLh7U+NXVPPXvDb+iZa3duj2s5556yVfArwJM+oefAfWuRddt8DAoGiF06I cN+Fejbl/y7x9CUYmXYPqRs//QjTGF7BF8avQf1fQJbXNcCt+ioVM9igGQDC7NEiq9lo qbB7+8W6rsZGVg2TdPCv7MsRNJkEq5Loc++Bi/iW2O5YKNARMJyRWlzto/oZ1E3F6z+Z sjfeGndRZsIgn0PA1NcdisvoysXnJxJdZPbmDGPVma5p+bjpihfIBZzvWw47JzQuVKZI BDmkAiKzDz7Oib17s7Qsv795kB9JngEzjapdjQiVBbD1wwEn5J7j1++0rSt5LZXRxTOI MZ5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vc0EfWpc; 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 p22si1288382ota.43.2019.12.11.08.08.34; Wed, 11 Dec 2019 08:08:47 -0800 (PST) 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=vc0EfWpc; 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 S2388898AbfLKQGE (ORCPT + 99 others); Wed, 11 Dec 2019 11:06:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:34968 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731216AbfLKPMp (ORCPT ); Wed, 11 Dec 2019 10:12:45 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5FC422465B; Wed, 11 Dec 2019 15:12:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077163; bh=ugpmlOyr7TaG72VcGP0lAPfC8pVHr4pczswXTIfCbl4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vc0EfWpcv/rtU3Z2GkxywbTXa5uLhZPbzeuYy9ys16/JewZL8kiaqedhwP2SGc/23 daN1YtdwSAjk9NRsrhHfw5ZbDB3NdWtl9s8y6Yt5T7U/uhKIxtg5ocftJxmSxGk+w7 KcswZOmhsqoH7Z1eEuyt8uN/JN17xb9ZxyWtTZFI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yunsheng Lin , Huazhong Tan , "David S. Miller" , Sasha Levin Subject: [PATCH 5.3 039/105] net: hns3: reallocate SSU buffer size when pfc_en changes Date: Wed, 11 Dec 2019 16:05:28 +0100 Message-Id: <20191211150236.251208894@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150221.153659747@linuxfoundation.org> References: <20191211150221.153659747@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yunsheng Lin [ Upstream commit aea8cfb35a82d6c2f3517c86694933ba766635e5 ] When a TC's PFC is disabled or enabled, the RX private buffer for this TC need to be changed too, otherwise this may cause packet dropped problem. This patch fixes it by calling hclge_buffer_alloc to reallocate buffer when pfc_en changes. Fixes: cacde272dd00 ("net: hns3: Add hclge_dcb module for the support of DCB feature") Signed-off-by: Yunsheng Lin Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- .../ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c index bac4ce13f6ae4..d9136a199d8db 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c @@ -302,6 +302,7 @@ static int hclge_ieee_setpfc(struct hnae3_handle *h, struct ieee_pfc *pfc) struct hclge_vport *vport = hclge_get_vport(h); struct hclge_dev *hdev = vport->back; u8 i, j, pfc_map, *prio_tc; + int ret; if (!(hdev->dcbx_cap & DCB_CAP_DCBX_VER_IEEE) || hdev->flag & HCLGE_FLAG_MQPRIO_ENABLE) @@ -327,7 +328,21 @@ static int hclge_ieee_setpfc(struct hnae3_handle *h, struct ieee_pfc *pfc) hclge_tm_pfc_info_update(hdev); - return hclge_pause_setup_hw(hdev, false); + ret = hclge_pause_setup_hw(hdev, false); + if (ret) + return ret; + + ret = hclge_notify_client(hdev, HNAE3_DOWN_CLIENT); + if (ret) + return ret; + + ret = hclge_buffer_alloc(hdev); + if (ret) { + hclge_notify_client(hdev, HNAE3_UP_CLIENT); + return ret; + } + + return hclge_notify_client(hdev, HNAE3_UP_CLIENT); } /* DCBX configuration */ -- 2.20.1