1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/ethernet/intel/i40e
Ivan Vecera ea558de723 i40e: Enforce software interrupt during busy-poll exit
As for ice bug fixed by commit b7306b42be ("ice: manage interrupts
during poll exit") followed by commit 23be7075b3 ("ice: fix software
generating extra interrupts") I'm seeing the similar issue also with
i40e driver.

In certain situation when busy-loop is enabled together with adaptive
coalescing, the driver occasionally misses that there are outstanding
descriptors to clean when exiting busy poll.

Try to catch the remaining work by triggering a software interrupt
when exiting busy poll. No extra interrupts will be generated when
busy polling is not used.

The issue was found when running sockperf ping-pong tcp test with
adaptive coalescing and busy poll enabled (50 as value busy_pool
and busy_read sysctl knobs) and results in huge latency spikes
with more than 100000us.

The fix is inspired from the ice driver and do the following:
1) During napi poll exit in case of busy-poll (napo_complete_done()
   returns false) this is recorded to q_vector that we were in busy
   loop.
2) Extends i40e_buildreg_itr() to be able to add an enforced software
   interrupt into built value
2) In i40e_update_enable_itr() enforces a software interrupt trigger
   if we are exiting busy poll to catch any pending clean-ups
3) Reuses unused 3rd ITR (interrupt throttle) index and set it to
   20K interrupts per second to limit the number of these sw interrupts.

Test results
============
Prior:
[root@dell-per640-07 net]# sockperf ping-pong -i 10.9.9.1 --tcp -m 1000 --mps=max -t 120
sockperf: == version #3.10-no.git ==
sockperf[CLIENT] send on:sockperf: using recvfrom() to block on socket(s)

[ 0] IP = 10.9.9.1        PORT = 11111 # TCP
sockperf: Warmup stage (sending a few dummy messages)...
sockperf: Starting test...
sockperf: Test end (interrupted by timer)
sockperf: Test ended
sockperf: [Total Run] RunTime=119.999 sec; Warm up time=400 msec; SentMessages=2438563; ReceivedMessages=2438562
sockperf: ========= Printing statistics for Server No: 0
sockperf: [Valid Duration] RunTime=119.549 sec; SentMessages=2429473; ReceivedMessages=2429473
sockperf: ====> avg-latency=24.571 (std-dev=93.297, mean-ad=4.904, median-ad=1.510, siqr=1.063, cv=3.797, std-error=0.060, 99.0% ci=[24.417, 24.725])
sockperf: # dropped messages = 0; # duplicated messages = 0; # out-of-order messages = 0
sockperf: Summary: Latency is 24.571 usec
sockperf: Total 2429473 observations; each percentile contains 24294.73 observations
sockperf: ---> <MAX> observation = 103294.331
sockperf: ---> percentile 99.999 =   45.633
sockperf: ---> percentile 99.990 =   37.013
sockperf: ---> percentile 99.900 =   35.910
sockperf: ---> percentile 99.000 =   33.390
sockperf: ---> percentile 90.000 =   28.626
sockperf: ---> percentile 75.000 =   27.741
sockperf: ---> percentile 50.000 =   26.743
sockperf: ---> percentile 25.000 =   25.614
sockperf: ---> <MIN> observation =   12.220

After:
[root@dell-per640-07 net]# sockperf ping-pong -i 10.9.9.1 --tcp -m 1000 --mps=max -t 120
sockperf: == version #3.10-no.git ==
sockperf[CLIENT] send on:sockperf: using recvfrom() to block on socket(s)

[ 0] IP = 10.9.9.1        PORT = 11111 # TCP
sockperf: Warmup stage (sending a few dummy messages)...
sockperf: Starting test...
sockperf: Test end (interrupted by timer)
sockperf: Test ended
sockperf: [Total Run] RunTime=119.999 sec; Warm up time=400 msec; SentMessages=2400055; ReceivedMessages=2400054
sockperf: ========= Printing statistics for Server No: 0
sockperf: [Valid Duration] RunTime=119.549 sec; SentMessages=2391186; ReceivedMessages=2391186
sockperf: ====> avg-latency=24.965 (std-dev=5.934, mean-ad=4.642, median-ad=1.485, siqr=1.067, cv=0.238, std-error=0.004, 99.0% ci=[24.955, 24.975])
sockperf: # dropped messages = 0; # duplicated messages = 0; # out-of-order messages = 0
sockperf: Summary: Latency is 24.965 usec
sockperf: Total 2391186 observations; each percentile contains 23911.86 observations
sockperf: ---> <MAX> observation =  195.841
sockperf: ---> percentile 99.999 =   45.026
sockperf: ---> percentile 99.990 =   39.009
sockperf: ---> percentile 99.900 =   35.922
sockperf: ---> percentile 99.000 =   33.482
sockperf: ---> percentile 90.000 =   28.902
sockperf: ---> percentile 75.000 =   27.821
sockperf: ---> percentile 50.000 =   26.860
sockperf: ---> percentile 25.000 =   25.685
sockperf: ---> <MIN> observation =   12.277

