Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [bug report] ice: split ice_ring onto Tx/Rx separate structs
Date: Tue, 16 Nov 2021 14:36:27 +0300	[thread overview]
Message-ID: <20211116113627.GA11394@kili> (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

                 reply	other threads:[~2021-11-16 11:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211116113627.GA11394@kili \
    --to=dan.carpenter@oracle.com \
    --cc=intel-wired-lan@osuosl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox