patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Guinan Sun <guinanx.sun@intel.com>
Cc: Tomasz Konieczny <tomaszx.konieczny@intel.com>,
	Xiaolong Ye <xiaolong.ye@intel.com>,
	dpdk stable <stable@dpdk.org>
Subject: [dpdk-stable] patch 'net/ixgbe: fix flow control mode setting' has been queued to LTS release 18.11.7
Date: Thu, 27 Feb 2020 17:37:58 +0000
Message-ID: <20200227173807.28004-7-ktraynor@redhat.com> (raw)
In-Reply-To: <20200227173807.28004-1-ktraynor@redhat.com>

Hi,

FYI, your patch has been queued to LTS release 18.11.7

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/02/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/1fa4864cd8691ca86e04a68fbec6536caa8e304e

Thanks.

Kevin.

---
From 1fa4864cd8691ca86e04a68fbec6536caa8e304e Mon Sep 17 00:00:00 2001
From: Guinan Sun <guinanx.sun@intel.com>
Date: Tue, 18 Feb 2020 03:39:31 +0000
Subject: [PATCH] net/ixgbe: fix flow control mode setting

[ upstream commit a524f550da6e6c7a308ce7c2f4b6c3be60b5cbfa ]

When the port restarts, the flow ctrl register will be reset,
we need to make sure it can be configured the same as previous setting,
otherwise a register read error would occur. This patch fixes this
issue.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Tested-by: Tomasz Konieczny <tomaszx.konieczny@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 76 +++++++++++++++++++++-----------
 drivers/net/ixgbe/ixgbe_ethdev.h |  1 +
 2 files changed, 51 insertions(+), 26 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index e06cc433c7..2d49ea011b 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1155,6 +1155,6 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
 	ixgbe_dcb_init(hw, dcb_config);
 	/* Get Hardware Flow Control setting */
-	hw->fc.requested_mode = ixgbe_fc_full;
-	hw->fc.current_mode = ixgbe_fc_full;
+	hw->fc.requested_mode = ixgbe_fc_none;
+	hw->fc.current_mode = ixgbe_fc_none;
 	hw->fc.pause_time = IXGBE_FC_PAUSE;
 	for (i = 0; i < IXGBE_DCB_MAX_TRAFFIC_CLASS; i++) {
@@ -2574,4 +2574,37 @@ ixgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,
 }
 
+static int
+ixgbe_flow_ctrl_enable(struct rte_eth_dev *dev, struct ixgbe_hw *hw)
+{
+	struct ixgbe_adapter *adapter = dev->data->dev_private;
+	int err;
+	uint32_t mflcn;
+
+	err = ixgbe_fc_enable(hw);
+
+	/* Not negotiated is not an error case */
+	if (err == IXGBE_SUCCESS || err == IXGBE_ERR_FC_NOT_NEGOTIATED) {
+		/*
+		 *check if we want to forward MAC frames - driver doesn't
+		 *have native capability to do that,
+		 *so we'll write the registers ourselves
+		 */
+
+		mflcn = IXGBE_READ_REG(hw, IXGBE_MFLCN);
+
+		/* set or clear MFLCN.PMCF bit depending on configuration */
+		if (adapter->mac_ctrl_frame_fwd != 0)
+			mflcn |= IXGBE_MFLCN_PMCF;
+		else
+			mflcn &= ~IXGBE_MFLCN_PMCF;
+
+		IXGBE_WRITE_REG(hw, IXGBE_MFLCN, mflcn);
+		IXGBE_WRITE_FLUSH(hw);
+
+		return 0;
+	}
+	return err;
+}
+
 /*
  * Configure device link speed and setup link.
@@ -2710,4 +2743,10 @@ ixgbe_dev_start(struct rte_eth_dev *dev)
 	ixgbe_restore_statistics_mapping(dev);
 
+	err = ixgbe_flow_ctrl_enable(dev, hw);
+	if (err < 0) {
+		PMD_INIT_LOG(ERR, "enable flow ctrl err");
+		goto error;
+	}
+
 	err = ixgbe_dev_rxtx_start(dev);
 	if (err < 0) {
@@ -2926,4 +2965,6 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
 
 	adapter->rss_reta_updated = 0;
+
+	adapter->mac_ctrl_frame_fwd = 0;
 }
 
@@ -4639,8 +4680,8 @@ ixgbe_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 {
 	struct ixgbe_hw *hw;
+	struct ixgbe_adapter *adapter = dev->data->dev_private;
 	int err;
 	uint32_t rx_buf_size;
 	uint32_t max_high_water;
-	uint32_t mflcn;
 	enum ixgbe_fc_mode rte_fcmode_2_ixgbe_fcmode[] = {
 		ixgbe_fc_none,
@@ -4674,29 +4715,12 @@ ixgbe_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 	hw->fc.send_xon       = fc_conf->send_xon;
 	hw->fc.disable_fc_autoneg = !fc_conf->autoneg;
+	adapter->mac_ctrl_frame_fwd = fc_conf->mac_ctrl_frame_fwd;
 
-	err = ixgbe_fc_enable(hw);
-
-	/* Not negotiated is not an error case */
-	if ((err == IXGBE_SUCCESS) || (err == IXGBE_ERR_FC_NOT_NEGOTIATED)) {
-
-		/* check if we want to forward MAC frames - driver doesn't have native
-		 * capability to do that, so we'll write the registers ourselves */
-
-		mflcn = IXGBE_READ_REG(hw, IXGBE_MFLCN);
-
-		/* set or clear MFLCN.PMCF bit depending on configuration */
-		if (fc_conf->mac_ctrl_frame_fwd != 0)
-			mflcn |= IXGBE_MFLCN_PMCF;
-		else
-			mflcn &= ~IXGBE_MFLCN_PMCF;
-
-		IXGBE_WRITE_REG(hw, IXGBE_MFLCN, mflcn);
-		IXGBE_WRITE_FLUSH(hw);
-
-		return 0;
+	err = ixgbe_flow_ctrl_enable(dev, hw);
+	if (err < 0) {
+		PMD_INIT_LOG(ERR, "ixgbe_flow_ctrl_enable = 0x%x", err);
+		return -EIO;
 	}
-
-	PMD_INIT_LOG(ERR, "ixgbe_fc_enable = 0x%x", err);
-	return -EIO;
+	return err;
 }
 
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h
index 752d7981e4..2177d37060 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.h
+++ b/drivers/net/ixgbe/ixgbe_ethdev.h
@@ -506,4 +506,5 @@ struct ixgbe_adapter {
 	 */
 	uint8_t pflink_fullchk;
+	uint8_t mac_ctrl_frame_fwd;
 };
 
