Public bug reported:

We have observed a very rare issue in Intel E810 environments where
SNMP-retrieved TX/RX counter values are sometimes nearly twice the
actual values.

Upon investigation, we identified a problem in the process that updates
the transmit and receive ring statistics in the ice driver. This issue
occurs when the counter update process is executed simultaneously on
different CPU cores.

We have attached a patch to fix this issue.

The function ice_update_vsi_ring_stats takes a pointer to a struct
ice_vsi as an argument. This structure is allocated on the heap and
shared across all CPU cores. The function resets the counter values to
zero and then accumulates the values from each ring of the NIC.

However, since struct ice_vsi is shared across all CPU cores, the following 
race condition can occur when ice_update_vsi_ring_stats is executed 
simultaneously on different CPUs:
        1.      Multiple CPU cores reset the counter values in struct ice_vsi 
to zero at the same time.
        2.      Each CPU core independently increments the counter values.

As a result, the counter values may be updated to a higher-than-actual
value.

The attached patch modifies the implementation to store the counter
values on the stack, initialize them to zero, increment them with the
values from each ring, and finally update struct ice_vsi. By avoiding
the use of shared data for intermediate calculations, this fix prevents
the issue.

** Affects: linux (Ubuntu)
     Importance: Undecided
         Status: New

** Patch added: "ice_update_vsi_ring_stats.patch"
   
https://bugs.launchpad.net/bugs/2098935/+attachment/5858965/+files/ice_update_vsi_ring_stats.patch

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2098935

Title:
  The ice driver may rarely return incorrect statistics counter values

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2098935/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to