linux/drivers/net/ethernet/intel/ice
Caleb Sander Mateos 61bf0009a7 dim: pass dim_sample to net_dim() by reference
net_dim() is currently passed a struct dim_sample argument by value.
struct dim_sample is 24 bytes. Since this is greater 16 bytes, x86-64
passes it on the stack. All callers have already initialized dim_sample
on the stack, so passing it by value requires pushing a duplicated copy
to the stack. Either witing to the stack and immediately reading it, or
perhaps dereferencing addresses relative to the stack pointer in a chain
of push instructions, seems to perform quite poorly.

In a heavy TCP workload, mlx5e_handle_rx_dim() consumes 3% of CPU time,
94% of which is attributed to the first push instruction to copy
dim_sample on the stack for the call to net_dim():
// Call ktime_get()
  0.26 |4ead2:   call   4ead7 <mlx5e_handle_rx_dim+0x47>
// Pass the address of struct dim in %rdi
       |4ead7:   lea    0x3d0(%rbx),%rdi
// Set dim_sample.pkt_ctr
       |4eade:   mov    %r13d,0x8(%rsp)
// Set dim_sample.byte_ctr
       |4eae3:   mov    %r12d,0xc(%rsp)
// Set dim_sample.event_ctr
  0.15 |4eae8:   mov    %bp,0x10(%rsp)
// Duplicate dim_sample on the stack
 94.16 |4eaed:   push   0x10(%rsp)
  2.79 |4eaf1:   push   0x10(%rsp)
  0.07 |4eaf5:   push   %rax
// Call net_dim()
  0.21 |4eaf6:   call   4eafb <mlx5e_handle_rx_dim+0x6b>