-- 
2.21.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-02-27 17:26:24.085609083 +0000
+++ 0007-net-ixgbe-fix-flow-control-mode-setting.patch	2020-02-27 17:26:23.641831285 +0000
@@ -1 +1 @@
-From a524f550da6e6c7a308ce7c2f4b6c3be60b5cbfa Mon Sep 17 00:00:00 2001
+From 1fa4864cd8691ca86e04a68fbec6536caa8e304e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a524f550da6e6c7a308ce7c2f4b6c3be60b5cbfa ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org
@@ -23 +24 @@
-index 0ef84a2861..23b3f5b0cd 100644
+index e06cc433c7..2d49ea011b 100644
@@ -26 +27 @@
-@@ -1177,6 +1177,6 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
+@@ -1155,6 +1155,6 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
@@ -35 +36 @@
-@@ -2539,4 +2539,37 @@ ixgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,
+@@ -2574,4 +2574,37 @@ ixgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,
@@ -73 +74 @@
-@@ -2665,4 +2698,10 @@ ixgbe_dev_start(struct rte_eth_dev *dev)
+@@ -2710,4 +2743,10 @@ ixgbe_dev_start(struct rte_eth_dev *dev)
@@ -84,2 +85 @@
-@@ -2901,4 +2940,6 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
- 	adapter->rss_reta_updated = 0;
+@@ -2926,4 +2965,6 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
@@ -87 +87 @@
-+	adapter->mac_ctrl_frame_fwd = 0;
+ 	adapter->rss_reta_updated = 0;
@@ -89 +89 @@
- 	hw->adapter_stopped = true;
++	adapter->mac_ctrl_frame_fwd = 0;
@@ -91 +91,2 @@
-@@ -4719,8 +4760,8 @@ ixgbe_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
+ 
+@@ -4639,8 +4680,8 @@ ixgbe_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
@@ -101 +102 @@
-@@ -4755,29 +4796,12 @@ ixgbe_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
+@@ -4674,29 +4715,12 @@ ixgbe_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
@@ -138 +139 @@
-index 5089347a7e..b8df756575 100644
+index 752d7981e4..2177d37060 100644
@@ -141 +142 @@
-@@ -512,4 +512,5 @@ struct ixgbe_adapter {
+@@ -506,4 +506,5 @@ struct ixgbe_adapter {
@@ -145,2 +146,2 @@
- 	rte_atomic32_t link_thread_running;
- 	pthread_t link_thread_tid;
+ };
+ 


  parent reply	other threads:[~2020-02-27 17:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-27 17:37 [dpdk-stable] patch 'examples/fips_validation: fix AES-GCM cipher length parsing' " Kevin Traynor
2020-02-27 17:37 ` [dpdk-stable] patch 'examples/fips_validation: fix string token for CT length' " Kevin Traynor
2020-02-27 17:37 ` [dpdk-stable] patch 'net/qede: fix VF reload' " Kevin Traynor
2020-02-27 17:37 ` [dpdk-stable] patch 'net/qede: do not stop vport if not started' " Kevin Traynor
2020-02-27 17:37 ` [dpdk-stable] patch 'net/ixgbe: check for illegal Tx packets' " Kevin Traynor
2020-02-27 17:37 ` [dpdk-stable] patch 'net/mlx5: fix tunnel flow priority' " Kevin Traynor
2020-02-27 17:37 ` Kevin Traynor [this message]
2020-02-27 17:37 ` [dpdk-stable] patch 'net/vhost: allocate interface name from heap' " Kevin Traynor
2020-02-27 17:38 ` [dpdk-stable] patch 'net/vhost: fix probing in secondary process' " Kevin Traynor
2020-02-27 17:38 ` [dpdk-stable] patch 'net/mlx5: fix L3 VXLAN RSS expansion' " Kevin Traynor
2020-02-27 17:38 ` [dpdk-stable] patch 'net/sfc: fix log format specifiers' " Kevin Traynor
2020-02-27 17:38 ` [dpdk-stable] patch 'net/fm10k: fix non-x86 build' " Kevin Traynor
2020-02-27 17:38 ` [dpdk-stable] patch 'examples/tep_term: remove redundant info get' " Kevin Traynor
2020-02-27 17:38 ` [dpdk-stable] patch 'app/testpmd: fix identifier size for port attach' " Kevin Traynor
2020-02-27 17:38 ` [dpdk-stable] patch 'net/mlx5: fix match on ethertype and CVLAN tag' " Kevin Traynor
2020-02-27 17:38 ` [dpdk-stable] patch 'doc: fix multi-producer enqueue figure in ring guide' " Kevin Traynor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200227173807.28004-7-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=guinanx.sun@intel.com \
    --cc=stable@dpdk.org \
    --cc=tomaszx.konieczny@intel.com \
    --cc=xiaolong.ye@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git