Re: [PATCH net-next 5/5] net: wangxun: add ndo_get_stats64 support

"[email protected]" <[email protected]>
Newsgroups org.kernel.vger.netdev
Message-ID <[email protected]>

> 2026年7月31日 21:14,Breno Leitao <[email protected]> 写道:
> 
> On Fri, Jul 31, 2026 at 05:41:33PM +0800, [email protected] wrote:
>> 
>> 
>>> 2026年7月31日 16:52,Breno Leitao <[email protected]> 写道:
>>> 
>>> On Fri, Jul 31, 2026 at 03:49:58PM +0800, Mengyuan Lou wrote:
>>>> Expose network statistics for Wangxun VF drivers by registering the
>>>> callback.
>>>> 
>>>> Signed-off-by: Mengyuan Lou <[email protected]>
>>>> ---
>>>> drivers/net/ethernet/wangxun/libwx/wx_lib.c         | 2 ++
>>>> drivers/net/ethernet/wangxun/ngbevf/ngbevf_main.c   | 1 +
>>>> drivers/net/ethernet/wangxun/txgbevf/txgbevf_main.c | 1 +
>>>> 3 files changed, 4 insertions(+)
>>>> 
>>>> diff --git a/drivers/net/ethernet/wangxun/libwx/wx_lib.c b/drivers/net/ethernet/wangxun/libwx/wx_lib.c
>>>> index ae20733c703d..a4ca01c18c6a 100644
>>>> --- a/drivers/net/ethernet/wangxun/libwx/wx_lib.c
>>>> +++ b/drivers/net/ethernet/wangxun/libwx/wx_lib.c
>>>> @@ -3092,6 +3092,8 @@ void wx_get_stats64(struct net_device *netdev,
>>>> }
>>>> 
>>>> rcu_read_unlock();
>>>> + if (wx->pdev->is_virtfn)
>>>> + return;
>>> 
>>> Why you don't want to populate the other entries?
>> 
>> The hardware does not provide the err counts on the vf.
> 
> Right, but hwstats fields will be zero, right?
> 
> Does this early return buys us anything?
> 

You're right. I write the code based on the hardware concept, in fact, this is really unnecessary.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.