Skip to content

Commit 85d8e2b

Browse files
Jakub Kicinskidavem330
authored andcommitted
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>
1 parent 825b18a commit 85d8e2b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

drivers/net/ethernet/netronome/nfp/nfp_net_debugfs.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ static int nfp_net_debugfs_tx_q_read(struct seq_file *file, void *data)
125125
struct nfp_net_tx_ring *tx_ring;
126126
struct nfp_net_tx_desc *txd;
127127
int d_rd_p, d_wr_p, txd_cnt;
128-
struct sk_buff *skb;
129128
struct nfp_net *nn;
130129
int i;
131130

@@ -158,13 +157,15 @@ static int nfp_net_debugfs_tx_q_read(struct seq_file *file, void *data)
158157
txd->vals[0], txd->vals[1],
159158
txd->vals[2], txd->vals[3]);
160159

161-
skb = READ_ONCE(tx_ring->txbufs[i].skb);
162-
if (skb) {
163-
if (tx_ring == r_vec->tx_ring)
160+
if (tx_ring == r_vec->tx_ring) {
161+
struct sk_buff *skb = READ_ONCE(tx_ring->txbufs[i].skb);
162+
163+
if (skb)
164164
seq_printf(file, " skb->head=%p skb->data=%p",
165165
skb->head, skb->data);
166-
else
167-
seq_printf(file, " frag=%p", skb);
166+
} else {
167+
seq_printf(file, " frag=%p",
168+
READ_ONCE(tx_ring->txbufs[i].frag));
168169
}
169170

170171
if (tx_ring->txbufs[i].dma_addr)

0 commit comments

Comments
 (0)