Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

netronome: don't bother with debugfs_real_fops()

Just turn nfp_tx_q_show() into a wrapper for helper that gets
told whether it's tx or xdp via an explicit argument and have
nfp_xdp_q_show() call the underlying helper instead.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Reviewed-by: Louis Peens <louis.peens@corigine.com>
Link: https://lore.kernel.org/r/20250702212205.GF3406663@ZenIV
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Al Viro and committed by
Greg Kroah-Hartman
1c1ec6f0 a7694ff1

+10 -5
+10 -5
drivers/net/ethernet/netronome/nfp/nfp_net_debugfs.c
··· 77 77 static int nfp_tx_q_show(struct seq_file *file, void *data); 78 78 DEFINE_SHOW_ATTRIBUTE(nfp_tx_q); 79 79 80 - static int nfp_tx_q_show(struct seq_file *file, void *data) 80 + static int __nfp_tx_q_show(struct seq_file *file, void *data, bool is_xdp) 81 81 { 82 82 struct nfp_net_r_vector *r_vec = file->private; 83 83 struct nfp_net_tx_ring *tx_ring; ··· 86 86 87 87 rtnl_lock(); 88 88 89 - if (debugfs_real_fops(file->file) == &nfp_tx_q_fops) 90 - tx_ring = r_vec->tx_ring; 91 - else 89 + if (is_xdp) 92 90 tx_ring = r_vec->xdp_ring; 91 + else 92 + tx_ring = r_vec->tx_ring; 93 93 if (!r_vec->nfp_net || !tx_ring) 94 94 goto out; 95 95 nn = r_vec->nfp_net; ··· 115 115 return 0; 116 116 } 117 117 118 + static int nfp_tx_q_show(struct seq_file *file, void *data) 119 + { 120 + return __nfp_tx_q_show(file, data, false); 121 + } 122 + 118 123 static int nfp_xdp_q_show(struct seq_file *file, void *data) 119 124 { 120 - return nfp_tx_q_show(file, data); 125 + return __nfp_tx_q_show(file, data, true); 121 126 } 122 127 DEFINE_SHOW_ATTRIBUTE(nfp_xdp_q); 123 128