net: ipa: stop counting total RX bytes and transactions
authorAlex Elder <elder@linaro.org>
Mon, 13 Jun 2022 17:17:58 +0000 (12:17 -0500)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Jun 2022 08:07:58 +0000 (09:07 +0100)
In gsi_evt_ring_rx_update(), we update each transaction so its len
field reflects the actual number of bytes received.  In the process,
the total number of transactions and bytes processed on the channel
are summed, and added to a running total for the channel.

But we don't actually use those running totals for RX endpoints.
They're maintained for TX channels to support CoDel when they are
associated with a "real" network device.

So stop maintaining these totals for RX endpoints, and update the
comment where the fields are defined to make it clear they're only
valid for TX channels.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipa/gsi.c
drivers/net/ipa/gsi.h

index 4f8187c..c2cafd9 100644 (file)
@@ -1374,8 +1374,6 @@ static void gsi_evt_ring_rx_update(struct gsi_evt_ring *evt_ring, u32 index)
        struct gsi_event *event_done;
        struct gsi_event *event;
        struct gsi_trans *trans;
-       u32 trans_count = 0;
-       u32 byte_count = 0;
        u32 event_avail;
        u32 old_index;
 
@@ -1399,8 +1397,6 @@ static void gsi_evt_ring_rx_update(struct gsi_evt_ring *evt_ring, u32 index)
        event_done = gsi_ring_virt(ring, index);
        do {
                trans->len = __le16_to_cpu(event->len);
-               byte_count += trans->len;
-               trans_count++;
 
                /* Move on to the next event and transaction */
                if (--event_avail)
@@ -1409,10 +1405,6 @@ static void gsi_evt_ring_rx_update(struct gsi_evt_ring *evt_ring, u32 index)
                        event = gsi_ring_virt(ring, 0);
                trans = gsi_trans_pool_next(&trans_info->pool, trans);
        } while (event != event_done);
-
-       /* We record RX bytes when they are received */
-       channel->byte_count += byte_count;
-       channel->trans_count += trans_count;
 }
 
 /* Initialize a ring, including allocating DMA memory for its entries */
index 89dac7f..bad1a78 100644 (file)
@@ -117,9 +117,9 @@ struct gsi_channel {
        struct gsi_ring tre_ring;
        u32 evt_ring_id;
 
+       /* The following counts are used only for TX endpoints */
        u64 byte_count;                 /* total # bytes transferred */
        u64 trans_count;                /* total # transactions */
-       /* The following counts are used only for TX endpoints */
        u64 queued_byte_count;          /* last reported queued byte count */
        u64 queued_trans_count;         /* ...and queued trans count */
        u64 compl_byte_count;           /* last reported completed byte count */