[PATCH V2 net-next 00/11] net: hns3: use seq_file for debugfs

Jijie Shao posted 11 patches 2 months, 4 weeks ago
There is a newer version of this series
drivers/net/ethernet/hisilicon/hns3/hnae3.h   |   16 +-
.../ethernet/hisilicon/hns3/hns3_debugfs.c    | 1044 ++++---------
.../ethernet/hisilicon/hns3/hns3_debugfs.h    |   16 -
.../net/ethernet/hisilicon/hns3/hns3_enet.c   |    2 +
.../hisilicon/hns3/hns3pf/hclge_debugfs.c     | 1356 +++++++----------
.../hisilicon/hns3/hns3pf/hclge_debugfs.h     |    1 +
.../hisilicon/hns3/hns3pf/hclge_main.c        |    2 +-
.../hisilicon/hns3/hns3pf/hclge_main.h        |    4 +-
8 files changed, 859 insertions(+), 1582 deletions(-)
[PATCH V2 net-next 00/11] net: hns3: use seq_file for debugfs
Posted by Jijie Shao 2 months, 4 weeks ago
Arnd reported that there are two build warning for on-stasck
buffer oversize. As Arnd's suggestion, using seq file way
to avoid the stack buffer or kmalloc buffer allocating.

---
ChangeLog:
v1 -> v2:
  - Remove unused functions in advance to eliminate compilation warnings, suggested by Jakub Kicinski
  - Remove unnecessary cast, suggested by Andrew Lunn
  v1: https://lore.kernel.org/all/20250708130029.1310872-1-shaojijie@huawei.com/
---

Jian Shen (5):
  net: hns3: clean up the build warning in debugfs by use seq file
  net: hns3: use seq_file for files in queue/ in debugfs
  net: hns3: use seq_file for files in tm/ in debugfs
  net: hns3: use seq_file for files in tx_bd_info/ and rx_bd_info/ in
    debugfs
  net: hns3: remove the unused code after using seq_file

Jijie Shao (4):
  net: hns3: remove tx spare info from debugfs.
  net: hns3: use seq_file for files in common/ of hns3 layer
  net: hns3: use seq_file for files in reg/ in debugfs
  net: hns3: use seq_file for files in fd/ in debugfs

Yonglong Liu (2):
  net: hns3: use seq_file for files in mac_list/ in debugfs
  net: hns3: use seq_file for files in common/ of hclge layer

 drivers/net/ethernet/hisilicon/hns3/hnae3.h   |   16 +-
 .../ethernet/hisilicon/hns3/hns3_debugfs.c    | 1044 ++++---------
 .../ethernet/hisilicon/hns3/hns3_debugfs.h    |   16 -
 .../net/ethernet/hisilicon/hns3/hns3_enet.c   |    2 +
 .../hisilicon/hns3/hns3pf/hclge_debugfs.c     | 1356 +++++++----------
 .../hisilicon/hns3/hns3pf/hclge_debugfs.h     |    1 +
 .../hisilicon/hns3/hns3pf/hclge_main.c        |    2 +-
 .../hisilicon/hns3/hns3pf/hclge_main.h        |    4 +-
 8 files changed, 859 insertions(+), 1582 deletions(-)

-- 
2.33.0
Re: [PATCH V2 net-next 00/11] net: hns3: use seq_file for debugfs
Posted by Simon Horman 2 months, 3 weeks ago
On Fri, Jul 11, 2025 at 02:17:14PM +0800, Jijie Shao wrote:
> Arnd reported that there are two build warning for on-stasck
> buffer oversize. As Arnd's suggestion, using seq file way
> to avoid the stack buffer or kmalloc buffer allocating.
> 
> ---
> ChangeLog:
> v1 -> v2:
>   - Remove unused functions in advance to eliminate compilation warnings, suggested by Jakub Kicinski
>   - Remove unnecessary cast, suggested by Andrew Lunn
>   v1: https://lore.kernel.org/all/20250708130029.1310872-1-shaojijie@huawei.com/
> ---
> 
> Jian Shen (5):
>   net: hns3: clean up the build warning in debugfs by use seq file
>   net: hns3: use seq_file for files in queue/ in debugfs
>   net: hns3: use seq_file for files in tm/ in debugfs
>   net: hns3: use seq_file for files in tx_bd_info/ and rx_bd_info/ in
>     debugfs

Thanks for the update, but unfortunately I don't think this is enough.

