From c3ab74fcc86911aafcaf73f7684971337b19e0e8 Mon Sep 17 00:00:00 2001 From: Andrew Boyer Date: Mon, 11 Jan 2021 11:02:08 -0800 Subject: [PATCH] net/ionic: clear up confusion around FC autoneg IONIC does not support Flow-Control autonegotiation. Always wait for completion after each dev cmd. Signed-off-by: Andrew Boyer --- drivers/net/ionic/ionic_ethdev.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c index 5ff155f85a..838e93ef75 100644 --- a/drivers/net/ionic/ionic_ethdev.c +++ b/drivers/net/ionic/ionic_ethdev.c @@ -463,7 +463,8 @@ ionic_flow_ctrl_get(struct rte_eth_dev *eth_dev, struct ionic_dev *idev = &adapter->idev; if (idev->port_info) { - fc_conf->autoneg = idev->port_info->config.an_enable; + /* Flow control autoneg not supported */ + fc_conf->autoneg = 0; if (idev->port_info->config.pause_type) fc_conf->mode = RTE_FC_FULL; @@ -482,7 +483,12 @@ ionic_flow_ctrl_set(struct rte_eth_dev *eth_dev, struct ionic_adapter *adapter = lif->adapter; struct ionic_dev *idev = &adapter->idev; uint8_t pause_type = IONIC_PORT_PAUSE_TYPE_NONE; - uint8_t an_enable; + int err; + + if (fc_conf->autoneg) { + IONIC_PRINT(WARNING, "Flow control autoneg not supported"); + return -ENOTSUP; + } switch (fc_conf->mode) { case RTE_FC_NONE: @@ -496,12 +502,12 @@ ionic_flow_ctrl_set(struct rte_eth_dev *eth_dev, return -ENOTSUP; } - an_enable = fc_conf->autoneg; - ionic_dev_cmd_port_pause(idev, pause_type); - ionic_dev_cmd_port_autoneg(idev, an_enable); + err = ionic_dev_cmd_wait_check(idev, IONIC_DEVCMD_TIMEOUT); + if (err) + IONIC_PRINT(WARNING, "Failed to configure flow control"); - return 0; + return err; } static int -- 2.20.1