Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp1621540imm; Fri, 6 Jul 2018 03:34:16 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd5MIQQnKpEA87OgF1LzKHbn579hgkTOonEEL/JNRpfnAo7iMDL9jOfhmDq1PbBGxmVYLlY X-Received: by 2002:a65:6203:: with SMTP id d3-v6mr8888240pgv.420.1530873256092; Fri, 06 Jul 2018 03:34:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530873256; cv=none; d=google.com; s=arc-20160816; b=IZfyqQh+xutgjkK/W1ZqytMU+Ce+NHqwK5YTcNZTUy6CM5tcke+kN1o6UO2YQyTB6A 5y8QNlBohhfDyDviB33c0DRTeWoZ5rGQenYgL0pXnH1CUyxTYuFbJrDkF0A+8HXOQhbX MosLNcHbsRMWDm5K2KiddWtu2/bHqcGSqZ4kwpgWzf8wacPW1ot2J/qK4N+x3q+sq+aY nvH3nY2mIIuRRn3LjmWRDJ31MwD/BXt8PlubWAehb+ruTHB8waVptIRwXtMiXAvENhDi +4X96fgQPsG0N7RfWvTtbB2bUKyOy950sXBrVre2DbEa6VwSzyIP5tr/wzHFgjYud48M XIhw== 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=fB2/YtZGJ/2ystkT7xMqnIsyIpUpYBtoKKviVmQN0ME=; b=BkuaIyCxlHosACf7x7/J1yk7vMeugW7JBtja34AeLPBpqyzTIRWNLpAIy+m1bXF5wZ cFqZ0nQVdzb8Y49SQzB7epZw8Wqqbno8PKBptrTeO7eFl6I/DHZ85I3nIBhsYoYmaazd prtS9uiUh+knNvWPl3ACiVWmHl5TFrNkyPahvX9+qfVEZuyuIRISPhPsWmk4PE9foZ6x 0m3e2q3v60StKCDARTb50ohrzk63MIZtWuQgtxC+bro1uKj8xVVLGY4JHfHa21Kr7k8n ntJuYLC21i2MdIsgn42TIub8bjdnyXJGnko25d/vR9Ya4IT4jBPtT31O/TZbphCWe/VG 4aYA== 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 k14-v6si7991836pls.477.2018.07.06.03.34.00; Fri, 06 Jul 2018 03:34:16 -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 S932413AbeGFK3R (ORCPT + 99 others); Fri, 6 Jul 2018 06:29:17 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:9159 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932310AbeGFK3P (ORCPT ); Fri, 6 Jul 2018 06:29:15 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 9976DCDAE9C65; Fri, 6 Jul 2018 18:29:00 +0800 (CST) Received: from S00293818-DELL1.huawei.com (10.202.226.54) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.382.0; Fri, 6 Jul 2018 18:28:52 +0800 From: Salil Mehta To: CC: , , , , , , , Yunsheng Lin Subject: [PATCH net-next 02/10] net: hns3: Fix for mac pause not disable in pfc mode Date: Fri, 6 Jul 2018 11:27:56 +0100 Message-ID: <20180706102804.196-3-salil.mehta@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180706102804.196-1-salil.mehta@huawei.com> References: <20180706102804.196-1-salil.mehta@huawei.com> MIME-Version: 1.0 Content-Type: text/plain 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 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 HNS3 driver") Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- 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/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c index 82bc30f..e2acf3b 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 = true; rx_en = true; break; + case HCLGE_FC_PFC: + tx_en = false; + rx_en = false; + break; default: tx_en = true; rx_en = true; @@ -1240,8 +1244,9 @@ int hclge_pause_setup_hw(struct hclge_dev *hdev) if (ret) return ret; - if (hdev->tm_info.fc_mode != HCLGE_FC_PFC) - return hclge_mac_pause_setup_hw(hdev); + ret = hclge_mac_pause_setup_hw(hdev); + if (ret) + return ret; /* Only DCB-supported dev supports qset back pressure and pfc cmd */ if (!hnae3_dev_dcb_supported(hdev)) -- 2.7.4