Subject: Re: [RFC PATCH 2/2] netdev: an usage example on igb

From: Koki Sanagi <[email-masked]>
Date: Tue, 06 Apr 2010 14:40:52 +0900

(2010/04/05 17:30), Eric Dumazet wrote:
> Le lundi 05 avril 2010 à 15:54 +0900, Koki Sanagi a écrit :
>> This patch is usage example of previous patch's buffer on igb.
>> The output is like below.
>>
>> # cat /sys/kernel/debug/ndrvbuf/igb-trace-0000\:03\:00.0/buffer
>> [  1] 50462.369207: clean_tx qidx=1 ntu=154->156
>> [  0] 50462.369241: clean_rx qidx=0 ntu=111->112
>> [  0] 50462.369250: xmit qidx=1 ntu=156->158
>> [  1] 50462.369256: clean_tx qidx=1 ntu=156->158
>> [  1] 50462.369342: clean_rx qidx=0 ntu=113->114
>> [  1] 50462.369439: clean_rx qidx=0 ntu=114->115
>>
>> This example outputs original print style, because it sets original print
>> function(igb_trace_read) when registered.
>>
>> register_ndrvbuf(buname, 1000000, igb_trace_read);
>>
>> If you set NULL to arg3, outputs by ndrvbuf default style.
>> If you set 0 to size(arg2), recording is disabled at first(but small buffer is
>> alloced).
>> When you set non-zero to size, recording becomes enabled.
>>
>> Signed-off-by: Koki Sanagi<[email-masked]>
>> ---
>>    drivers/net/igb/Makefile    |    2 +-
>>    drivers/net/igb/igb.h       |    1 +
>>    drivers/net/igb/igb_main.c  |   10 +++++-
>>    drivers/net/igb/igb_trace.c |   81 +++++++++++++++++++++++++++++++++++++++++++
>>    drivers/net/igb/igb_trace.h |   21 +++++++++++
>>    5 files changed, 113 insertions(+), 2 deletions(-)
>>
>
> This depends on NDRVBUF, yet I see no Kconfig change in this patch.
>
This igb can exist without ndrvbuf.
If ndrvbuf modules is not loaded, igb operates originally.
So this doesn't depend on ndrvbuf.