Commit 2fc3d715 authored by Anjali Singhai Jain's avatar Anjali Singhai Jain Committed by Jeff Kirsher

i40e/i40evf: Add a stat to keep track of linearization count

Keep track of how many times we ask the stack to linearize the
skb because the HW cannot handle skbs with more than 8 frags per
segment/single packet.

Change-ID: If455452060963a769bbe6112cba952e79e944b52
Signed-off-by: default avatarAnjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 2f41f335
...@@ -475,6 +475,7 @@ struct i40e_vsi { ...@@ -475,6 +475,7 @@ struct i40e_vsi {
#endif #endif
u32 tx_restart; u32 tx_restart;
u32 tx_busy; u32 tx_busy;
u64 tx_linearize;
u32 rx_buf_failed; u32 rx_buf_failed;
u32 rx_page_failed; u32 rx_page_failed;
......
...@@ -87,6 +87,7 @@ static const struct i40e_stats i40e_gstrings_misc_stats[] = { ...@@ -87,6 +87,7 @@ static const struct i40e_stats i40e_gstrings_misc_stats[] = {
I40E_VSI_STAT("rx_broadcast", eth_stats.rx_broadcast), I40E_VSI_STAT("rx_broadcast", eth_stats.rx_broadcast),
I40E_VSI_STAT("tx_broadcast", eth_stats.tx_broadcast), I40E_VSI_STAT("tx_broadcast", eth_stats.tx_broadcast),
I40E_VSI_STAT("rx_unknown_protocol", eth_stats.rx_unknown_protocol), I40E_VSI_STAT("rx_unknown_protocol", eth_stats.rx_unknown_protocol),
I40E_VSI_STAT("tx_linearize", tx_linearize),
}; };
static int i40e_add_fdir_ethtool(struct i40e_vsi *vsi, static int i40e_add_fdir_ethtool(struct i40e_vsi *vsi,
......
...@@ -879,6 +879,7 @@ static void i40e_update_vsi_stats(struct i40e_vsi *vsi) ...@@ -879,6 +879,7 @@ static void i40e_update_vsi_stats(struct i40e_vsi *vsi)
u32 rx_page, rx_buf; u32 rx_page, rx_buf;
u64 bytes, packets; u64 bytes, packets;
unsigned int start; unsigned int start;
u64 tx_linearize;
u64 rx_p, rx_b; u64 rx_p, rx_b;
u64 tx_p, tx_b; u64 tx_p, tx_b;
u16 q; u16 q;
...@@ -897,7 +898,7 @@ static void i40e_update_vsi_stats(struct i40e_vsi *vsi) ...@@ -897,7 +898,7 @@ static void i40e_update_vsi_stats(struct i40e_vsi *vsi)
*/ */
rx_b = rx_p = 0; rx_b = rx_p = 0;
tx_b = tx_p = 0; tx_b = tx_p = 0;
tx_restart = tx_busy = 0; tx_restart = tx_busy = tx_linearize = 0;
rx_page = 0; rx_page = 0;
rx_buf = 0; rx_buf = 0;
rcu_read_lock(); rcu_read_lock();
...@@ -914,6 +915,7 @@ static void i40e_update_vsi_stats(struct i40e_vsi *vsi) ...@@ -914,6 +915,7 @@ static void i40e_update_vsi_stats(struct i40e_vsi *vsi)
tx_p += packets; tx_p += packets;
tx_restart += p->tx_stats.restart_queue; tx_restart += p->tx_stats.restart_queue;
tx_busy += p->tx_stats.tx_busy; tx_busy += p->tx_stats.tx_busy;
tx_linearize += p->tx_stats.tx_linearize;
/* Rx queue is part of the same block as Tx queue */ /* Rx queue is part of the same block as Tx queue */
p = &p[1]; p = &p[1];
...@@ -930,6 +932,7 @@ static void i40e_update_vsi_stats(struct i40e_vsi *vsi) ...@@ -930,6 +932,7 @@ static void i40e_update_vsi_stats(struct i40e_vsi *vsi)
rcu_read_unlock(); rcu_read_unlock();
vsi->tx_restart = tx_restart; vsi->tx_restart = tx_restart;
vsi->tx_busy = tx_busy; vsi->tx_busy = tx_busy;
vsi->tx_linearize = tx_linearize;
vsi->rx_page_failed = rx_page; vsi->rx_page_failed = rx_page;
vsi->rx_buf_failed = rx_buf; vsi->rx_buf_failed = rx_buf;
......
...@@ -2771,10 +2771,11 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb, ...@@ -2771,10 +2771,11 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,
if (tsyn) if (tsyn)
tx_flags |= I40E_TX_FLAGS_TSYN; tx_flags |= I40E_TX_FLAGS_TSYN;
if (i40e_chk_linearize(skb, tx_flags)) if (i40e_chk_linearize(skb, tx_flags)) {
if (skb_linearize(skb)) if (skb_linearize(skb))
goto out_drop; goto out_drop;
tx_ring->tx_stats.tx_linearize++;
}
skb_tx_timestamp(skb); skb_tx_timestamp(skb);
/* always enable CRC insertion offload */ /* always enable CRC insertion offload */
......
...@@ -188,6 +188,7 @@ struct i40e_tx_queue_stats { ...@@ -188,6 +188,7 @@ struct i40e_tx_queue_stats {
u64 restart_queue; u64 restart_queue;
u64 tx_busy; u64 tx_busy;
u64 tx_done_old; u64 tx_done_old;
u64 tx_linearize;
}; };
struct i40e_rx_queue_stats { struct i40e_rx_queue_stats {
......
...@@ -1927,10 +1927,11 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb, ...@@ -1927,10 +1927,11 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,
else if (tso) else if (tso)
tx_flags |= I40E_TX_FLAGS_TSO; tx_flags |= I40E_TX_FLAGS_TSO;
if (i40e_chk_linearize(skb, tx_flags)) if (i40e_chk_linearize(skb, tx_flags)) {
if (skb_linearize(skb)) if (skb_linearize(skb))
goto out_drop; goto out_drop;
tx_ring->tx_stats.tx_linearize++;
}
skb_tx_timestamp(skb); skb_tx_timestamp(skb);
/* always enable CRC insertion offload */ /* always enable CRC insertion offload */
......
...@@ -187,6 +187,7 @@ struct i40e_tx_queue_stats { ...@@ -187,6 +187,7 @@ struct i40e_tx_queue_stats {
u64 restart_queue; u64 restart_queue;
u64 tx_busy; u64 tx_busy;
u64 tx_done_old; u64 tx_done_old;
u64 tx_linearize;
}; };
struct i40e_rx_queue_stats { struct i40e_rx_queue_stats {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment