X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fatlantic%2Fatl_ethdev.c;h=c9c1795a16392e51239094f3fe9aafbc5f2d7dfb;hb=c352338e44b24bc1aa3a1a1b165ac3f4baeef37e;hp=d7572734cb5f13c3580d78925d08ad1352e0566c;hpb=99ceaad873059fd7a7ef4c8c5bf1575e64e880f9;p=dpdk.git diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c index d7572734cb..c9c1795a16 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -602,9 +602,6 @@ atl_dev_start(struct rte_eth_dev *dev) dev->data->dev_link.link_status = hw->aq_link_status.mbps != 0; - if (err) - goto error; - if (rte_intr_allow_others(intr_handle)) { /* check if lsc interrupt is enabled */ if (dev->data->dev_conf.intr_conf.lsc != 0) @@ -1160,6 +1157,7 @@ atl_dev_link_update(struct rte_eth_dev *dev, int wait __rte_unused) { struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct rte_eth_link link, old; + u32 fc = AQ_NIC_FC_OFF; int err = 0; link.link_status = ETH_LINK_DOWN; @@ -1194,6 +1192,15 @@ atl_dev_link_update(struct rte_eth_dev *dev, int wait __rte_unused) if (link.link_status == old.link_status) return -1; + /* Driver has to update flow control settings on RX block + * on any link event. + * We should query FW whether it negotiated FC. + */ + if (hw->aq_fw_ops->get_flow_control) { + hw->aq_fw_ops->get_flow_control(hw, &fc); + hw_atl_b0_set_fc(hw, fc, 0U); + } + if (rte_eal_alarm_set(1000 * 1000, atl_dev_delayed_handler, (void *)dev) < 0) PMD_DRV_LOG(ERR, "rte_eal_alarm_set fail"); @@ -1496,14 +1503,20 @@ static int atl_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) { struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private); + u32 fc = AQ_NIC_FC_OFF; + + if (hw->aq_fw_ops->get_flow_control == NULL) + return -ENOTSUP; + + hw->aq_fw_ops->get_flow_control(hw, &fc); - if (hw->aq_nic_cfg->flow_control == AQ_NIC_FC_OFF) + if (fc == AQ_NIC_FC_OFF) fc_conf->mode = RTE_FC_NONE; - else if (hw->aq_nic_cfg->flow_control & (AQ_NIC_FC_RX | AQ_NIC_FC_TX)) + else if (fc & (AQ_NIC_FC_RX | AQ_NIC_FC_TX)) fc_conf->mode = RTE_FC_FULL; - else if (hw->aq_nic_cfg->flow_control & AQ_NIC_FC_RX) + else if (fc & AQ_NIC_FC_RX) fc_conf->mode = RTE_FC_RX_PAUSE; - else if (hw->aq_nic_cfg->flow_control & AQ_NIC_FC_RX) + else if (fc & AQ_NIC_FC_RX) fc_conf->mode = RTE_FC_TX_PAUSE; return 0;