net/i40e: workaround performance degradation
[dpdk.git] / drivers / net / i40e / i40e_ethdev.c
index afa9a1c..e06e0a2 100644 (file)
@@ -630,10 +630,7 @@ eth_i40e_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
                        return retval;
        }
 
-       /* physical port net_bdf_port */
-       snprintf(name, sizeof(name), "net_%s", pci_dev->device.name);
-
-       retval = rte_eth_dev_create(&pci_dev->device, name,
+       retval = rte_eth_dev_create(&pci_dev->device, pci_dev->device.name,
                sizeof(struct i40e_adapter),
                eth_dev_pci_specific_init, pci_dev,
                eth_i40e_dev_init, NULL);
@@ -642,7 +639,8 @@ eth_i40e_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
                return retval;
 
        /* probe VF representor ports */
-       struct rte_eth_dev *pf_ethdev = rte_eth_dev_allocated(name);
+       struct rte_eth_dev *pf_ethdev = rte_eth_dev_allocated(
+               pci_dev->device.name);
 
        if (pf_ethdev == NULL)
                return -ENODEV;
@@ -696,12 +694,20 @@ static struct rte_pci_driver rte_i40e_pmd = {
 };
 
 static inline void
-i40e_write_global_rx_ctl(struct i40e_hw *hw, u32 reg_addr, u32 reg_val)
+i40e_write_global_rx_ctl(struct i40e_hw *hw, uint32_t reg_addr,
+                        uint32_t reg_val)
 {
+       uint32_t ori_reg_val;
+       struct rte_eth_dev *dev;
+
+       ori_reg_val = i40e_read_rx_ctl(hw, reg_addr);
+       dev = ((struct i40e_adapter *)hw->back)->eth_dev;
        i40e_write_rx_ctl(hw, reg_addr, reg_val);
-       PMD_DRV_LOG(DEBUG, "Global register 0x%08x is modified "
-                   "with value 0x%08x",
-                   reg_addr, reg_val);
+       if (ori_reg_val != reg_val)
+               PMD_DRV_LOG(WARNING,
+                           "i40e device %s changed global register [0x%08x]."
+                           " original: 0x%08x, new: 0x%08x",
+                           dev->device->name, reg_addr, ori_reg_val, reg_val);
 }
 
 RTE_PMD_REGISTER_PCI(net_i40e, rte_i40e_pmd);
@@ -728,7 +734,6 @@ static inline void i40e_GLQF_reg_init(struct i40e_hw *hw)
         */
        I40E_WRITE_GLB_REG(hw, I40E_GLQF_ORT(40), 0x00000029);
        I40E_WRITE_GLB_REG(hw, I40E_GLQF_PIT(9), 0x00009420);
-       i40e_global_cfg_warning(I40E_WARNING_QINQ_PARSER);
 }
 
 static inline void i40e_config_automask(struct i40e_pf *pf)
@@ -1157,6 +1162,33 @@ i40e_support_multi_driver(struct rte_eth_dev *dev)
        return 0;
 }
 