Fixes: 0bcd952fee ("ethernet/intel: consolidate NAPI and NAPI exit")
Reported-by: Hugo Ferreira <hferreir@redhat.com>
Reviewed-by: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2024-03-26 08:34:40 -07:00
..
i40e.h i40e: Enforce software interrupt during busy-poll exit 2024-03-26 08:34:40 -07:00
i40e_adminq.c i40e: Remove queue tracking fields from i40e_adminq_ring 2023-11-27 09:31:34 -08:00
i40e_adminq.h i40e: Remove queue tracking fields from i40e_adminq_ring 2023-11-27 09:31:34 -08:00
i40e_adminq_cmd.h i40e: Include types.h to some headers 2024-01-18 09:52:52 -08:00
i40e_alloc.h i40e: Move memory allocation structures to i40e_alloc.h 2023-10-05 09:13:42 -07:00
i40e_client.c i40e: remove unnecessary qv_info ptr NULL checks 2024-03-06 09:32:58 -08:00
i40e_common.c i40e: field get conversion 2023-12-18 11:20:43 -08:00
i40e_dcb.c i40e: Fix wrong mask used during DCB config 2024-02-12 16:58:08 -08:00
i40e_dcb.h net: intel: fix old compiler regressions 2024-02-07 09:15:27 -08:00
i40e_dcb_nl.c i40e: Introduce and use macros for iterating VSIs and VEBs 2024-02-16 09:28:14 -08:00
i40e_ddp.c i40e: field get conversion 2023-12-18 11:20:43 -08:00
i40e_debug.h i40e: Initialize hardware capabilities at single place 2023-11-14 20:05:44 -08:00
i40e_debugfs.c i40e: Remove VEB recursion 2024-02-16 09:28:14 -08:00
i40e_devids.h i40e: Add basic support for I710 devices 2022-09-06 12:49:00 -07:00
i40e_devlink.c i40e: Do not call devlink_port_type_clear() 2023-11-06 16:16:13 -08:00
i40e_devlink.h i40e: Add initial devlink support 2023-10-15 14:33:41 +01:00
i40e_diag.c i40e: remove i40e_status 2023-07-31 14:37:25 -07:00
i40e_diag.h i40e: Include types.h to some headers 2024-01-18 09:52:52 -08:00
i40e_ethtool.c net: intel: i40e/igc: Remove setting Autoneg in EEE capabilities 2024-02-28 12:18:04 +00:00
i40e_hmc.c i40e: Remove circular header dependencies and fix headers 2023-10-05 09:18:09 -07:00
i40e_hmc.h i40e: Remove circular header dependencies and fix headers 2023-10-05 09:18:09 -07:00
i40e_io.h i40e: Split i40e_osdep.h 2023-10-05 09:13:43 -07:00
i40e_lan_hmc.c i40e: Remove circular header dependencies and fix headers 2023-10-05 09:18:09 -07:00
i40e_lan_hmc.h i40e: Remove circular header dependencies and fix headers 2023-10-05 09:18:09 -07:00
i40e_main.c i40e: Enforce software interrupt during busy-poll exit 2024-03-26 08:34:40 -07:00
i40e_nvm.c i40e: field get conversion 2023-12-18 11:20:43 -08:00
i40e_prototype.h i40e: Fix firmware version comparison function 2024-03-05 09:49:59 -08:00
i40e_ptp.c i40e: field get conversion 2023-12-18 11:20:43 -08:00
i40e_register.h i40e: Enforce software interrupt during busy-poll exit 2024-03-26 08:34:40 -07:00
i40e_trace.h i40e: add xdp_buff to i40e_ring struct 2023-03-09 13:11:24 -08:00
i40e_txrx.c i40e: Enforce software interrupt during busy-poll exit 2024-03-26 08:34:40 -07:00
i40e_txrx.h i40e: Enforce software interrupt during busy-poll exit 2024-03-26 08:34:40 -07:00
i40e_txrx_common.h i40e: Remove circular header dependencies and fix headers 2023-10-05 09:18:09 -07:00
i40e_type.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-12-21 22:17:23 +01:00
i40e_virtchnl_pf.c i40e: remove unnecessary qv_info ptr NULL checks 2024-03-06 09:32:58 -08:00
i40e_virtchnl_pf.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-01-04 18:06:46 -08:00
i40e_xsk.c intel: xsk: initialize skb_frag_t::bv_offset in ZC drivers 2024-01-24 16:24:07 -08:00
i40e_xsk.h i40e: Remove circular header dependencies and fix headers 2023-10-05 09:18:09 -07:00
Makefile i40e: Add initial devlink support 2023-10-15 14:33:41 +01:00