To allow the caller to reuse the struct dim_sample already on the stack,
pass the struct dim_sample by reference to net_dim().

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Shannon Nelson <shannon.nelson@amd.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Arthur Kiyanovski <akiyano@amazon.com>
Reviewed-by: Louis Peens <louis.peens@corigine.com>
Link: https://patch.msgid.link/20241031002326.3426181-2-csander@purestorage.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-11-03 12:36:54 -08:00
..
devlink ice: block SF port creation in legacy mode 2024-10-29 15:24:53 +01:00
ice.h Merge branch 'net-introduce-tx-h-w-shaping-api' 2024-10-10 08:32:46 -07:00
ice_adapter.c ice: Use ice_adapter for PTP shared data instead of auxdev 2024-10-01 11:11:38 -07:00
ice_adapter.h ice: Use ice_adapter for PTP shared data instead of auxdev 2024-10-01 11:11:38 -07:00
ice_adminq_cmd.h ice: Read SDP section from NVM for pin definitions 2024-10-01 11:11:38 -07:00
ice_arfs.c
ice_arfs.h
ice_base.c Merge branch 'net-introduce-tx-h-w-shaping-api' 2024-10-10 08:32:46 -07:00
ice_base.h
ice_cgu_regs.h
ice_common.c ice: Support VF queue rate limit and quanta size configuration 2024-10-10 08:30:23 -07:00
ice_common.h ice: add parser create and destroy skeleton 2024-08-13 14:51:28 -07:00
ice_controlq.c ice: Report NVM version numbers on mismatch during load 2024-08-26 09:47:13 -07:00
ice_controlq.h ice: remove unnecessary control queue cmd_buf arrays 2024-08-26 09:46:14 -07:00
ice_dcb.c
ice_dcb.h
ice_dcb_lib.c ice: add new VSI type for subfunctions 2024-09-06 10:52:19 -07:00
ice_dcb_lib.h
ice_dcb_nl.c
ice_dcb_nl.h
ice_ddp.c ice: fix memleak in ice_init_tx_topology() 2024-09-30 14:23:31 -07:00
ice_ddp.h ice: fix memleak in ice_init_tx_topology() 2024-09-30 14:23:31 -07:00
ice_debugfs.c
ice_devids.h
ice_dpll.c ice: fix crash on probe for DPLL enabled E810 LOM 2024-10-29 15:24:53 +01:00
ice_dpll.h ice: add callbacks for Embedded SYNC enablement on dpll pins 2024-08-26 19:21:14 -07:00
ice_eswitch.c ice: create port representor for SF 2024-09-06 11:01:24 -07:00
ice_eswitch.h ice: Cleanup unused declarations 2024-10-08 15:22:32 -07:00
ice_eswitch_br.c ice: Flush FDB entries before reset 2024-10-08 14:08:19 -07:00
ice_eswitch_br.h ice: Flush FDB entries before reset 2024-10-08 14:08:19 -07:00
ice_ethtool.c ice: Implement ethtool reset support 2024-10-08 14:37:15 -07:00
ice_ethtool.h ice: Implement driver functionality to dump serdes equalizer values 2024-07-10 19:09:45 -07:00
ice_ethtool_fdir.c ice: Add a per-VF limit on number of FDIR filters 2024-07-23 15:26:41 -07:00
ice_fdir.c
ice_fdir.h ice: Add a per-VF limit on number of FDIR filters 2024-07-23 15:26:41 -07:00
ice_flex_pipe.c ice: enable FDIR filters from raw binary patterns for VFs 2024-08-13 14:51:29 -07:00
ice_flex_pipe.h ice: Cleanup unused declarations 2024-10-08 15:22:32 -07:00
ice_flex_type.h
ice_flow.c ice: enable FDIR filters from raw binary patterns for VFs 2024-08-13 14:51:29 -07:00
ice_flow.h ice: enable FDIR filters from raw binary patterns for VFs 2024-08-13 14:51:29 -07:00
ice_fltr.c
ice_fltr.h
ice_fw_update.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
ice_fw_update.h
ice_fwlog.c
ice_fwlog.h
ice_gnss.c ice: Align E810T GPIO to other products 2024-10-01 11:11:38 -07:00
ice_gnss.h
ice_hw_autogen.h Merge branch 'net-introduce-tx-h-w-shaping-api' 2024-10-10 08:32:46 -07:00
ice_hwmon.c
ice_hwmon.h
ice_idc.c
ice_idc_int.h
ice_irq.c
ice_irq.h
ice_lag.c
ice_lag.h
ice_lan_tx_rx.h
ice_lib.c ice: add E830 HW VF mailbox message limit support 2024-10-08 14:37:15 -07:00
ice_lib.h ice: Cleanup unused declarations 2024-10-08 15:22:32 -07:00
ice_main.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-10-10 13:13:33 -07:00
ice_nvm.c
ice_nvm.h
ice_osdep.h ice: stop intermixing AQ commands/responses debug dumps 2024-08-26 09:40:44 -07:00
ice_parser.c ice: add API for parser profile initialization 2024-08-13 14:51:28 -07:00
ice_parser.h ice: add API for parser profile initialization 2024-08-13 14:51:28 -07:00
ice_parser_rt.c ice: Fix a 32bit bug 2024-08-21 17:21:47 -07:00
ice_pf_vsi_vlan_ops.c
ice_pf_vsi_vlan_ops.h
ice_protocol_type.h
ice_ptp.c ice: Use common error handling code in two functions 2024-10-08 14:37:16 -07:00
ice_ptp.h ice: Drop auxbus use for PTP to finalize ice_adapter move 2024-10-01 11:11:38 -07:00
ice_ptp_consts.h ice: Cache perout/extts requests and check flags 2024-10-01 11:11:38 -07:00
ice_ptp_hw.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-10-31 18:10:07 -07:00
ice_ptp_hw.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-10-31 18:10:07 -07:00
ice_repr.c ice: Fix a couple NULL vs IS_ERR() bugs 2024-09-15 08:30:21 -07:00
ice_repr.h ice: check if SF is ready in ethtool ops 2024-09-06 11:01:24 -07:00
ice_sbq_cmd.h
ice_sched.c ice: Adjust over allocation of memory in ice_sched_add_root_node() and ice_sched_add_node() 2024-08-26 09:49:57 -07:00
ice_sched.h
ice_sf_eth.c ice: Fix a NULL vs IS_ERR() check in probe() 2024-09-15 08:32:16 -07:00
ice_sf_eth.h ice: subfunction activation and base devlink ops 2024-09-06 11:01:24 -07:00
ice_sf_vsi_vlan_ops.c ice: basic support for VLAN in subfunctions 2024-09-06 11:01:24 -07:00
ice_sf_vsi_vlan_ops.h ice: basic support for VLAN in subfunctions 2024-09-06 11:01:24 -07:00
ice_sriov.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-10-10 13:13:33 -07:00
ice_sriov.h
ice_switch.c ice: fix VLAN replay after reset 2024-09-30 14:23:32 -07:00
ice_switch.h
ice_tc_lib.c ice: set correct dst VSI in only LAN filters 2024-09-30 14:23:19 -07:00
ice_tc_lib.h
ice_trace.h
ice_txrx.c dim: pass dim_sample to net_dim() by reference 2024-11-03 12:36:54 -08:00
ice_txrx.h Merge branch 'net-introduce-tx-h-w-shaping-api' 2024-10-10 08:32:46 -07:00
ice_txrx_lib.c
ice_txrx_lib.h ice: Cleanup unused declarations 2024-10-08 15:22:32 -07:00
ice_type.h ice: Support VF queue rate limit and quanta size configuration 2024-10-10 08:30:23 -07:00
ice_vf_lib.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-10-10 13:13:33 -07:00
ice_vf_lib.h ice: Support VF queue rate limit and quanta size configuration 2024-10-10 08:30:23 -07:00
ice_vf_lib_private.h ice: Fix increasing MSI-X on VF 2024-10-08 14:08:19 -07:00
ice_vf_mbx.c ice: add E830 HW VF mailbox message limit support 2024-10-08 14:37:15 -07:00
ice_vf_mbx.h ice: add E830 HW VF mailbox message limit support 2024-10-08 14:37:15 -07:00
ice_vf_vsi_vlan_ops.c
ice_vf_vsi_vlan_ops.h
ice_virtchnl.c Merge branch 'net-introduce-tx-h-w-shaping-api' 2024-10-10 08:32:46 -07:00
ice_virtchnl.h ice: Support VF queue rate limit and quanta size configuration 2024-10-10 08:30:23 -07:00
ice_virtchnl_allowlist.c ice: Support VF queue rate limit and quanta size configuration 2024-10-10 08:30:23 -07:00
ice_virtchnl_allowlist.h
ice_virtchnl_fdir.c ice: enable FDIR filters from raw binary patterns for VFs 2024-08-13 14:51:29 -07:00
ice_virtchnl_fdir.h ice: Add a per-VF limit on number of FDIR filters 2024-07-23 15:26:41 -07:00
ice_vlan.h
ice_vlan_mode.c
ice_vlan_mode.h
ice_vsi_vlan_lib.c ice: clear port vlan config during reset 2024-09-30 14:23:31 -07:00
ice_vsi_vlan_lib.h ice: clear port vlan config during reset 2024-09-30 14:23:31 -07:00
ice_vsi_vlan_ops.c ice: basic support for VLAN in subfunctions 2024-09-06 11:01:24 -07:00
ice_vsi_vlan_ops.h
ice_xsk.c ice: add new VSI type for subfunctions 2024-09-06 10:52:19 -07:00
ice_xsk.h ice: improve updating ice_{t,r}x_ring::xsk_pool 2024-07-29 08:52:29 -07:00
Makefile ice: basic support for VLAN in subfunctions 2024-09-06 11:01:24 -07:00