+static int
+i40e_aq_debug_write_global_register(struct i40e_hw *hw,
+                                   uint32_t reg_addr, uint64_t reg_val,
+                                   struct i40e_asq_cmd_details *cmd_details)
+{
+       uint64_t ori_reg_val;
+       struct rte_eth_dev *dev;
+       int ret;
+
+       ret = i40e_aq_debug_read_register(hw, reg_addr, &ori_reg_val, NULL);
+       if (ret != I40E_SUCCESS) {
+               PMD_DRV_LOG(ERR,
+                           "Fail to debug read from 0x%08x",
+                           reg_addr);
+               return -EIO;
+       }
+       dev = ((struct i40e_adapter *)hw->back)->eth_dev;
+
+       if (ori_reg_val != reg_val)
+               PMD_DRV_LOG(WARNING,
+                           "i40e device %s changed global register [0x%08x]."
+                           " original: 0x%"PRIx64", after: 0x%"PRIx64,
+                           dev->device->name, reg_addr, ori_reg_val, reg_val);
+
+       return i40e_aq_debug_write_register(hw, reg_addr, reg_val, cmd_details);
+}
+
 static int
 eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused)
 {
@@ -1264,7 +1296,8 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused)
 
        /* initialise the L3_MAP register */
        if (!pf->support_multi_driver) {
-               ret = i40e_aq_debug_write_register(hw, I40E_GLQF_L3_MAP(40),
+               ret = i40e_aq_debug_write_global_register(hw,
+                                                  I40E_GLQF_L3_MAP(40),
                                                   0x00000028,  NULL);
                if (ret)
                        PMD_INIT_LOG(ERR, "Failed to write L3 MAP register %d",
@@ -1272,7 +1305,6 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused)
                PMD_INIT_LOG(DEBUG,
                             "Global register 0x%08x is changed with 0x28",
                             I40E_GLQF_L3_MAP(40));
-               i40e_global_cfg_warning(I40E_WARNING_QINQ_CLOUD_FILTER);
        }
 
        /* Need the special FW version to support floating VEB */
@@ -1559,7 +1591,6 @@ void i40e_flex_payload_reg_set_default(struct i40e_hw *hw)
        I40E_WRITE_GLB_REG(hw, I40E_GLQF_ORT(33), 0x00000000);
        I40E_WRITE_GLB_REG(hw, I40E_GLQF_ORT(34), 0x00000000);
        I40E_WRITE_GLB_REG(hw, I40E_GLQF_ORT(35), 0x00000000);
-       i40e_global_cfg_warning(I40E_WARNING_DIS_FLX_PLD);
 }
 
 static int
@@ -2038,8 +2069,8 @@ i40e_phy_conf_link(struct i40e_hw *hw,
 
 
 
-       /* To enable link, phy_type mask needs to include each type */
-       for (cnt = I40E_PHY_TYPE_SGMII; cnt < I40E_PHY_TYPE_MAX; cnt++)
+       /* PHY type mask needs to include each type except PHY type extension */
+       for (cnt = I40E_PHY_TYPE_SGMII; cnt < I40E_PHY_TYPE_25GBASE_KR; cnt++)
                phy_type_mask |= 1 << cnt;
 
        /* use get_phy_abilities_resp value for the rest */
@@ -2342,6 +2373,8 @@ i40e_dev_close(struct rte_eth_dev *dev)
        i40e_pf_disable_irq0(hw);
        rte_intr_disable(intr_handle);
 
+       i40e_fdir_teardown(pf);
+
        /* shutdown and destroy the HMC */
        i40e_shutdown_lan_hmc(hw);
 
@@ -2353,7 +2386,6 @@ i40e_dev_close(struct rte_eth_dev *dev)
        pf->vmdq = NULL;
 
        /* release all the existing VSIs and VEBs */
-       i40e_fdir_teardown(pf);
        i40e_vsi_release(pf->main_vsi);
 
        /* shutdown the adminq */
@@ -2494,7 +2526,7 @@ i40e_dev_set_link_down(struct rte_eth_dev *dev)
 }
 
 static __rte_always_inline void
-update_link_no_wait(struct i40e_hw *hw, struct rte_eth_link *link)
+update_link_reg(struct i40e_hw *hw, struct rte_eth_link *link)
 {
 /* Link status registers and values*/
 #define I40E_PRTMAC_LINKSTA            0x001E2420
@@ -2515,7 +2547,7 @@ update_link_no_wait(struct i40e_hw *hw, struct rte_eth_link *link)
        reg_val &= I40E_REG_LINK_UP;
        link->link_status = (reg_val == I40E_REG_LINK_UP) ? 1 : 0;
 
-       if (unlikely(link->link_status != 0))
+       if (unlikely(link->link_status == 0))
                return;
 
        /* Parse the link status */
@@ -2548,8 +2580,8 @@ update_link_no_wait(struct i40e_hw *hw, struct rte_eth_link *link)
 }
 
 static __rte_always_inline void
