Skip to contentSkip to conversation

ice: split ice_ring onto Tx/Rx separate structs

Intel-wired-lan Dan Carpenter 1 participant 1 message Nov 16, 2021

lore
Share & tools
lore
#0 lore raw

Hello Maciej Fijalkowski,

This is a semi-automatic email about new static checker warnings.

The patch e72bba21355d: "ice: split ice_ring onto Tx/Rx separate structs" from Aug 19, 2021, leads to the following Smatch complaint:

drivers/net/ethernet/intel/ice/ice_main.c:5933 ice_update_vsi_tx_ring_stats()
error: we previously assumed 'ring' could be null (see line 5929)

drivers/net/ethernet/intel/ice/ice_main.c
5928 ring = READ_ONCE(rings[i]);
5929 if (ring)

                            ^^^^

The patch adds a new check for NULL but presumably it can be removed

  5930				ice_fetch_u64_stats_per_ring(&ring->syncp, ring->stats, &pkts, &bytes);
  5931			vsi_stats->tx_packets += pkts;
  5932			vsi_stats->tx_bytes += bytes;
  5933			vsi->tx_restart += ring->tx_stats.restart_q;
                                           ^^^^^^^^^^^^^^^^^^^^^^^^
  5934			vsi->tx_busy += ring->tx_stats.tx_busy;
                                        ^^^^^^^^^^^^^^^^^^^^^^
  5935			vsi->tx_linearize += ring->tx_stats.tx_linearize;
                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^

Because the previous code didn' check

regards,
dan carpenter