diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2017-08-18 18:48:22 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-08-19 01:39:28 -0400 |
commit | 85d8e2ba7060ced6b23a2b1a2a8dd5cdaf951fb9 (patch) | |
tree | bbe21cec1adefc15cef840b2b4c3f22066e21464 | |
parent | 825b18ab24a1762a07e8202999cd8eb8eb8d505d (diff) |
nfp: don't reuse pointers in ring dumping
We were reusing skb pointer when reading page frag, since ring
entries contain a union of a skb and frag pointer. This can
be confusing to people reading the code. Refactor the code
to read frag pointer directly.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/netronome/nfp/nfp_net_debugfs.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_debugfs.c b/drivers/net/ethernet/netronome/nfp/nfp_net_debugfs.c index 40217ece5fcb..cf81cf95d1d8 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_debugfs.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_debugfs.c | |||
@@ -125,7 +125,6 @@ static int nfp_net_debugfs_tx_q_read(struct seq_file *file, void *data) | |||
125 | struct nfp_net_tx_ring *tx_ring; | 125 | struct nfp_net_tx_ring *tx_ring; |
126 | struct nfp_net_tx_desc *txd; | 126 | struct nfp_net_tx_desc *txd; |
127 | int d_rd_p, d_wr_p, txd_cnt; | 127 | int d_rd_p, d_wr_p, txd_cnt; |
128 | struct sk_buff *skb; | ||
129 | struct nfp_net *nn; | 128 | struct nfp_net *nn; |
130 | int i; | 129 | int i; |
131 | 130 | ||
@@ -158,13 +157,15 @@ static int nfp_net_debugfs_tx_q_read(struct seq_file *file, void *data) | |||
158 | txd->vals[0], txd->vals[1], | 157 | txd->vals[0], txd->vals[1], |
159 | txd->vals[2], txd->vals[3]); | 158 | txd->vals[2], txd->vals[3]); |
160 | 159 | ||
161 | skb = READ_ONCE(tx_ring->txbufs[i].skb); | 160 | if (tx_ring == r_vec->tx_ring) { |
162 | if (skb) { | 161 | struct sk_buff *skb = READ_ONCE(tx_ring->txbufs[i].skb); |
163 | if (tx_ring == r_vec->tx_ring) | 162 | |
163 | if (skb) | ||
164 | seq_printf(file, " skb->head=%p skb->data=%p", | 164 | seq_printf(file, " skb->head=%p skb->data=%p", |
165 | skb->head, skb->data); | 165 | skb->head, skb->data); |
166 | else | 166 | } else { |
167 | seq_printf(file, " frag=%p", skb); | 167 | seq_printf(file, " frag=%p", |
168 | READ_ONCE(tx_ring->txbufs[i].frag)); | ||
168 | } | 169 | } |
169 | 170 | ||
170 | if (tx_ring->txbufs[i].dma_addr) | 171 | if (tx_ring->txbufs[i].dma_addr) |