* [PATCH net-next v2 1/3] i40e: add xdp ring statistics to vsi stats
@ 2020-06-23 13:06 Ciara Loftus
2020-06-23 13:06 ` [PATCH net-next v2 2/3] i40e: add xdp ring statistics to dump vsi debug output Ciara Loftus
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Ciara Loftus @ 2020-06-23 13:06 UTC (permalink / raw)
To: intel-wired-lan; +Cc: netdev, magnus.karlsson, Ciara Loftus
Prior to this, only rx and tx ring statistics were accounted for.
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 5d807c8004f8..13aef0e51c24 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -811,6 +811,25 @@ static void i40e_update_vsi_stats(struct i40e_vsi *vsi)
rx_p += packets;
rx_buf += p->rx_stats.alloc_buff_failed;
rx_page += p->rx_stats.alloc_page_failed;
+
+ if (i40e_enabled_xdp_vsi(vsi)) {
+ /* locate xdp ring */
+ p = READ_ONCE(vsi->xdp_rings[q]);
+ if (!p)
+ continue;
+
+ do {
+ start = u64_stats_fetch_begin_irq(&p->syncp);
+ packets = p->stats.packets;
+ bytes = p->stats.bytes;
+ } while (u64_stats_fetch_retry_irq(&p->syncp, start));
+ tx_b += bytes;
+ tx_p += packets;
+ tx_restart += p->tx_stats.restart_queue;
+ tx_busy += p->tx_stats.tx_busy;
+ tx_linearize += p->tx_stats.tx_linearize;
+ tx_force_wb += p->tx_stats.tx_force_wb;
+ }
}
rcu_read_unlock();
vsi->tx_restart = tx_restart;
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net-next v2 2/3] i40e: add xdp ring statistics to dump vsi debug output
2020-06-23 13:06 [PATCH net-next v2 1/3] i40e: add xdp ring statistics to vsi stats Ciara Loftus
@ 2020-06-23 13:06 ` Ciara Loftus
2020-06-25 17:01 ` [Intel-wired-lan] " Bowers, AndrewX
2020-06-23 13:06 ` [PATCH net-next v2 3/3] i40e: introduce new dump desc xdp command Ciara Loftus
2020-06-25 17:01 ` [Intel-wired-lan] [PATCH net-next v2 1/3] i40e: add xdp ring statistics to vsi stats Bowers, AndrewX
2 siblings, 1 reply; 6+ messages in thread
From: Ciara Loftus @ 2020-06-23 13:06 UTC (permalink / raw)
To: intel-wired-lan; +Cc: netdev, magnus.karlsson, Ciara Loftus
Prior to this, only the rx and tx ring statistics were dumped. The xdp
ring statistics are now dumped as well.
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
---
.../net/ethernet/intel/i40e/i40e_debugfs.c | 41 +++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
index 99ea543dd245..1c8285fce33f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
@@ -319,6 +319,47 @@ static void i40e_dbg_dump_vsi_seid(struct i40e_pf *pf, int seid)
i, tx_ring->itr_setting,
ITR_IS_DYNAMIC(tx_ring->itr_setting) ? "dynamic" : "fixed");
}
+ if (i40e_enabled_xdp_vsi(vsi)) {
+ for (i = 0; i < vsi->num_queue_pairs; i++) {
+ struct i40e_ring *xdp_ring = READ_ONCE(vsi->xdp_rings[i]);
+
+ if (!xdp_ring)
+ continue;
+
+ dev_info(&pf->pdev->dev,
+ " xdp_rings[%i]: state = %lu, queue_index = %d, reg_idx = %d\n",
+ i, *xdp_ring->state,
+ xdp_ring->queue_index,
+ xdp_ring->reg_idx);
+ dev_info(&pf->pdev->dev,
+ " xdp_rings[%i]: next_to_use = %d, next_to_clean = %d, ring_active = %i\n",
+ i,
+ xdp_ring->next_to_use,
+ xdp_ring->next_to_clean,
+ xdp_ring->ring_active);
+ dev_info(&pf->pdev->dev,
+ " xdp_rings[%i]: tx_stats: packets = %lld, bytes = %lld, restart_queue = %lld\n",
+ i, xdp_ring->stats.packets,
+ xdp_ring->stats.bytes,
+ xdp_ring->tx_stats.restart_queue);
+ dev_info(&pf->pdev->dev,
+ " xdp_rings[%i]: tx_stats: tx_busy = %lld, tx_done_old = %lld\n",
+ i,
+ xdp_ring->tx_stats.tx_busy,
+ xdp_ring->tx_stats.tx_done_old);
+ dev_info(&pf->pdev->dev,
+ " xdp_rings[%i]: size = %i\n",
+ i, xdp_ring->size);
+ dev_info(&pf->pdev->dev,
+ " xdp_rings[%i]: DCB tc = %d\n",
+ i, xdp_ring->dcb_tc);
+ dev_info(&pf->pdev->dev,
+ " xdp_rings[%i]: itr_setting = %d (%s)\n",
+ i, xdp_ring->itr_setting,
+ ITR_IS_DYNAMIC(xdp_ring->itr_setting) ?
+ "dynamic" : "fixed");
+ }
+ }
rcu_read_unlock();
dev_info(&pf->pdev->dev,
" work_limit = %d\n",
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net-next v2 3/3] i40e: introduce new dump desc xdp command
2020-06-23 13:06 [PATCH net-next v2 1/3] i40e: add xdp ring statistics to vsi stats Ciara Loftus
2020-06-23 13:06 ` [PATCH net-next v2 2/3] i40e: add xdp ring statistics to dump vsi debug output Ciara Loftus
@ 2020-06-23 13:06 ` Ciara Loftus
2020-06-25 17:02 ` [Intel-wired-lan] " Bowers, AndrewX
2020-06-25 17:01 ` [Intel-wired-lan] [PATCH net-next v2 1/3] i40e: add xdp ring statistics to vsi stats Bowers, AndrewX
2 siblings, 1 reply; 6+ messages in thread
From: Ciara Loftus @ 2020-06-23 13:06 UTC (permalink / raw)
To: intel-wired-lan; +Cc: netdev, magnus.karlsson, Ciara Loftus
Interfaces already exist for dumping rx and tx descriptor information.
Introduce another for doing the same for xdp descriptors.
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
---
v1 -> v2:
- Fix variable name in description of dump_desc function
.../net/ethernet/intel/i40e/i40e_debugfs.c | 59 +++++++++++++++----
1 file changed, 48 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
index 1c8285fce33f..0afae8e5a3cc 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
@@ -10,6 +10,12 @@
static struct dentry *i40e_dbg_root;
+enum ring_type {
+ RING_TYPE_RX,
+ RING_TYPE_TX,
+ RING_TYPE_XDP
+};
+
/**
* i40e_dbg_find_vsi - searches for the vsi with the given seid
* @pf: the PF structure to search for the vsi
@@ -530,11 +536,12 @@ static void i40e_dbg_dump_aq_desc(struct i40e_pf *pf)
* @ring_id: ring id entered by user
* @desc_n: descriptor number entered by user
* @pf: the i40e_pf created in command write
- * @is_rx_ring: true if rx, false if tx
+ * @type: enum describing whether ring is RX, TX or XDP
**/
static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n,
- struct i40e_pf *pf, bool is_rx_ring)
+ struct i40e_pf *pf, enum ring_type type)
{
+ bool is_rx_ring = type == RING_TYPE_RX;
struct i40e_tx_desc *txd;
union i40e_rx_desc *rxd;
struct i40e_ring *ring;
@@ -546,6 +553,10 @@ static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n,
dev_info(&pf->pdev->dev, "vsi %d not found\n", vsi_seid);
return;
}
+ if (type == RING_TYPE_XDP && !i40e_enabled_xdp_vsi(vsi)) {
+ dev_info(&pf->pdev->dev, "xdp not enabled on vsi %d\n", vsi_seid);
+ return;
+ }
if (ring_id >= vsi->num_queue_pairs || ring_id < 0) {
dev_info(&pf->pdev->dev, "ring %d not found\n", ring_id);
return;
@@ -557,15 +568,32 @@ static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n,
return;
}
- ring = kmemdup(is_rx_ring
- ? vsi->rx_rings[ring_id] : vsi->tx_rings[ring_id],
- sizeof(*ring), GFP_KERNEL);
+ switch (type) {
+ case RING_TYPE_RX:
+ ring = kmemdup(vsi->rx_rings[ring_id], sizeof(*ring), GFP_KERNEL);
+ break;
+ case RING_TYPE_TX:
+ ring = kmemdup(vsi->tx_rings[ring_id], sizeof(*ring), GFP_KERNEL);
+ break;
+ case RING_TYPE_XDP:
+ ring = kmemdup(vsi->xdp_rings[ring_id], sizeof(*ring), GFP_KERNEL);
+ break;
+ }
if (!ring)
return;
if (cnt == 2) {
- dev_info(&pf->pdev->dev, "vsi = %02i %s ring = %02i\n",
- vsi_seid, is_rx_ring ? "rx" : "tx", ring_id);
+ switch (type) {
+ case RING_TYPE_RX:
+ dev_info(&pf->pdev->dev, "vsi = %02i rx ring = %02i\n", vsi_seid, ring_id);
+ break;
+ case RING_TYPE_TX:
+ dev_info(&pf->pdev->dev, "vsi = %02i tx ring = %02i\n", vsi_seid, ring_id);
+ break;
+ case RING_TYPE_XDP:
+ dev_info(&pf->pdev->dev, "vsi = %02i xdp ring = %02i\n", vsi_seid, ring_id);
+ break;
+ }
for (i = 0; i < ring->count; i++) {
if (!is_rx_ring) {
txd = I40E_TX_DESC(ring, i);
@@ -603,7 +631,7 @@ static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n,
rxd->read.rsvd1, rxd->read.rsvd2);
}
} else {
- dev_info(&pf->pdev->dev, "dump desc rx/tx <vsi_seid> <ring_id> [<desc_n>]\n");
+ dev_info(&pf->pdev->dev, "dump desc rx/tx/xdp <vsi_seid> <ring_id> [<desc_n>]\n");
}
out:
@@ -961,13 +989,19 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
cnt = sscanf(&cmd_buf[12], "%i %i %i",
&vsi_seid, &ring_id, &desc_n);
i40e_dbg_dump_desc(cnt, vsi_seid, ring_id,
- desc_n, pf, true);
+ desc_n, pf, RING_TYPE_RX);
} else if (strncmp(&cmd_buf[10], "tx", 2)
== 0) {
cnt = sscanf(&cmd_buf[12], "%i %i %i",
&vsi_seid, &ring_id, &desc_n);
i40e_dbg_dump_desc(cnt, vsi_seid, ring_id,
- desc_n, pf, false);
+ desc_n, pf, RING_TYPE_TX);
+ } else if (strncmp(&cmd_buf[10], "xdp", 3)
+ == 0) {
+ cnt = sscanf(&cmd_buf[13], "%i %i %i",
+ &vsi_seid, &ring_id, &desc_n);
+ i40e_dbg_dump_desc(cnt, vsi_seid, ring_id,
+ desc_n, pf, RING_TYPE_XDP);
} else if (strncmp(&cmd_buf[10], "aq", 2) == 0) {
i40e_dbg_dump_aq_desc(pf);
} else {
@@ -975,6 +1009,8 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
"dump desc tx <vsi_seid> <ring_id> [<desc_n>]\n");
dev_info(&pf->pdev->dev,
"dump desc rx <vsi_seid> <ring_id> [<desc_n>]\n");
+ dev_info(&pf->pdev->dev,
+ "dump desc xdp <vsi_seid> <ring_id> [<desc_n>]\n");
dev_info(&pf->pdev->dev, "dump desc aq\n");
}
} else if (strncmp(&cmd_buf[5], "reset stats", 11) == 0) {
@@ -1145,7 +1181,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
buff = NULL;
} else {
dev_info(&pf->pdev->dev,
- "dump desc tx <vsi_seid> <ring_id> [<desc_n>], dump desc rx <vsi_seid> <ring_id> [<desc_n>],\n");
+ "dump desc tx <vsi_seid> <ring_id> [<desc_n>], dump desc rx <vsi_seid> <ring_id> [<desc_n>], dump desc xdp <vsi_seid> <ring_id> [<desc_n>],\n");
dev_info(&pf->pdev->dev, "dump switch\n");
dev_info(&pf->pdev->dev, "dump vsi [seid]\n");
dev_info(&pf->pdev->dev, "dump reset stats\n");
@@ -1561,6 +1597,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
dev_info(&pf->pdev->dev, " dump vsi [seid]\n");
dev_info(&pf->pdev->dev, " dump desc tx <vsi_seid> <ring_id> [<desc_n>]\n");
dev_info(&pf->pdev->dev, " dump desc rx <vsi_seid> <ring_id> [<desc_n>]\n");
+ dev_info(&pf->pdev->dev, " dump desc xdp <vsi_seid> <ring_id> [<desc_n>]\n");
dev_info(&pf->pdev->dev, " dump desc aq\n");
dev_info(&pf->pdev->dev, " dump reset stats\n");
dev_info(&pf->pdev->dev, " dump debug fwdata <cluster_id> <table_id> <index>\n");
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* RE: [Intel-wired-lan] [PATCH net-next v2 1/3] i40e: add xdp ring statistics to vsi stats
2020-06-23 13:06 [PATCH net-next v2 1/3] i40e: add xdp ring statistics to vsi stats Ciara Loftus
2020-06-23 13:06 ` [PATCH net-next v2 2/3] i40e: add xdp ring statistics to dump vsi debug output Ciara Loftus
2020-06-23 13:06 ` [PATCH net-next v2 3/3] i40e: introduce new dump desc xdp command Ciara Loftus
@ 2020-06-25 17:01 ` Bowers, AndrewX
2 siblings, 0 replies; 6+ messages in thread
From: Bowers, AndrewX @ 2020-06-25 17:01 UTC (permalink / raw)
To: intel-wired-lan; +Cc: netdev
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Ciara Loftus
> Sent: Tuesday, June 23, 2020 6:07 AM
> To: intel-wired-lan@lists.osuosl.org
> Cc: netdev@vger.kernel.org; Karlsson, Magnus
> <magnus.karlsson@intel.com>
> Subject: [Intel-wired-lan] [PATCH net-next v2 1/3] i40e: add xdp ring statistics
> to vsi stats
>
> Prior to this, only rx and tx ring statistics were accounted for.
>
> Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
> ---
> drivers/net/ethernet/intel/i40e/i40e_main.c | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [Intel-wired-lan] [PATCH net-next v2 2/3] i40e: add xdp ring statistics to dump vsi debug output
2020-06-23 13:06 ` [PATCH net-next v2 2/3] i40e: add xdp ring statistics to dump vsi debug output Ciara Loftus
@ 2020-06-25 17:01 ` Bowers, AndrewX
0 siblings, 0 replies; 6+ messages in thread
From: Bowers, AndrewX @ 2020-06-25 17:01 UTC (permalink / raw)
To: intel-wired-lan; +Cc: netdev
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Ciara Loftus
> Sent: Tuesday, June 23, 2020 6:07 AM
> To: intel-wired-lan@lists.osuosl.org
> Cc: netdev@vger.kernel.org; Karlsson, Magnus
> <magnus.karlsson@intel.com>
> Subject: [Intel-wired-lan] [PATCH net-next v2 2/3] i40e: add xdp ring statistics
> to dump vsi debug output
>
> Prior to this, only the rx and tx ring statistics were dumped. The xdp ring
> statistics are now dumped as well.
>
> Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
> ---
> .../net/ethernet/intel/i40e/i40e_debugfs.c | 41 +++++++++++++++++++
> 1 file changed, 41 insertions(+)
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [Intel-wired-lan] [PATCH net-next v2 3/3] i40e: introduce new dump desc xdp command
2020-06-23 13:06 ` [PATCH net-next v2 3/3] i40e: introduce new dump desc xdp command Ciara Loftus
@ 2020-06-25 17:02 ` Bowers, AndrewX
0 siblings, 0 replies; 6+ messages in thread
From: Bowers, AndrewX @ 2020-06-25 17:02 UTC (permalink / raw)
To: intel-wired-lan; +Cc: netdev
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Ciara Loftus
> Sent: Tuesday, June 23, 2020 6:07 AM
> To: intel-wired-lan@lists.osuosl.org
> Cc: netdev@vger.kernel.org; Karlsson, Magnus
> <magnus.karlsson@intel.com>
> Subject: [Intel-wired-lan] [PATCH net-next v2 3/3] i40e: introduce new dump
> desc xdp command
>
> Interfaces already exist for dumping rx and tx descriptor information.
> Introduce another for doing the same for xdp descriptors.
>
> Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
> ---
> v1 -> v2:
> - Fix variable name in description of dump_desc function
>
> .../net/ethernet/intel/i40e/i40e_debugfs.c | 59 +++++++++++++++----
> 1 file changed, 48 insertions(+), 11 deletions(-)
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-06-25 17:02 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-23 13:06 [PATCH net-next v2 1/3] i40e: add xdp ring statistics to vsi stats Ciara Loftus
2020-06-23 13:06 ` [PATCH net-next v2 2/3] i40e: add xdp ring statistics to dump vsi debug output Ciara Loftus
2020-06-25 17:01 ` [Intel-wired-lan] " Bowers, AndrewX
2020-06-23 13:06 ` [PATCH net-next v2 3/3] i40e: introduce new dump desc xdp command Ciara Loftus
2020-06-25 17:02 ` [Intel-wired-lan] " Bowers, AndrewX
2020-06-25 17:01 ` [Intel-wired-lan] [PATCH net-next v2 1/3] i40e: add xdp ring statistics to vsi stats Bowers, AndrewX
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).