-update_link_wait(struct i40e_hw *hw, struct rte_eth_link *link,
-       bool enable_lse)
+update_link_aq(struct i40e_hw *hw, struct rte_eth_link *link,
+       bool enable_lse, int wait_to_complete)
 {
 #define CHECK_INTERVAL             100  /* 100ms */
 #define MAX_REPEAT_TIME            10  /* 1s (10 * 100ms) in total */
@@ -2573,8 +2605,8 @@ update_link_wait(struct i40e_hw *hw, struct rte_eth_link *link,
                }
 
                link->link_status = link_status.link_info & I40E_AQ_LINK_UP;
-               if (unlikely(link->link_status != 0))
-                       return;
+               if (!wait_to_complete || link->link_status)
+                       break;
 
                rte_delay_ms(CHECK_INTERVAL);
        } while (--rep_cnt);
@@ -2621,10 +2653,10 @@ i40e_dev_link_update(struct rte_eth_dev *dev,
        link.link_autoneg = !(dev->data->dev_conf.link_speeds &
                        ETH_LINK_SPEED_FIXED);
 
-       if (!wait_to_complete)
-               update_link_no_wait(hw, &link);
+       if (!wait_to_complete && !enable_lse)
+               update_link_reg(hw, &link);
        else
-               update_link_wait(hw, &link, enable_lse);
+               update_link_aq(hw, &link, enable_lse, wait_to_complete);
 
        ret = rte_eth_linkstatus_set(dev, &link);
        i40e_notify_all_vfs_link_status(dev);
@@ -3300,9 +3332,10 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
                DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
                DEV_RX_OFFLOAD_CRC_STRIP |
                DEV_RX_OFFLOAD_VLAN_EXTEND |
-               DEV_RX_OFFLOAD_VLAN_FILTER;
+               DEV_RX_OFFLOAD_VLAN_FILTER |
+               DEV_RX_OFFLOAD_JUMBO_FRAME;
 
-       dev_info->tx_queue_offload_capa = 0;
+       dev_info->tx_queue_offload_capa = DEV_TX_OFFLOAD_MBUF_FAST_FREE;
        dev_info->tx_offload_capa =
                DEV_TX_OFFLOAD_VLAN_INSERT |
                DEV_TX_OFFLOAD_QINQ_INSERT |
@@ -3315,7 +3348,9 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
                DEV_TX_OFFLOAD_VXLAN_TNL_TSO |
                DEV_TX_OFFLOAD_GRE_TNL_TSO |
                DEV_TX_OFFLOAD_IPIP_TNL_TSO |
-               DEV_TX_OFFLOAD_GENEVE_TNL_TSO;
+               DEV_TX_OFFLOAD_GENEVE_TNL_TSO |
+               DEV_TX_OFFLOAD_MULTI_SEGS |
+               dev_info->tx_queue_offload_capa;
        dev_info->dev_capa =
                RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP |
                RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP;
@@ -3344,8 +3379,7 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
                },
                .tx_free_thresh = I40E_DEFAULT_TX_FREE_THRESH,
                .tx_rs_thresh = I40E_DEFAULT_TX_RSBIT_THRESH,
