mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-13 22:25:03 +00:00
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>
This commit is contained in:
parent
825b18ab24
commit
85d8e2ba70
1 changed files with 7 additions and 6 deletions
|
@ -125,7 +125,6 @@ static int nfp_net_debugfs_tx_q_read(struct seq_file *file, void *data)
|
||||||
struct nfp_net_tx_ring *tx_ring;
|
struct nfp_net_tx_ring *tx_ring;
|
||||||
struct nfp_net_tx_desc *txd;
|
struct nfp_net_tx_desc *txd;
|
||||||
int d_rd_p, d_wr_p, txd_cnt;
|
int d_rd_p, d_wr_p, txd_cnt;
|
||||||
struct sk_buff *skb;
|
|
||||||
struct nfp_net *nn;
|
struct nfp_net *nn;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -158,13 +157,15 @@ static int nfp_net_debugfs_tx_q_read(struct seq_file *file, void *data)
|
||||||
txd->vals[0], txd->vals[1],
|
txd->vals[0], txd->vals[1],
|
||||||
txd->vals[2], txd->vals[3]);
|
txd->vals[2], txd->vals[3]);
|
||||||
|
|
||||||
skb = READ_ONCE(tx_ring->txbufs[i].skb);
|
if (tx_ring == r_vec->tx_ring) {
|
||||||
if (skb) {
|
struct sk_buff *skb = READ_ONCE(tx_ring->txbufs[i].skb);
|
||||||
if (tx_ring == r_vec->tx_ring)
|
|
||||||
|
if (skb)
|
||||||
seq_printf(file, " skb->head=%p skb->data=%p",
|
seq_printf(file, " skb->head=%p skb->data=%p",
|
||||||
skb->head, skb->data);
|
skb->head, skb->data);
|
||||||
else
|
} else {
|
||||||
seq_printf(file, " frag=%p", skb);
|
seq_printf(file, " frag=%p",
|
||||||
|
READ_ONCE(tx_ring->txbufs[i].frag));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tx_ring->txbufs[i].dma_addr)
|
if (tx_ring->txbufs[i].dma_addr)
|
||||||
|
|
Loading…
Reference in a new issue