• Claudiu Manoil's avatar
    enetc: Add adaptive interrupt coalescing · ae0e6a5d
    Claudiu Manoil authored
    Use the generic dynamic interrupt moderation (dim)
    framework to implement adaptive interrupt coalescing
    on Rx.  With the per-packet interrupt scheme, a high
    interrupt rate has been noted for moderate traffic flows
    leading to high CPU utilization.  The 'dim' scheme
    implemented by the current patch addresses this issue
    improving CPU utilization while using minimal coalescing
    time thresholds in order to preserve a good latency.
    On the Tx side use an optimal time threshold value by
    default.  This value has been optimized for Tx TCP
    streams at a rate of around 85kpps on a 1G link,
    at which rate half of the Tx ring size (128) gets filled
    in 1500 usecs.  Scaling this down to 2.5G links yields
    the current value of 600 usecs, which is conservative
    and gives good enough results for 1G links too (see
    next).
    
    Below are some measurement results for before and after
    this patch (and related dependencies) basically, for a
    2 ARM Cortex-A72 @1.3Ghz CPUs system (32 KB L1 data cache),
    using 60secs log netperf TCP stream tests @ 1Gbit link
    (maximum throughput):
    
    1) 1 Rx TCP flow, both Rx and Tx processed by the same NAPI
    thread on the same CPU:
    	CPU utilization		int rate (ints/sec)
    Before:	50%-60% (over 50%)		92k
    After:  13%-22%				3.5k-12k
    Comment:  Major CPU utilization improvement for a single flow
    	  Rx TCP flow (i.e. netperf -t TCP_MAERTS) on a single
    	  CPU. Usually settles under 16% for longer tests.
    
    2) 4 Rx TCP flows + 4 Tx TCP flows (+ pings to check the latency):
    	Total CPU utilization	Total int rate (ints/sec)
    Before:	~80% (spikes to 90%)		~100k
    After:   60% (more steady)		  ~4k
    Comment:  Important improvement for this load test, while the
    	  ping test outcome does not show any notable
    	  difference compared to before.
    Signed-off-by: default avatarClaudiu Manoil <claudiu.manoil@nxp.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    ae0e6a5d
enetc.c 45.5 KB