Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net...
authorDavid S. Miller <davem@davemloft.net>
Wed, 17 May 2023 08:19:23 +0000 (09:19 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 17 May 2023 08:19:23 +0000 (09:19 +0100)
Tony nguyen says:

====================
Intel Wired LAN Driver Updates 2023-05-16

This series contains updates to ice and iavf drivers.

Ahmed adds setting of missed condition for statistics which caused
incorrect reporting of values for ice. For iavf, he removes a call to set
VLAN offloads during re-initialization which can cause incorrect values
to be set.

Dawid adds checks to ensure VF is ready to be reset before executing
commands that will require it to be reset on ice.
---
v2:
Patch 2
- Redo commit message
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
drivers/net/ethernet/intel/ice/ice_lib.c
drivers/net/ethernet/intel/ice/ice_sriov.c
drivers/net/ethernet/intel/ice/ice_vf_lib.c
drivers/net/ethernet/intel/ice/ice_vf_lib.h
drivers/net/ethernet/intel/ice/ice_virtchnl.c

index 9afbbdac35903f1ae018c00fe28213ece3227d3f..7c0578b5457b96bd9d4b4f53a19f64cb4ca8560b 100644 (file)
@@ -2238,11 +2238,6 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,
                iavf_process_config(adapter);
                adapter->flags |= IAVF_FLAG_SETUP_NETDEV_FEATURES;
 
-               /* Request VLAN offload settings */
-               if (VLAN_V2_ALLOWED(adapter))
-                       iavf_set_vlan_offload_features(adapter, 0,
-                                                      netdev->features);
-
                iavf_set_queue_vlan_tag_loc(adapter);
 
                was_mac_changed = !ether_addr_equal(netdev->dev_addr,
index 450317dfcca7360cb1acdfca470bd4295d11e3db..11ae0e41f518a13b1c77c56a15404338495b746a 100644 (file)
@@ -2745,6 +2745,8 @@ ice_vsi_cfg_def(struct ice_vsi *vsi, struct ice_vsi_cfg_params *params)
                        goto unroll_vector_base;
 
                ice_vsi_map_rings_to_vectors(vsi);
+               vsi->stat_offsets_loaded = false;
+
                if (ice_is_xdp_ena_vsi(vsi)) {
                        ret = ice_vsi_determine_xdp_res(vsi);
                        if (ret)
@@ -2793,6 +2795,9 @@ ice_vsi_cfg_def(struct ice_vsi *vsi, struct ice_vsi_cfg_params *params)
                ret = ice_vsi_alloc_ring_stats(vsi);
                if (ret)
                        goto unroll_vector_base;
+
+               vsi->stat_offsets_loaded = false;
+
                /* Do not exit if configuring RSS had an issue, at least
                 * receive traffic on first queue. Hence no need to capture
                 * return value
index f1dca59bd8449ea91706451c3226fe4ff912cc40..588ad8696756defb6154022fe4fc9b7c75eed366 100644 (file)
@@ -1171,7 +1171,7 @@ int ice_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool ena)
        if (!vf)
                return -EINVAL;
 
-       ret = ice_check_vf_ready_for_cfg(vf);
+       ret = ice_check_vf_ready_for_reset(vf);
        if (ret)
                goto out_put_vf;
 
@@ -1286,7 +1286,7 @@ int ice_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
                goto out_put_vf;
        }
 
-       ret = ice_check_vf_ready_for_cfg(vf);
+       ret = ice_check_vf_ready_for_reset(vf);
        if (ret)
                goto out_put_vf;
 
@@ -1340,7 +1340,7 @@ int ice_set_vf_trust(struct net_device *netdev, int vf_id, bool trusted)
                return -EOPNOTSUPP;
        }
 
-       ret = ice_check_vf_ready_for_cfg(vf);
+       ret = ice_check_vf_ready_for_reset(vf);
        if (ret)
                goto out_put_vf;
 
@@ -1653,7 +1653,7 @@ ice_set_vf_port_vlan(struct net_device *netdev, int vf_id, u16 vlan_id, u8 qos,
        if (!vf)
                return -EINVAL;
 
-       ret = ice_check_vf_ready_for_cfg(vf);
+       ret = ice_check_vf_ready_for_reset(vf);
        if (ret)
                goto out_put_vf;
 
index 89fd6982df0934b53b27a538856bdc7b3c30c75b..bf74a2f3a4f8c3d8ebf5a1492782ec06c79b3ddd 100644 (file)
@@ -185,6 +185,25 @@ int ice_check_vf_ready_for_cfg(struct ice_vf *vf)
        return 0;
 }
 
+/**
+ * ice_check_vf_ready_for_reset - check if VF is ready to be reset
+ * @vf: VF to check if it's ready to be reset
+ *
+ * The purpose of this function is to ensure that the VF is not in reset,
+ * disabled, and is both initialized and active, thus enabling us to safely
+ * initialize another reset.
+ */
+int ice_check_vf_ready_for_reset(struct ice_vf *vf)
+{
+       int ret;
+
+       ret = ice_check_vf_ready_for_cfg(vf);
+       if (!ret && !test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states))
+               ret = -EAGAIN;
+
+       return ret;
+}
+
 /**
  * ice_trigger_vf_reset - Reset a VF on HW
  * @vf: pointer to the VF structure
index e3cda6fb71ab1e61221557abb0692ad9c1b19d14..a38ef00a367942b52f45c8b9d87abe4d95f52fef 100644 (file)
@@ -215,6 +215,7 @@ u16 ice_get_num_vfs(struct ice_pf *pf);
 struct ice_vsi *ice_get_vf_vsi(struct ice_vf *vf);
 bool ice_is_vf_disabled(struct ice_vf *vf);
 int ice_check_vf_ready_for_cfg(struct ice_vf *vf);
+int ice_check_vf_ready_for_reset(struct ice_vf *vf);
 void ice_set_vf_state_dis(struct ice_vf *vf);
 bool ice_is_any_vf_in_unicast_promisc(struct ice_pf *pf);
 void
index 97243c616d5d6d939196fcca9b4ea04724dbbf0a..f4a524f80b110f1dc3d60d706eedb31a20740000 100644 (file)
@@ -3955,6 +3955,7 @@ error_handler:
                ice_vc_notify_vf_link_state(vf);
                break;
        case VIRTCHNL_OP_RESET_VF:
+               clear_bit(ICE_VF_STATE_ACTIVE, vf->vf_states);
                ops->reset_vf(vf);
                break;
        case VIRTCHNL_OP_ADD_ETH_ADDR: