git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/hns3: add check for deferred start queue when rollback
[dpdk.git]
/
drivers
/
net
/
hns3
/
hns3_ethdev.c
diff --git
a/drivers/net/hns3/hns3_ethdev.c
b/drivers/net/hns3/hns3_ethdev.c
index
a511466
..
0b565a5
100644
(file)
--- a/
drivers/net/hns3/hns3_ethdev.c
+++ b/
drivers/net/hns3/hns3_ethdev.c
@@
-2015,11
+2015,9
@@
hns3_dev_configure(struct rte_eth_dev *dev)
goto cfg_err;
}
goto cfg_err;
}
- /* When RSS is not configured, redirect the packet queue 0 */
if ((uint32_t)mq_mode & RTE_ETH_MQ_RX_RSS_FLAG) {
conf->rxmode.offloads |= RTE_ETH_RX_OFFLOAD_RSS_HASH;
rss_conf = conf->rx_adv_conf.rss_conf;
if ((uint32_t)mq_mode & RTE_ETH_MQ_RX_RSS_FLAG) {
conf->rxmode.offloads |= RTE_ETH_RX_OFFLOAD_RSS_HASH;
rss_conf = conf->rx_adv_conf.rss_conf;
- hw->rss_dis_flag = false;
ret = hns3_dev_rss_hash_update(dev, &rss_conf);
if (ret)
goto cfg_err;
ret = hns3_dev_rss_hash_update(dev, &rss_conf);
if (ret)
goto cfg_err;
@@
-2075,7
+2073,6
@@
static int
hns3_config_mtu(struct hns3_hw *hw, uint16_t mps)
{
struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
hns3_config_mtu(struct hns3_hw *hw, uint16_t mps)
{
struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
- uint16_t original_mps = hns->pf.mps;
int err;
int ret;
int err;
int ret;
@@
-2085,22
+2082,20
@@
hns3_config_mtu(struct hns3_hw *hw, uint16_t mps)
return ret;
}
return ret;
}
- hns->pf.mps = mps;
ret = hns3_buffer_alloc(hw);
if (ret) {
hns3_err(hw, "failed to allocate buffer, ret = %d", ret);
goto rollback;
}
ret = hns3_buffer_alloc(hw);
if (ret) {
hns3_err(hw, "failed to allocate buffer, ret = %d", ret);
goto rollback;
}
+ hns->pf.mps = mps;
+
return 0;
rollback:
return 0;
rollback:
- err = hns3_set_mac_mtu(hw,
original_
mps);
- if (err)
{
+ err = hns3_set_mac_mtu(hw,
hns->pf.
mps);
+ if (err)
hns3_err(hw, "fail to rollback MTU, err = %d", err);
hns3_err(hw, "fail to rollback MTU, err = %d", err);
- return ret;
- }
- hns->pf.mps = original_mps;
return ret;
}
return ret;
}
@@
-2736,6
+2731,10
@@
hns3_get_capability(struct hns3_hw *hw)
if (ret)
return ret;
if (ret)
return ret;
+ ret = hns3_query_mac_stats_reg_num(hw);
+ if (ret)
+ return ret;
+
if (hw->revision < PCI_REVISION_ID_HIP09_A) {
hns3_set_default_dev_specifications(hw);
hw->intr.mapping_mode = HNS3_INTR_MAPPING_VEC_RSV_ONE;
if (hw->revision < PCI_REVISION_ID_HIP09_A) {
hns3_set_default_dev_specifications(hw);
hw->intr.mapping_mode = HNS3_INTR_MAPPING_VEC_RSV_ONE;
@@
-2824,7
+2823,6
@@
hns3_get_board_configuration(struct hns3_hw *hw)
hw->mac.media_type = cfg.media_type;
hw->rss_size_max = cfg.rss_size_max;
hw->mac.media_type = cfg.media_type;
hw->rss_size_max = cfg.rss_size_max;
- hw->rss_dis_flag = false;
memcpy(hw->mac.mac_addr, cfg.mac_addr, RTE_ETHER_ADDR_LEN);
hw->mac.phy_addr = cfg.phy_addr;
hw->dcb_info.num_pg = 1;
memcpy(hw->mac.mac_addr, cfg.mac_addr, RTE_ETHER_ADDR_LEN);
hw->mac.phy_addr = cfg.phy_addr;
hw->dcb_info.num_pg = 1;
@@
-4363,10
+4361,12
@@
hns3_service_handler(void *param)
struct hns3_adapter *hns = eth_dev->data->dev_private;
struct hns3_hw *hw = &hns->hw;
struct hns3_adapter *hns = eth_dev->data->dev_private;
struct hns3_hw *hw = &hns->hw;
- if (!hns3_is_reset_pending(hns))
+ if (!hns3_is_reset_pending(hns))
{
hns3_update_linkstatus_and_event(hw, true);
hns3_update_linkstatus_and_event(hw, true);
- else
+ hns3_update_hw_stats(hw);
+ } else {
hns3_warn(hw, "Cancel the query when reset is pending");
hns3_warn(hw, "Cancel the query when reset is pending");
+ }
rte_eal_alarm_set(HNS3_SERVICE_INTERVAL, hns3_service_handler, eth_dev);
}
rte_eal_alarm_set(HNS3_SERVICE_INTERVAL, hns3_service_handler, eth_dev);
}
@@
-4377,6
+4377,10
@@
hns3_init_hardware(struct hns3_adapter *hns)
struct hns3_hw *hw = &hns->hw;
int ret;
struct hns3_hw *hw = &hns->hw;
int ret;
+ /*
+ * All queue-related HW operations must be performed after the TCAM
+ * table is configured.
+ */
ret = hns3_map_tqp(hw);
if (ret) {
PMD_INIT_LOG(ERR, "Failed to map tqp: %d", ret);
ret = hns3_map_tqp(hw);
if (ret) {
PMD_INIT_LOG(ERR, "Failed to map tqp: %d", ret);
@@
-4617,13
+4621,6
@@
hns3_init_pf(struct rte_eth_dev *eth_dev)
goto err_cmd_init;
}
goto err_cmd_init;
}
- /* Hardware statistics of imissed registers cleared. */
- ret = hns3_update_imissed_stats(hw, true);
- if (ret) {
- hns3_err(hw, "clear imissed stats failed, ret = %d", ret);
- goto err_cmd_init;
- }
-
hns3_config_all_msix_error(hw, true);
ret = rte_intr_callback_register(pci_dev->intr_handle,
hns3_config_all_msix_error(hw, true);
ret = rte_intr_callback_register(pci_dev->intr_handle,
@@
-4649,7
+4646,7
@@
hns3_init_pf(struct rte_eth_dev *eth_dev)
goto err_get_config;
}
goto err_get_config;
}
- ret = hns3_
tqp_
stats_init(hw);
+ ret = hns3_stats_init(hw);
if (ret)
goto err_get_config;
if (ret)
goto err_get_config;
@@
-4695,7
+4692,7
@@
err_enable_intr:
err_fdir:
hns3_uninit_umv_space(hw);
err_init_hw:
err_fdir:
hns3_uninit_umv_space(hw);
err_init_hw:
- hns3_
tqp_
stats_uninit(hw);
+ hns3_stats_uninit(hw);
err_get_config:
hns3_pf_disable_irq0(hw);
rte_intr_disable(pci_dev->intr_handle);
err_get_config:
hns3_pf_disable_irq0(hw);
rte_intr_disable(pci_dev->intr_handle);
@@
-4729,7
+4726,7
@@
hns3_uninit_pf(struct rte_eth_dev *eth_dev)
hns3_flow_uninit(eth_dev);
hns3_fdir_filter_uninit(hns);
hns3_uninit_umv_space(hw);
hns3_flow_uninit(eth_dev);
hns3_fdir_filter_uninit(hns);
hns3_uninit_umv_space(hw);
- hns3_
tqp_
stats_uninit(hw);
+ hns3_stats_uninit(hw);
hns3_config_mac_tnl_int(hw, false);
hns3_pf_disable_irq0(hw);
rte_intr_disable(pci_dev->intr_handle);
hns3_config_mac_tnl_int(hw, false);
hns3_pf_disable_irq0(hw);
rte_intr_disable(pci_dev->intr_handle);
@@
-5345,7
+5342,7
@@
hns3_get_current_fc_mode(struct rte_eth_dev *dev)
return hns3_get_autoneg_fc_mode(hw);
}
return hns3_get_autoneg_fc_mode(hw);
}
-
static
int
+int
hns3_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
{
struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
hns3_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
{
struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
@@
-5546,15
+5543,15
@@
hns3_reinit_dev(struct hns3_adapter *hns)
return ret;
}
return ret;
}
- ret = hns3_
reset_all_tqps
(hns);
+ ret = hns3_
init_hardware
(hns);
if (ret) {
if (ret) {
- hns3_err(hw, "Failed to
reset all queues
: %d", ret);
+ hns3_err(hw, "Failed to
init hardware
: %d", ret);
return ret;
}
return ret;
}
- ret = hns3_
init_hardware
(hns);
+ ret = hns3_
reset_all_tqps
(hns);
if (ret) {
if (ret) {
- hns3_err(hw, "Failed to
init hardware
: %d", ret);
+ hns3_err(hw, "Failed to
reset all queues
: %d", ret);
return ret;
}
return ret;
}
@@
-6563,6
+6560,7
@@
static const struct eth_dev_ops hns3_eth_dev_ops = {
.timesync_adjust_time = hns3_timesync_adjust_time,
.timesync_read_time = hns3_timesync_read_time,
.timesync_write_time = hns3_timesync_write_time,
.timesync_adjust_time = hns3_timesync_adjust_time,
.timesync_read_time = hns3_timesync_read_time,
.timesync_write_time = hns3_timesync_write_time,
+ .eth_dev_priv_dump = hns3_eth_dev_priv_dump,
};
static const struct hns3_reset_ops hns3_reset_ops = {
};
static const struct hns3_reset_ops hns3_reset_ops = {