W=1 builds with bouth Clang 20.1.7 and GCC 15.1.0 warn that
hns3_dbg_fops is unused with the patch (10/11) above applied.

>   net: hns3: remove the unused code after using seq_file

I suspect this patch (11/11) needs to be squashed into the previous one (10/11).

...

-- 
pw-bot: changes-requested
Re: [PATCH V2 net-next 00/11] net: hns3: use seq_file for debugfs
Posted by Jijie Shao 2 months, 3 weeks ago
on 2025/7/12 20:19, Simon Horman wrote:
> On Fri, Jul 11, 2025 at 02:17:14PM +0800, Jijie Shao wrote:
>> Arnd reported that there are two build warning for on-stasck
>> buffer oversize. As Arnd's suggestion, using seq file way
>> to avoid the stack buffer or kmalloc buffer allocating.
>>
>> ---
>> ChangeLog:
>> v1 -> v2:
>>    - Remove unused functions in advance to eliminate compilation warnings, suggested by Jakub Kicinski
>>    - Remove unnecessary cast, suggested by Andrew Lunn
>>    v1: https://lore.kernel.org/all/20250708130029.1310872-1-shaojijie@huawei.com/
>> ---
>>
>> Jian Shen (5):
>>    net: hns3: clean up the build warning in debugfs by use seq file
>>    net: hns3: use seq_file for files in queue/ in debugfs
>>    net: hns3: use seq_file for files in tm/ in debugfs
>>    net: hns3: use seq_file for files in tx_bd_info/ and rx_bd_info/ in
>>      debugfs
> Thanks for the update, but unfortunately I don't think this is enough.
>
> W=1 builds with bouth Clang 20.1.7 and GCC 15.1.0 warn that
> hns3_dbg_fops is unused with the patch (10/11) above applied.
>
>>    net: hns3: remove the unused code after using seq_file
> I suspect this patch (11/11) needs to be squashed into the previous one (10/11).
>
> ...

Yes, it looks like so...

However, in this case, the operation of patch10 is not singular.
It modified a debugfs file through a patch while also removing unused code frameworks.

In fact, this warning was cleared in patch 11...

...

I will merge patch 11 into patch 10 in v3.

Thanks,
Jijie Shao
Re: [PATCH V2 net-next 00/11] net: hns3: use seq_file for debugfs
Posted by Simon Horman 2 months, 3 weeks ago
On Mon, Jul 14, 2025 at 09:04:56AM +0800, Jijie Shao wrote:
> 
> on 2025/7/12 20:19, Simon Horman wrote:
> > On Fri, Jul 11, 2025 at 02:17:14PM +0800, Jijie Shao wrote:
> > > Arnd reported that there are two build warning for on-stasck
> > > buffer oversize. As Arnd's suggestion, using seq file way
> > > to avoid the stack buffer or kmalloc buffer allocating.
> > > 
> > > ---
> > > ChangeLog:
> > > v1 -> v2:
> > >    - Remove unused functions in advance to eliminate compilation warnings, suggested by Jakub Kicinski
> > >    - Remove unnecessary cast, suggested by Andrew Lunn
> > >    v1: https://lore.kernel.org/all/20250708130029.1310872-1-shaojijie@huawei.com/
> > > ---
> > > 
> > > Jian Shen (5):
> > >    net: hns3: clean up the build warning in debugfs by use seq file
> > >    net: hns3: use seq_file for files in queue/ in debugfs
> > >    net: hns3: use seq_file for files in tm/ in debugfs
> > >    net: hns3: use seq_file for files in tx_bd_info/ and rx_bd_info/ in
> > >      debugfs
> > Thanks for the update, but unfortunately I don't think this is enough.
> > 
> > W=1 builds with bouth Clang 20.1.7 and GCC 15.1.0 warn that
> > hns3_dbg_fops is unused with the patch (10/11) above applied.
> > 
> > >    net: hns3: remove the unused code after using seq_file
> > I suspect this patch (11/11) needs to be squashed into the previous one (10/11).
> > 
> > ...
> 
> Yes, it looks like so...
> 
> However, in this case, the operation of patch10 is not singular.
> It modified a debugfs file through a patch while also removing unused code frameworks.
> 
> In fact, this warning was cleared in patch 11...
> 
> ...
> 
> I will merge patch 11 into patch 10 in v3.

Thanks, I agree that looks like a good approach.