-               .txq_flags = ETH_TXQ_FLAGS_NOMULTSEGS |
-                               ETH_TXQ_FLAGS_NOOFFLOADS,
+               .offloads = 0,
        };
 
        dev_info->rx_desc_lim = (struct rte_eth_desc_lim) {
@@ -3458,7 +3492,8 @@ i40e_vlan_tpid_set_by_registers(struct rte_eth_dev *dev,
                return 0;
        }
 
-       ret = i40e_aq_debug_write_register(hw, I40E_GL_SWT_L2TAGCTRL(reg_id),
+       ret = i40e_aq_debug_write_global_register(hw,
+                                          I40E_GL_SWT_L2TAGCTRL(reg_id),
                                           reg_w, NULL);
        if (ret != I40E_SUCCESS) {
                PMD_DRV_LOG(ERR,
@@ -3519,7 +3554,6 @@ i40e_vlan_tpid_set(struct rte_eth_dev *dev,
                /* If NVM API < 1.7, keep the register setting */
                ret = i40e_vlan_tpid_set_by_registers(dev, vlan_type,
                                                      tpid, qinq);
-       i40e_global_cfg_warning(I40E_WARNING_TPID);
 
        return ret;
 }
@@ -3765,7 +3799,6 @@ i40e_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
                I40E_WRITE_GLB_REG(hw, I40E_GLRPB_GLW,
                                   pf->fc_conf.low_water[I40E_MAX_TRAFFIC_CLASS]
                                   << I40E_KILOSHIFT);
-               i40e_global_cfg_warning(I40E_WARNING_FLOW_CTL);
        } else {
                PMD_DRV_LOG(ERR,
                            "Water marker configuration is not supported.");
@@ -7533,6 +7566,7 @@ i40e_status_code i40e_replace_mpls_l1_filter(struct i40e_pf *pf)
        struct i40e_aqc_replace_cloud_filters_cmd  filter_replace;
        struct i40e_aqc_replace_cloud_filters_cmd_buf  filter_replace_buf;
        struct i40e_hw *hw = I40E_PF_TO_HW(pf);
+       struct rte_eth_dev *dev = ((struct i40e_adapter *)hw->back)->eth_dev;
        enum i40e_status_code status = I40E_SUCCESS;
 
        if (pf->support_multi_driver) {
@@ -7576,13 +7610,14 @@ i40e_status_code i40e_replace_mpls_l1_filter(struct i40e_pf *pf)
 
        status = i40e_aq_replace_cloud_filters(hw, &filter_replace,
                                               &filter_replace_buf);
-       if (!status) {
-               i40e_global_cfg_warning(I40E_WARNING_RPL_CLD_FILTER);
-               PMD_DRV_LOG(DEBUG, "Global configuration modification: "
-                           "cloud l1 type is changed from 0x%x to 0x%x",
+       if (!status && (filter_replace.old_filter_type !=
+                       filter_replace.new_filter_type))
+               PMD_DRV_LOG(WARNING, "i40e device %s changed cloud l1 type."
+                           " original: 0x%x, new: 0x%x",
+                           dev->device->name,
                            filter_replace.old_filter_type,
                            filter_replace.new_filter_type);
-       }
+
        return status;
 }
 
@@ -7592,6 +7627,7 @@ i40e_status_code i40e_replace_mpls_cloud_filter(struct i40e_pf *pf)
        struct i40e_aqc_replace_cloud_filters_cmd  filter_replace;
        struct i40e_aqc_replace_cloud_filters_cmd_buf  filter_replace_buf;
        struct i40e_hw *hw = I40E_PF_TO_HW(pf);
+       struct rte_eth_dev *dev = ((struct i40e_adapter *)hw->back)->eth_dev;
        enum i40e_status_code status = I40E_SUCCESS;
 
        if (pf->support_multi_driver) {
@@ -7620,10 +7656,13 @@ i40e_status_code i40e_replace_mpls_cloud_filter(struct i40e_pf *pf)
                                               &filter_replace_buf);
        if (status < 0)
                return status;
-       PMD_DRV_LOG(DEBUG, "Global configuration modification: "
-                   "cloud filter type is changed from 0x%x to 0x%x",
-                   filter_replace.old_filter_type,
-                   filter_replace.new_filter_type);
+       if (filter_replace.old_filter_type !=
+           filter_replace.new_filter_type)
+               PMD_DRV_LOG(WARNING, "i40e device %s changed cloud filter type."
+                           " original: 0x%x, new: 0x%x",
+                           dev->device->name,
+                           filter_replace.old_filter_type,
+                           filter_replace.new_filter_type);
 
        /* For MPLSoGRE */
        memset(&filter_replace, 0,
@@ -7646,13 +7685,14 @@ i40e_status_code i40e_replace_mpls_cloud_filter(struct i40e_pf *pf)
 
        status = i40e_aq_replace_cloud_filters(hw, &filter_replace,
                                               &filter_replace_buf);
-       if (!status) {
-               i40e_global_cfg_warning(I40E_WARNING_RPL_CLD_FILTER);
-               PMD_DRV_LOG(DEBUG, "Global configuration modification: "
-                           "cloud filter type is changed from 0x%x to 0x%x",
+       if (!status && (filter_replace.old_filter_type !=
+                       filter_replace.new_filter_type))
+               PMD_DRV_LOG(WARNING, "i40e device %s changed cloud filter type."
+                           " original: 0x%x, new: 0x%x",
+                           dev->device->name,
                            filter_replace.old_filter_type,
                            filter_replace.new_filter_type);
-       }
+
        return status;
 }
 
@@ -7662,6 +7702,7 @@ i40e_replace_gtp_l1_filter(struct i40e_pf *pf)
        struct i40e_aqc_replace_cloud_filters_cmd  filter_replace;
        struct i40e_aqc_replace_cloud_filters_cmd_buf  filter_replace_buf;
        struct i40e_hw *hw = I40E_PF_TO_HW(pf);
+       struct rte_eth_dev *dev = ((struct i40e_adapter *)hw->back)->eth_dev;
        enum i40e_status_code status = I40E_SUCCESS;
 
        if (pf->support_multi_driver) {
@@ -7697,10 +7738,13 @@ i40e_replace_gtp_l1_filter(struct i40e_pf *pf)
                                               &filter_replace_buf);
        if (status < 0)
                return status;
-       PMD_DRV_LOG(DEBUG, "Global configuration modification: "
-                   "cloud l1 type is changed from 0x%x to 0x%x",
-                   filter_replace.old_filter_type,
-                   filter_replace.new_filter_type);
+       if (filter_replace.old_filter_type !=
+           filter_replace.new_filter_type)
+               PMD_DRV_LOG(WARNING, "i40e device %s changed cloud l1 type."
+                           " original: 0x%x, new: 0x%x",
+                           dev->device->name,
+                           filter_replace.old_filter_type,
+                           filter_replace.new_filter_type);
 
        /* for GTP-U */
        memset(&filter_replace, 0,
@@ -7729,13 +7773,14 @@ i40e_replace_gtp_l1_filter(struct i40e_pf *pf)
 
        status = i40e_aq_replace_cloud_filters(hw, &filter_replace,
                                               &filter_replace_buf);
-       if (!status) {
-               i40e_global_cfg_warning(I40E_WARNING_RPL_CLD_FILTER);
-               PMD_DRV_LOG(DEBUG, "Global configuration modification: "
-                           "cloud l1 type is changed from 0x%x to 0x%x",
+       if (!status && (filter_replace.old_filter_type !=
+                       filter_replace.new_filter_type))
+               PMD_DRV_LOG(WARNING, "i40e device %s changed cloud l1 type."
+                           " original: 0x%x, new: 0x%x",
+                           dev->device->name,
                            filter_replace.old_filter_type,
                            filter_replace.new_filter_type);
-       }
+
        return status;
 }
 
@@ -7745,6 +7790,7 @@ i40e_status_code i40e_replace_gtp_cloud_filter(struct i40e_pf *pf)
        struct i40e_aqc_replace_cloud_filters_cmd  filter_replace;
        struct i40e_aqc_replace_cloud_filters_cmd_buf  filter_replace_buf;
        struct i40e_hw *hw = I40E_PF_TO_HW(pf);
+       struct rte_eth_dev *dev = ((struct i40e_adapter *)hw->back)->eth_dev;
        enum i40e_status_code status = I40E_SUCCESS;
 
        if (pf->support_multi_driver) {
@@ -7772,10 +7818,13 @@ i40e_status_code i40e_replace_gtp_cloud_filter(struct i40e_pf *pf)
                                               &filter_replace_buf);
        if (status < 0)
                return status;
-       PMD_DRV_LOG(DEBUG, "Global configuration modification: "
-                   "cloud filter type is changed from 0x%x to 0x%x",
-                   filter_replace.old_filter_type,
-                   filter_replace.new_filter_type);
+       if (filter_replace.old_filter_type !=
+           filter_replace.new_filter_type)
+               PMD_DRV_LOG(WARNING, "i40e device %s changed cloud filter type."
+                           " original: 0x%x, new: 0x%x",
+                           dev->device->name,
+                           filter_replace.old_filter_type,
+                           filter_replace.new_filter_type);
 
        /* for GTP-U */
        memset(&filter_replace, 0,
@@ -7797,13 +7846,14 @@ i40e_status_code i40e_replace_gtp_cloud_filter(struct i40e_pf *pf)
 
        status = i40e_aq_replace_cloud_filters(hw, &filter_replace,
                                               &filter_replace_buf);
-       if (!status) {
-               i40e_global_cfg_warning(I40E_WARNING_RPL_CLD_FILTER);
-               PMD_DRV_LOG(DEBUG, "Global configuration modification: "
-                           "cloud filter type is changed from 0x%x to 0x%x",
+       if (!status && (filter_replace.old_filter_type !=
+                       filter_replace.new_filter_type))
+               PMD_DRV_LOG(WARNING, "i40e device %s changed cloud filter type."
+                           " original: 0x%x, new: 0x%x",
+                           dev->device->name,
                            filter_replace.old_filter_type,
                            filter_replace.new_filter_type);
-       }
+
        return status;
 }
 
@@ -8355,14 +8405,14 @@ i40e_dev_set_gre_key_len(struct i40e_hw *hw, uint8_t len)
        }
 
        if (reg != val) {
-               ret = i40e_aq_debug_write_register(hw, I40E_GL_PRS_FVBM(2),
+               ret = i40e_aq_debug_write_global_register(hw,
+                                                  I40E_GL_PRS_FVBM(2),
                                                   reg, NULL);
                if (ret != 0)
                        return ret;
                PMD_DRV_LOG(DEBUG, "Global register 0x%08x is changed "
                            "with value 0x%08x",
                            I40E_GL_PRS_FVBM(2), reg);
-               i40e_global_cfg_warning(I40E_WARNING_GRE_KEY_LEN);
        } else {
                ret = 0;
        }
@@ -8628,7 +8678,6 @@ i40e_set_hash_filter_global_config(struct i40e_hw *hw,
                                                          I40E_GLQF_HSYM(j),
                                                          reg);
                        }
-                       i40e_global_cfg_warning(I40E_WARNING_HSYM);
                }
        }
 
@@ -8654,7 +8703,6 @@ i40e_set_hash_filter_global_config(struct i40e_hw *hw,
                goto out;
 
        i40e_write_global_rx_ctl(hw, I40E_GLQF_CTL, reg);
-       i40e_global_cfg_warning(I40E_WARNING_QF_CTL);
 
 out:
        I40E_WRITE_FLUSH(hw);
@@ -9247,12 +9295,17 @@ void
 i40e_check_write_global_reg(struct i40e_hw *hw, uint32_t addr, uint32_t val)
 {
        uint32_t reg = i40e_read_rx_ctl(hw, addr);
+       struct rte_eth_dev *dev;
 
-       PMD_DRV_LOG(DEBUG, "[0x%08x] original: 0x%08x", addr, reg);
-       if (reg != val)
-               i40e_write_global_rx_ctl(hw, addr, val);
-       PMD_DRV_LOG(DEBUG, "[0x%08x] after: 0x%08x", addr,
-                   (uint32_t)i40e_read_rx_ctl(hw, addr));
+       dev = ((struct i40e_adapter *)hw->back)->eth_dev;
+       if (reg != val) {
+               i40e_write_rx_ctl(hw, addr, val);
+               PMD_DRV_LOG(WARNING,
+                           "i40e device %s changed global register [0x%08x]."
+                           " original: 0x%08x, new: 0x%08x",
+                           dev->device->name, addr, reg,
+                           (uint32_t)i40e_read_rx_ctl(hw, addr));
+       }
 }
 
 static void
@@ -9326,12 +9379,6 @@ i40e_filter_input_set_init(struct i40e_pf *pf)
                        pf->hash_input_set[pctype] = input_set;
                pf->fdir.input_set[pctype] = input_set;
        }
-
-       if (!pf->support_multi_driver) {
-               i40e_global_cfg_warning(I40E_WARNING_HASH_INSET);
-               i40e_global_cfg_warning(I40E_WARNING_FD_MSK);
-               i40e_global_cfg_warning(I40E_WARNING_HASH_MSK);
-       }
 }
 
 int
@@ -9397,7 +9444,6 @@ i40e_hash_filter_inset_select(struct i40e_hw *hw,
        i40e_check_write_global_reg(hw, I40E_GLQF_HASH_INSET(1, pctype),
                                    (uint32_t)((inset_reg >>
                                    I40E_32_BIT_WIDTH) & UINT32_MAX));
-       i40e_global_cfg_warning(I40E_WARNING_HASH_INSET);
 
        for (i = 0; i < num; i++)
                i40e_check_write_global_reg(hw, I40E_GLQF_HASH_MSK(i, pctype),
@@ -9406,7 +9452,6 @@ i40e_hash_filter_inset_select(struct i40e_hw *hw,
        for (i = num; i < I40E_INSET_MASK_NUM_REG; i++)
                i40e_check_write_global_reg(hw, I40E_GLQF_HASH_MSK(i, pctype),
                                            0);
-       i40e_global_cfg_warning(I40E_WARNING_HASH_MSK);
        I40E_WRITE_FLUSH(hw);
 
        pf->hash_input_set[pctype] = input_set;
@@ -9487,7 +9532,6 @@ i40e_fdir_filter_inset_select(struct i40e_pf *pf,
                        i40e_check_write_global_reg(hw,
                                                    I40E_GLQF_FD_MSK(i, pctype),
                                                    0);
-               i40e_global_cfg_warning(I40E_WARNING_FD_MSK);
        } else {
                PMD_DRV_LOG(ERR, "FDIR bit mask is not supported.");
        }
@@ -9970,6 +10014,60 @@ i40e_pctype_to_flowtype(const struct i40e_adapter *adapter,
 #define I40E_GL_SWR_PM_UP_THR_SF_VALUE   0x06060606
 #define I40E_GL_SWR_PM_UP_THR            0x269FBC
 
+/*
+ * GL_SWR_PM_UP_THR:
+ * The value is not impacted from the link speed, its value is set according
+ * to the total number of ports for a better pipe-monitor configuration.
+ */
+static bool
+i40e_get_swr_pm_cfg(struct i40e_hw *hw, uint32_t *value)
+{
+#define I40E_GL_SWR_PM_EF_DEVICE(dev) \
+               .device_id = (dev),   \
+               .val = I40E_GL_SWR_PM_UP_THR_EF_VALUE
+
+#define I40E_GL_SWR_PM_SF_DEVICE(dev) \
+               .device_id = (dev),   \
+               .val = I40E_GL_SWR_PM_UP_THR_SF_VALUE
+
+       static const struct {
+               uint16_t device_id;
+               uint32_t val;
+       } swr_pm_table[] = {
+               { I40E_GL_SWR_PM_EF_DEVICE(I40E_DEV_ID_SFP_XL710) },
+               { I40E_GL_SWR_PM_EF_DEVICE(I40E_DEV_ID_KX_C) },
+               { I40E_GL_SWR_PM_EF_DEVICE(I40E_DEV_ID_10G_BASE_T) },
+               { I40E_GL_SWR_PM_EF_DEVICE(I40E_DEV_ID_10G_BASE_T4) },
+
+               { I40E_GL_SWR_PM_SF_DEVICE(I40E_DEV_ID_KX_B) },
+               { I40E_GL_SWR_PM_SF_DEVICE(I40E_DEV_ID_QSFP_A) },
+               { I40E_GL_SWR_PM_SF_DEVICE(I40E_DEV_ID_QSFP_B) },
+               { I40E_GL_SWR_PM_SF_DEVICE(I40E_DEV_ID_20G_KR2) },
+               { I40E_GL_SWR_PM_SF_DEVICE(I40E_DEV_ID_20G_KR2_A) },
+               { I40E_GL_SWR_PM_SF_DEVICE(I40E_DEV_ID_25G_B) },
+               { I40E_GL_SWR_PM_SF_DEVICE(I40E_DEV_ID_25G_SFP28) },
+       };
+       uint32_t i;
+
+       if (value == NULL) {
+               PMD_DRV_LOG(ERR, "value is NULL");
+               return false;
+       }
+
+       for (i = 0; i < RTE_DIM(swr_pm_table); i++) {
+               if (hw->device_id == swr_pm_table[i].device_id) {
+                       *value = swr_pm_table[i].val;
+
+                       PMD_DRV_LOG(DEBUG, "Device 0x%x with GL_SWR_PM_UP_THR "
+                                   "value - 0x%08x",
+                                   hw->device_id, *value);
+                       return true;
+               }
+       }
+
+       return false;
+}
+
 static int
 i40e_dev_sync_phy_type(struct i40e_hw *hw)
 {
@@ -10034,13 +10132,16 @@ i40e_configure_registers(struct i40e_hw *hw)
                }
 
                if (reg_table[i].addr == I40E_GL_SWR_PM_UP_THR) {
-                       if (I40E_PHY_TYPE_SUPPORT_40G(hw->phy.phy_types) || /* For XL710 */
-                           I40E_PHY_TYPE_SUPPORT_25G(hw->phy.phy_types)) /* For XXV710 */
-                               reg_table[i].val =
-                                       I40E_GL_SWR_PM_UP_THR_SF_VALUE;
-                       else /* For X710 */
-                               reg_table[i].val =
-                                       I40E_GL_SWR_PM_UP_THR_EF_VALUE;
+                       uint32_t cfg_val;
+
+                       if (!i40e_get_swr_pm_cfg(hw, &cfg_val)) {
+                               PMD_DRV_LOG(DEBUG, "Device 0x%x skips "
+                                           "GL_SWR_PM_UP_THR value fixup",
+                                           hw->device_id);
+                               continue;
+                       }
+
+                       reg_table[i].val = cfg_val;
                }
 
                ret = i40e_aq_debug_read_register(hw, reg_table[i].addr,
@@ -12181,6 +12282,7 @@ i40e_cloud_filter_qinq_create(struct i40e_pf *pf)
        struct i40e_aqc_replace_cloud_filters_cmd  filter_replace;
        struct i40e_aqc_replace_cloud_filters_cmd_buf  filter_replace_buf;
        struct i40e_hw *hw = I40E_PF_TO_HW(pf);
+       struct rte_eth_dev *dev = ((struct i40e_adapter *)hw->back)->eth_dev;
 
        if (pf->support_multi_driver) {
                PMD_DRV_LOG(ERR, "Replace cloud filter is not supported.");
@@ -12217,10 +12319,14 @@ i40e_cloud_filter_qinq_create(struct i40e_pf *pf)
                        &filter_replace_buf);
        if (ret != I40E_SUCCESS)
                return ret;
-       PMD_DRV_LOG(DEBUG, "Global configuration modification: "
-                   "cloud l1 type is changed from 0x%x to 0x%x",
-                   filter_replace.old_filter_type,
-                   filter_replace.new_filter_type);
+
+       if (filter_replace.old_filter_type !=
+           filter_replace.new_filter_type)
+               PMD_DRV_LOG(WARNING, "i40e device %s changed cloud l1 type."
+                           " original: 0x%x, new: 0x%x",
+                           dev->device->name,
+                           filter_replace.old_filter_type,
+                           filter_replace.new_filter_type);
 
        /* Apply the second L2 cloud filter */
        memset(&filter_replace, 0,
@@ -12242,13 +12348,14 @@ i40e_cloud_filter_qinq_create(struct i40e_pf *pf)
                I40E_AQC_REPLACE_CLOUD_CMD_INPUT_VALIDATED;
        ret = i40e_aq_replace_cloud_filters(hw, &filter_replace,
                        &filter_replace_buf);
-       if (!ret) {
-               i40e_global_cfg_warning(I40E_WARNING_RPL_CLD_FILTER);
-               PMD_DRV_LOG(DEBUG, "Global configuration modification: "
-                           "cloud filter type is changed from 0x%x to 0x%x",
+       if (!ret && (filter_replace.old_filter_type !=
+                    filter_replace.new_filter_type))
+               PMD_DRV_LOG(WARNING, "i40e device %s changed cloud filter type."
+                           " original: 0x%x, new: 0x%x",
+                           dev->device->name,
                            filter_replace.old_filter_type,
                            filter_replace.new_filter_type);
-       }
+
        return ret;
 }