@@ -65,15 +65,16 @@ static uint32_t cfg_busy_poll_usecs;
6565static uint16_t cfg_busy_poll_budget ;
6666static uint8_t cfg_prefer_busy_poll ;
6767
68- /* IRQ params */
68+ /* NAPI params */
6969static uint32_t cfg_defer_hard_irqs ;
7070static uint64_t cfg_gro_flush_timeout ;
7171static uint64_t cfg_irq_suspend_timeout ;
72+ static enum netdev_napi_threaded cfg_napi_threaded_poll = NETDEV_NAPI_THREADED_DISABLE ;
7273
7374static void usage (const char * filepath )
7475{
7576 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>" ,
7778 filepath );
7879}
7980
@@ -86,7 +87,7 @@ static void parse_opts(int argc, char **argv)
8687 if (argc <= 1 )
8788 usage (argv [0 ]);
8889
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 ) {
9091 /* most options take integer values, except o and b, so reduce
9192 * code duplication a bit for the common case by calling
9293 * strtoull here and leave bounds checking and casting per
@@ -168,6 +169,12 @@ static void parse_opts(int argc, char **argv)
168169
169170 cfg_ifindex = (int )tmp ;
170171 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 ;
171178 }
172179 }
173180
@@ -246,6 +253,7 @@ static void setup_queue(void)
246253 cfg_gro_flush_timeout );
247254 netdev_napi_set_req_set_irq_suspend_timeout (set_req ,
248255 cfg_irq_suspend_timeout );
256+ netdev_napi_set_req_set_threaded (set_req , cfg_napi_threaded_poll );
249257
250258 if (netdev_napi_set (ys , set_req ))
251259 error (1 , 0 , "can't set NAPI params: %s\n" , yerr .msg );
0 commit comments