@@ -65,15 +65,16 @@ static uint32_t cfg_busy_poll_usecs;
65
65
static uint16_t cfg_busy_poll_budget ;
66
66
static uint8_t cfg_prefer_busy_poll ;
67
67
68
- /* IRQ params */
68
+ /* NAPI params */
69
69
static uint32_t cfg_defer_hard_irqs ;
70
70
static uint64_t cfg_gro_flush_timeout ;
71
71
static uint64_t cfg_irq_suspend_timeout ;
72
+ static enum netdev_napi_threaded cfg_napi_threaded_poll = NETDEV_NAPI_THREADED_DISABLE ;
72
73
73
74
static void usage (const char * filepath )
74
75
{
75
76
error (1 , 0 ,
76
- "Usage: %s -p<port> -b<addr> -m<max_events> -u<busy_poll_usecs> -P<prefer_busy_poll> -g<busy_poll_budget> -o<outfile> -d<defer_hard_irqs> -r<gro_flush_timeout> -s<irq_suspend_timeout> -i<ifindex>" ,
77
+ "Usage: %s -p<port> -b<addr> -m<max_events> -u<busy_poll_usecs> -P<prefer_busy_poll> -g<busy_poll_budget> -o<outfile> -d<defer_hard_irqs> -r<gro_flush_timeout> -s<irq_suspend_timeout> -t<napi_threaded_poll> - i<ifindex>" ,
77
78
filepath );
78
79
}
79
80
@@ -86,7 +87,7 @@ static void parse_opts(int argc, char **argv)
86
87
if (argc <= 1 )
87
88
usage (argv [0 ]);
88
89
89
- while ((c = getopt (argc , argv , "p:m:b:u:P:g:o:d:r:s:i:" )) != -1 ) {
90
+ while ((c = getopt (argc , argv , "p:m:b:u:P:g:o:d:r:s:i:t: " )) != -1 ) {
90
91
/* most options take integer values, except o and b, so reduce
91
92
* code duplication a bit for the common case by calling
92
93
* strtoull here and leave bounds checking and casting per
@@ -168,6 +169,12 @@ static void parse_opts(int argc, char **argv)
168
169
169
170
cfg_ifindex = (int )tmp ;
170
171
break ;
172
+ case 't' :
173
+ if (tmp == ULLONG_MAX || tmp > 2 )
174
+ error (1 , ERANGE , "napi threaded poll value must be 0-2" );
175
+
176
+ cfg_napi_threaded_poll = (enum netdev_napi_threaded )tmp ;
177
+ break ;
171
178
}
172
179
}
173
180
@@ -246,6 +253,7 @@ static void setup_queue(void)
246
253
cfg_gro_flush_timeout );
247
254
netdev_napi_set_req_set_irq_suspend_timeout (set_req ,
248
255
cfg_irq_suspend_timeout );
256
+ netdev_napi_set_req_set_threaded (set_req , cfg_napi_threaded_poll );
249
257
250
258
if (netdev_napi_set (ys , set_req ))
251
259
error (1 , 0 , "can't set NAPI params: %s\n" , yerr .msg );
0 commit comments