From patchwork Fri Jul 6 10:27:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 141284 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2944918ljj; Fri, 6 Jul 2018 03:29:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeUGb/LdcG+iuUcW7vob/VpaIxVqjOguE9fhu2N0yH3yM8q7te/C1J9YddYgF3Cs4OxuXJj X-Received: by 2002:a17:902:8a87:: with SMTP id p7-v6mr9655483plo.281.1530872959982; Fri, 06 Jul 2018 03:29:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530872959; cv=none; d=google.com; s=arc-20160816; b=nApD7y9Wmrc7aflj+3nhtXhCRffdLGbyJneMYexWiUhTyvxZEmzdIOl9y4MSaYHLUP jqNk0hLWbq4wIMMkYZXiUG0z4tQxTsTAY/PsoIihdedxWKFgP1PhTrh8gx5oNp25ulSR RvUORO1bQ+ID+4C67ofX+rPC5LuD5d1k6QFWCKY9kShAL2otYiFKFarOCMrxkOeHswzT FnlpSuD5t6w3eT9Y1EJ0vH4i7IZxvnt/MGV/jCpOaDEeCIYcDxN0uK2KEjvkHJxHkigd OF2Zkc97zdl3hcRM34HCj+dzNp6e3TyOGkzSBNw1s+3g0KzwJuNwYnb56qxB+FGAzpBS QtGw== 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 y23-v6si7793590pgk.427.2018.07.06.03.29.19; Fri, 06 Jul 2018 03:29:19 -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 S932429AbeGFK3R (ORCPT + 30 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 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(-) -- 2.7.4 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))