From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-eopbgr710124.outbound.protection.outlook.com ([40.107.71.124]:62784 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728348AbeIQIZf (ORCPT ); Mon, 17 Sep 2018 04:25:35 -0400 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Yunsheng Lin , Peng Li , Salil Mehta , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL 4.18 008/136] net: hns3: Fix for mac pause not disable in pfc mode Date: Mon, 17 Sep 2018 03:00:15 +0000 Message-ID: <20180917030006.245495-8-alexander.levin@microsoft.com> References: <20180917030006.245495-1-alexander.levin@microsoft.com> In-Reply-To: <20180917030006.245495-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Yunsheng Lin [ Upstream commit 6d0ec65cb5810f9bf08671be008785bb8c84d39f ] When pfc pause mode is enable, the mac pause mode need to be disabled, otherwise the pfc pause packet will not be sent when congestion happens. This patch fixes by disabling the mac pause when pfc pause is enabled. Fixes: 848440544b41 ("net: hns3: Add support of TX Scheduler & Shaper to HN= S3 driver") Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c b/driver= s/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c index 262c125f8137..f027fceea548 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c @@ -1223,6 +1223,10 @@ static int hclge_mac_pause_setup_hw(struct hclge_dev= *hdev) tx_en =3D true; rx_en =3D true; break; + case HCLGE_FC_PFC: + tx_en =3D false; + rx_en =3D false; + break; default: tx_en =3D true; rx_en =3D true; @@ -1240,8 +1244,9 @@ int hclge_pause_setup_hw(struct hclge_dev *hdev) if (ret) return ret; =20 - if (hdev->tm_info.fc_mode !=3D HCLGE_FC_PFC) - return hclge_mac_pause_setup_hw(hdev); + ret =3D hclge_mac_pause_setup_hw(hdev); + if (ret) + return ret; =20 /* Only DCB-supported dev supports qset back pressure and pfc cmd */ if (!hnae3_dev_dcb_supported(hdev)) --=20 2.17.1