raw/ioat: allow perform operations function to return error
[dpdk.git] / drivers / net / ice / ice_ethdev.c
index d432abc..da9e85b 100644 (file)
@@ -10,6 +10,8 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
+#include <rte_tailq.h>
+
 #include "base/ice_sched.h"
 #include "base/ice_flow.h"
 #include "base/ice_dcb.h"
@@ -1092,12 +1094,13 @@ ice_remove_all_mac_vlan_filters(struct ice_vsi *vsi)
 {
        struct ice_mac_filter *m_f;
        struct ice_vlan_filter *v_f;
+       void *temp;
        int ret = 0;
 
        if (!vsi || !vsi->mac_num)
                return -EINVAL;
 
-       TAILQ_FOREACH(m_f, &vsi->mac_list, next) {
+       TAILQ_FOREACH_SAFE(m_f, &vsi->mac_list, next, temp) {
                ret = ice_remove_mac_filter(vsi, &m_f->mac_info.mac_addr);
                if (ret != ICE_SUCCESS) {
                        ret = -EINVAL;
@@ -1108,7 +1111,7 @@ ice_remove_all_mac_vlan_filters(struct ice_vsi *vsi)
        if (vsi->vlan_num == 0)
                return 0;
 
-       TAILQ_FOREACH(v_f, &vsi->vlan_list, next) {
+       TAILQ_FOREACH_SAFE(v_f, &vsi->vlan_list, next, temp) {
                ret = ice_remove_vlan_filter(vsi, &v_f->vlan_info.vlan);
                if (ret != ICE_SUCCESS) {
                        ret = -EINVAL;
@@ -1650,6 +1653,7 @@ ice_pf_setup(struct ice_pf *pf)
  * Extract device serial number from PCIe Configuration Space and
  * determine the pkg file path according to the DSN.
  */
+#ifndef RTE_EXEC_ENV_WINDOWS
 static int
 ice_pkg_file_search_path(struct rte_pci_device *pci_dev, char *pkg_file)
 {
@@ -1693,6 +1697,7 @@ fail_dsn:
        strncpy(pkg_file, ICE_PKG_FILE_DEFAULT, ICE_MAX_PKG_FILENAME_SIZE);
        return 0;
 }
+#endif
 
 enum ice_pkg_type
 ice_load_pkg_type(struct ice_hw *hw)
@@ -1718,6 +1723,7 @@ ice_load_pkg_type(struct ice_hw *hw)
        return package_type;
 }
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 static int ice_load_pkg(struct rte_eth_dev *dev)
 {
        struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
@@ -1793,6 +1799,7 @@ fail_exit:
        rte_free(buf);
        return err;
 }
+#endif
 
 static void
 ice_base_queue_get(struct ice_pf *pf)
@@ -2073,6 +2080,7 @@ ice_dev_init(struct rte_eth_dev *dev)
                return -EINVAL;
        }
 
+#ifndef RTE_EXEC_ENV_WINDOWS
        ret = ice_load_pkg(dev);
        if (ret) {
                if (ad->devargs.safe_mode_support == 0) {
@@ -2085,6 +2093,7 @@ ice_dev_init(struct rte_eth_dev *dev)
                                        "Entering Safe Mode");
                ad->is_safe_mode = 1;
        }
+#endif
 
        PMD_INIT_LOG(INFO, "FW %d.%d.%05d API %d.%d",
                     hw->fw_maj_ver, hw->fw_min_ver, hw->fw_build,
@@ -4517,8 +4526,11 @@ ice_promisc_disable(struct rte_eth_dev *dev)
        uint8_t pmask;
        int ret = 0;
 
-       pmask = ICE_PROMISC_UCAST_RX | ICE_PROMISC_UCAST_TX |
-               ICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX;
+       if (dev->data->all_multicast == 1)
+               pmask = ICE_PROMISC_UCAST_RX | ICE_PROMISC_UCAST_TX;
+       else
+               pmask = ICE_PROMISC_UCAST_RX | ICE_PROMISC_UCAST_TX |
+                       ICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX;
 
        status = ice_clear_vsi_promisc(hw, vsi->idx, pmask, 0);
        if (status != ICE_SUCCESS) {