net/mlx5: fix using flow tunnel before null check
[dpdk.git] / drivers / net / hns3 / hns3_ethdev_vf.c
index f3eaefb..6c3ddcc 100644 (file)
@@ -988,6 +988,9 @@ hns3vf_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
                                 DEV_TX_OFFLOAD_MBUF_FAST_FREE |
                                 hns3_txvlan_cap_get(hw));
 
+       if (hns3_dev_outer_udp_cksum_supported(hw))
+               info->tx_offload_capa |= DEV_TX_OFFLOAD_OUTER_UDP_CKSUM;
+
        if (hns3_dev_indep_txrx_supported(hw))
                info->dev_capa = RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP |
                                 RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP;
@@ -1218,6 +1221,7 @@ hns3vf_get_capability(struct hns3_hw *hw)
                hw->intr.mapping_mode = HNS3_INTR_MAPPING_VEC_RSV_ONE;
                hw->intr.gl_unit = HNS3_INTR_COALESCE_GL_UINT_2US;
                hw->tso_mode = HNS3_TSO_SW_CAL_PSEUDO_H_CSUM;
+               hw->drop_stats_mode = HNS3_PKTS_DROP_STATS_MODE1;
                hw->min_tx_pkt_len = HNS3_HIP08_MIN_TX_PKT_LEN;
                hw->rss_info.ipv6_sctp_offload_supported = false;
                hw->promisc_mode = HNS3_UNLIMIT_PROMISC_MODE;
@@ -1235,6 +1239,7 @@ hns3vf_get_capability(struct hns3_hw *hw)
        hw->intr.mapping_mode = HNS3_INTR_MAPPING_VEC_ALL;
        hw->intr.gl_unit = HNS3_INTR_COALESCE_GL_UINT_1US;
        hw->tso_mode = HNS3_TSO_HW_CAL_PSEUDO_H_CSUM;
+       hw->drop_stats_mode = HNS3_PKTS_DROP_STATS_MODE2;
        hw->min_tx_pkt_len = HNS3_HIP09_MIN_TX_PKT_LEN;
        hw->rss_info.ipv6_sctp_offload_supported = true;
        hw->promisc_mode = HNS3_LIMIT_PROMISC_MODE;
@@ -1872,6 +1877,13 @@ hns3vf_init_vf(struct rte_eth_dev *eth_dev)
        if (ret)
                goto err_get_config;
 
+       /* 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_set_tc_queue;
+       }
+
        ret = hns3vf_set_tc_queue_mapping(hns, hw->tqps_num, hw->tqps_num);
        if (ret) {
                PMD_INIT_LOG(ERR, "failed to set tc info, ret = %d.", ret);
@@ -2111,7 +2123,10 @@ hns3vf_dev_link_update(struct rte_eth_dev *eth_dev,
                new_link.link_speed = mac->link_speed;
                break;
        default:
-               new_link.link_speed = ETH_SPEED_NUM_100M;
+               if (mac->link_status)
+                       new_link.link_speed = ETH_SPEED_NUM_UNKNOWN;
+               else
+                       new_link.link_speed = ETH_SPEED_NUM_NONE;
                break;
        }
 
@@ -2769,7 +2784,7 @@ static const struct eth_dev_ops hns3vf_eth_dev_ops = {
        .rss_hash_conf_get  = hns3_dev_rss_hash_conf_get,
        .reta_update        = hns3_dev_rss_reta_update,
        .reta_query         = hns3_dev_rss_reta_query,
-       .filter_ctrl        = hns3_dev_filter_ctrl,
+       .flow_ops_get       = hns3_dev_flow_ops_get,
        .vlan_filter_set    = hns3vf_vlan_filter_set,
        .vlan_offload_set   = hns3vf_vlan_offload_set,
        .get_reg            = hns3_get_regs,
@@ -2903,8 +2918,10 @@ err_mp_init_primary:
 err_mp_init_secondary:
        eth_dev->dev_ops = NULL;
        eth_dev->rx_pkt_burst = NULL;
+       eth_dev->rx_descriptor_status = NULL;
        eth_dev->tx_pkt_burst = NULL;
        eth_dev->tx_pkt_prepare = NULL;
+       eth_dev->tx_descriptor_status = NULL;
        rte_free(eth_dev->process_private);
        eth_dev->process_private = NULL;