[dpdk-dev,11/16] net/axgbe: add configure flow control while link adjustment

Message ID 1512047472-118050-11-git-send-email-Ravi1.kumar@amd.com (mailing list archive)
State Changes Requested, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Kumar, Ravi1 Nov. 30, 2017, 1:11 p.m. UTC
  Signed-off-by: Ravi Kumar <Ravi1.kumar@amd.com>
---
 drivers/net/axgbe/axgbe_mdio.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
  

Patch

diff --git a/drivers/net/axgbe/axgbe_mdio.c b/drivers/net/axgbe/axgbe_mdio.c
index 753dde9..07f4087 100644
--- a/drivers/net/axgbe/axgbe_mdio.c
+++ b/drivers/net/axgbe/axgbe_mdio.c
@@ -796,6 +796,19 @@  static void axgbe_an_init(struct axgbe_port *pdata)
 static void axgbe_phy_adjust_link(struct axgbe_port *pdata)
 {
 	if (pdata->phy.link) {
+		/* Flow control support */
+		pdata->pause_autoneg = pdata->phy.pause_autoneg;
+
+		if (pdata->tx_pause != (unsigned int)pdata->phy.tx_pause) {
+			pdata->hw_if.config_tx_flow_control(pdata);
+			pdata->tx_pause = pdata->phy.tx_pause;
+		}
+
+		if (pdata->rx_pause != (unsigned int)pdata->phy.rx_pause) {
+			pdata->hw_if.config_rx_flow_control(pdata);
+			pdata->rx_pause = pdata->phy.rx_pause;
+		}
+
 		/* Speed support */
 		if (pdata->phy_speed != pdata->phy.speed)
 			pdata->phy_speed = pdata->phy.speed;