]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
dpaa2-eth: add software counter for Tx frames converted to S/G
authorIoana Ciornei <ioana.ciornei@nxp.com>
Mon, 29 Jun 2020 18:47:12 +0000 (21:47 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 30 Jun 2020 00:42:48 +0000 (17:42 -0700)
With the previous commit, in case of insufficient SKB headroom on the Tx
path instead of reallocing the SKB we now send a S/G frame descriptor.
Export the number of occurences of this case as a per CPU counter (in
debugfs) and a total number in the ethtool statistics - "tx converted sg
frames'.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-debugfs.c
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c

index 5cb357c74deca5a663adc2df6d9e8b965e6abef9..56d9927fbfda0f661aa27eebf33102c53d95af3e 100644 (file)
@@ -19,14 +19,14 @@ static int dpaa2_dbg_cpu_show(struct seq_file *file, void *offset)
        int i;
 
        seq_printf(file, "Per-CPU stats for %s\n", priv->net_dev->name);
-       seq_printf(file, "%s%16s%16s%16s%16s%16s%16s%16s%16s\n",
+       seq_printf(file, "%s%16s%16s%16s%16s%16s%16s%16s%16s%16s\n",
                   "CPU", "Rx", "Rx Err", "Rx SG", "Tx", "Tx Err", "Tx conf",
-                  "Tx SG", "Enq busy");
+                  "Tx SG", "Tx converted to SG", "Enq busy");
 
        for_each_online_cpu(i) {
                stats = per_cpu_ptr(priv->percpu_stats, i);
                extras = per_cpu_ptr(priv->percpu_extras, i);
-               seq_printf(file, "%3d%16llu%16llu%16llu%16llu%16llu%16llu%16llu%16llu\n",
+               seq_printf(file, "%3d%16llu%16llu%16llu%16llu%16llu%16llu%16llu%16llu%16llu\n",
                           i,
                           stats->rx_packets,
                           stats->rx_errors,
@@ -35,6 +35,7 @@ static int dpaa2_dbg_cpu_show(struct seq_file *file, void *offset)
                           stats->tx_errors,
                           extras->tx_conf_frames,
                           extras->tx_sg_frames,
+                          extras->tx_converted_sg_frames,
                           extras->tx_portal_busy);
        }
 
index 4a264b75c0352d604dea15c6d1fd634752cde255..bc1f1e0117b6e05134e32303988ae318d419ef87 100644 (file)
@@ -960,6 +960,8 @@ static netdev_tx_t dpaa2_eth_tx(struct sk_buff *skb, struct net_device *net_dev)
                err = build_sg_fd_single_buf(priv, skb, &fd);
                percpu_extras->tx_sg_frames++;
                percpu_extras->tx_sg_bytes += skb->len;
+               percpu_extras->tx_converted_sg_frames++;
+               percpu_extras->tx_converted_sg_bytes += skb->len;
        } else {
                err = build_single_fd(priv, skb, &fd);
        }
index 9e4ceb92f2406dda056fed25dfca9a8f0dc98aa1..9138a35a68f9a67eaf8bb79840135c998d4f43df 100644 (file)
@@ -285,6 +285,9 @@ struct dpaa2_eth_drv_stats {
        __u64   tx_sg_bytes;
        __u64   rx_sg_frames;
        __u64   rx_sg_bytes;
+       /* Linear skbs sent as a S/G FD due to insufficient headroom */
+       __u64   tx_converted_sg_frames;
+       __u64   tx_converted_sg_bytes;
        /* Enqueues retried due to portal busy */
        __u64   tx_portal_busy;
 };
index c4cbbcaa9a3fab22c76dc7b8dd9134d59d467dd3..8356f1fbbee1251142deb51cc25fd40f0574abb2 100644 (file)
@@ -45,6 +45,8 @@ static char dpaa2_ethtool_extras[][ETH_GSTRING_LEN] = {
        "[drv] tx sg bytes",
        "[drv] rx sg frames",
        "[drv] rx sg bytes",
+       "[drv] tx converted sg frames",
+       "[drv] tx converted sg bytes",
        "[drv] enqueue portal busy",
        /* Channel stats */
        "[drv] dequeue portal busy",