From patchwork Fri May 22 06:12:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 70507 X-Patchwork-Delegate: xiaolong.ye@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6558EA0093; Fri, 22 May 2020 08:30:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CE2941D8F0; Fri, 22 May 2020 08:30:36 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 52B991D6F7; Fri, 22 May 2020 08:30:35 +0200 (CEST) IronPort-SDR: jWvArKz4HyrdKAsivz8bsPFbSe2cl8T7d0/3Lk+KWsoP/MWxnE47LkeHDqr77hyR6Ni1HJC5ol wCUGvxlfWraQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 May 2020 23:30:34 -0700 IronPort-SDR: piEHytUFZtG2uFZsLBBI78RgqjWM+16r28UY9DSSDV1f7cSLhT2ZcGkf2cgpm12E1WjwTSCoS7 1HAutvVq8u5Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,420,1583222400"; d="scan'208";a="374680816" Received: from dpdk.sh.intel.com ([10.239.255.14]) by fmsmga001.fm.intel.com with ESMTP; 21 May 2020 23:30:32 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Zhao1 Wei , Guinan Sun , stable@dpdk.org Date: Fri, 22 May 2020 06:12:08 +0000 Message-Id: <20200522061208.31694-1-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] net/ixgbe: delete MAC control frame fwd in struct adapter X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" If some user set mac_ctrl_frame_fwd to 1 from fc ops, then he do a port reset process of testpmd> start testpmd> set flow_ctrl mac_ctrl_frame_fwd on 0 testpmd> stop testpmd> port stop 0 testpmd> port start 0 testpmd> start Then after this process, the mac_ctrl_frame_fwd has been change to "off", so we should delete "adapter->mac_ctrl_frame_fwd = 0;" from dev-stop. In addition, add a value to mac_ctrl_frame_fwd in the ixgbe_flow_ctrl_get () function. Fixes: a524f550da6e ("net/ixgbe: fix flow control mode setting") Cc: stable@dpdk.org Signed-off-by: SunGuinan --- drivers/net/ixgbe/ixgbe_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index f8a84c565..dd4023f01 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -2939,8 +2939,6 @@ ixgbe_dev_stop(struct rte_eth_dev *dev) adapter->rss_reta_updated = 0; - adapter->mac_ctrl_frame_fwd = 0; - hw->adapter_stopped = true; } @@ -4754,6 +4752,8 @@ ixgbe_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) * MFLCN register. */ mflcn_reg = IXGBE_READ_REG(hw, IXGBE_MFLCN); + fc_conf->mac_ctrl_frame_fwd = mflcn_reg; + if (mflcn_reg & (IXGBE_MFLCN_RPFCE | IXGBE_MFLCN_RFCE)) rx_pause = 1; else