@@ -309,11 +309,41 @@ def _before_start(self):
309309 executor = self ._executor ,
310310 sudo = self ._sudo ,
311311 ).run ()
312+ Tool (
313+ f"ethtool --set-channels { self ._settings .input .inf } combined $(nproc)" ,
314+ executor = self ._executor ,
315+ sudo = self ._sudo ,
316+ ).run ()
317+ Tool (
318+ f"ethtool -X { self ._settings .input .inf } hfunc toeplitz hkey 6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a equal { self ._rss_queues_pcap } " ,
319+ executor = self ._executor ,
320+ sudo = self ._sudo ,
321+ ).run ()
312322 Tool (
313323 f"ethtool --set-channels { self ._settings .input .inf } combined { self ._rss_queues_pcap } " ,
314324 executor = self ._executor ,
315325 sudo = self ._sudo ,
316326 ).run ()
327+ Tool (
328+ f"ethtool -N { self ._settings .input .inf } rx-flow-hash tcp4 sd" ,
329+ executor = self ._executor ,
330+ sudo = self ._sudo ,
331+ ).run ()
332+ Tool (
333+ f"ethtool -N { self ._settings .input .inf } rx-flow-hash udp4 sd" ,
334+ executor = self ._executor ,
335+ sudo = self ._sudo ,
336+ ).run ()
337+ Tool (
338+ f"ethtool -N { self ._settings .input .inf } rx-flow-hash tcp6 sd" ,
339+ executor = self ._executor ,
340+ sudo = self ._sudo ,
341+ ).run ()
342+ Tool (
343+ f"ethtool -N { self ._settings .input .inf } rx-flow-hash udp6 sd" ,
344+ executor = self ._executor ,
345+ sudo = self ._sudo ,
346+ ).run ()
317347
318348 def start (self , start_stats : bool = True , stop_running : bool = True ):
319349 """
@@ -534,11 +564,46 @@ def __init__(
534564 self ._yaf_instances .append (instance )
535565
536566 def _set_rss_queues (self , interface_name ):
567+ Tool (
568+ f"ethtool --set-channels { interface_name } combined $(nproc)" ,
569+ executor = self ._executor ,
570+ sudo = self ._sudo ,
571+ ).run ()
572+ Tool (
573+ f"ethtool -X { interface_name } hfunc toeplitz hkey 6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a:6d:5a equal { self ._rss_queues } " ,
574+ executor = self ._executor ,
575+ sudo = self ._sudo ,
576+ ).run ()
537577 Tool (
538578 f"ethtool --set-channels { interface_name } combined { self ._rss_queues } " ,
539579 executor = self ._executor ,
540580 sudo = self ._sudo ,
541581 ).run ()
582+ Tool (
583+ f"ethtool -N { interface_name } rx-flow-hash tcp4 sd" ,
584+ executor = self ._executor ,
585+ sudo = self ._sudo ,
586+ ).run ()
587+ Tool (
588+ f"ethtool -N { interface_name } rx-flow-hash udp4 sd" ,
589+ executor = self ._executor ,
590+ sudo = self ._sudo ,
591+ ).run ()
592+ Tool (
593+ f"ethtool -N { interface_name } rx-flow-hash tcp6 sd" ,
594+ executor = self ._executor ,
595+ sudo = self ._sudo ,
596+ ).run ()
597+ Tool (
598+ f"ethtool -N { interface_name } rx-flow-hash udp6 sd" ,
599+ executor = self ._executor ,
600+ sudo = self ._sudo ,
601+ ).run ()
602+ Tool (
603+ f"ethtool -K { interface_name } gro off gso off tso off" ,
604+ executor = self ._executor ,
605+ sudo = self ._sudo ,
606+ ).run ()
542607
543608 def _before_start (self ):
544609 for ifc in self ._interfaces :
@@ -551,11 +616,6 @@ def _before_start(self):
551616 executor = self ._executor ,
552617 sudo = self ._sudo ,
553618 ).run ()
554- Tool (
555- f"ethtool -K { name } gro off gso off tso off" ,
556- executor = self ._executor ,
557- sudo = self ._sudo ,
558- ).run ()
559619 if ifc .startswith ("zc:" ):
560620 self ._switch_to_zc (name )
561621 self ._set_rss_queues (name )
0 commit comments