net/ice: enable switch filter
[dpdk.git] / drivers / net / ice / ice_ethdev.c
index 9705d6f..b50ec50 100644 (file)
@@ -153,13 +153,13 @@ static const struct ice_xstats_name_off ice_stats_strings[] = {
        {"rx_unicast_packets", offsetof(struct ice_eth_stats, rx_unicast)},
        {"rx_multicast_packets", offsetof(struct ice_eth_stats, rx_multicast)},
        {"rx_broadcast_packets", offsetof(struct ice_eth_stats, rx_broadcast)},
-       {"rx_dropped", offsetof(struct ice_eth_stats, rx_discards)},
+       {"rx_dropped_packets", offsetof(struct ice_eth_stats, rx_discards)},
        {"rx_unknown_protocol_packets", offsetof(struct ice_eth_stats,
                rx_unknown_protocol)},
        {"tx_unicast_packets", offsetof(struct ice_eth_stats, tx_unicast)},
        {"tx_multicast_packets", offsetof(struct ice_eth_stats, tx_multicast)},
        {"tx_broadcast_packets", offsetof(struct ice_eth_stats, tx_broadcast)},
-       {"tx_dropped", offsetof(struct ice_eth_stats, tx_discards)},
+       {"tx_dropped_packets", offsetof(struct ice_eth_stats, tx_discards)},
 };
 
 #define ICE_NB_ETH_XSTATS (sizeof(ice_stats_strings) / \
@@ -1364,6 +1364,21 @@ fail_exit:
        return err;
 }
 
+static void
+ice_base_queue_get(struct ice_pf *pf)
+{
+       uint32_t reg;
+       struct ice_hw *hw = ICE_PF_TO_HW(pf);
+
+       reg = ICE_READ_REG(hw, PFLAN_RX_QALLOC);
+       if (reg & PFLAN_RX_QALLOC_VALID_M) {
+               pf->base_queue = reg & PFLAN_RX_QALLOC_FIRSTQ_M;
+       } else {
+               PMD_INIT_LOG(WARNING, "Failed to get Rx base queue"
+                                       " index");
+       }
+}
+
 static int
 ice_dev_init(struct rte_eth_dev *dev)
 {
@@ -1447,7 +1462,7 @@ ice_dev_init(struct rte_eth_dev *dev)
        /* Disable double vlan by default */
        ice_vsi_config_double_vlan(vsi, FALSE);
 
-       ret = ice_aq_stop_lldp(hw, TRUE, NULL);
+       ret = ice_aq_stop_lldp(hw, TRUE, FALSE, NULL);
        if (ret != ICE_SUCCESS)
                PMD_INIT_LOG(DEBUG, "lldp has already stopped\n");
 
@@ -1460,12 +1475,16 @@ ice_dev_init(struct rte_eth_dev *dev)
        /* enable uio intr after callback register */
        rte_intr_enable(intr_handle);
 
+       /* get base queue pairs index  in the device */
+       ice_base_queue_get(pf);
+
        return 0;
 
 err_pf_setup:
        ice_res_pool_destroy(&pf->msix_pool);
 err_msix_pool_init:
        rte_free(dev->data->mac_addrs);
+       dev->data->mac_addrs = NULL;
 err_init_mac:
        ice_sched_cleanup_all(hw);
        rte_free(hw->port_info);
@@ -2296,7 +2315,7 @@ ice_force_phys_link_state(struct ice_hw *hw, bool link_up)
        else
                cfg.caps &= ~ICE_AQ_PHY_ENA_LINK;
 
-       status = ice_aq_set_phy_cfg(hw, pi->lport, &cfg, NULL);
+       status = ice_aq_set_phy_cfg(hw, pi, &cfg, NULL);
 
 out:
        ice_free(hw, pcaps);