2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/drivers/net/ethernet/intel/ice
Jacob Keller 5f6df173f9 ice: implement and use rd32_poll_timeout for ice_sq_done timeout
The ice_sq_done function is used to check the control queue head register
and determine whether or not the control queue processing is done. This
function is called in a loop checking against jiffies for a specified
timeout.

The pattern of reading a register in a loop until a condition is true or a
timeout is reached is a relatively common pattern. In fact, the kernel
provides a read_poll_timeout function implementing this behavior in
<linux/iopoll.h>

Use of read_poll_timeout is preferred over directly coding these loops.
However, using it in the ice driver is a bit more difficult because of the
rd32 wrapper. Implement a rd32_poll_timeout wrapper based on
read_poll_timeout.

Refactor ice_sq_done to use rd32_poll_timeout, replacing the loop calling
ice_sq_done in ice_sq_send_cmd. This simplifies the logic down to a single
ice_sq_done() call.

The implementation of rd32_poll_timeout uses microseconds for its timeout
value, so update the CQ timeout macros used to be specified in microseconds
units as well instead of using HZ for jiffies.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@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-08-26 09:34:38 -07:00
..
devlink ice: use internal pf id instead of function number 2024-08-20 13:23:01 -07:00
ice_adapter.c ice: do not init struct ice_adapter more times than needed 2024-06-28 13:07:24 -07:00
ice_adapter.h ice: avoid the PTP hardware semaphore in gettimex64 path 2024-04-01 08:58:09 -07:00
ice_adminq_cmd.h ice: Add support for devlink local_forwarding param 2024-07-11 10:53:57 -07:00
ice_arfs.c net: introduce include/net/rps.h 2024-03-07 21:12:43 -08:00
ice_arfs.h
ice_base.c ice: fix truesize operations for PAGE_SIZE >= 8192 2024-08-20 13:22:01 -07:00
ice_base.h ice: make ice_vsi_cfg_txq() static 2024-02-02 09:13:13 -08:00
ice_cgu_regs.h ice: Add support for E825-C TS PLL handling 2024-06-01 15:51:51 -07:00
ice_common.c Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue 2024-07-14 07:37:29 -07:00
ice_common.h ice: add parser create and destroy skeleton 2024-08-13 14:51:28 -07:00
ice_controlq.c ice: implement and use rd32_poll_timeout for ice_sq_done timeout 2024-08-26 09:34:38 -07:00
ice_controlq.h ice: implement and use rd32_poll_timeout for ice_sq_done timeout 2024-08-26 09:34:38 -07:00
ice_dcb_lib.c ice: move ice_devlink.[ch] to devlink folder 2024-04-01 08:58:09 -07:00
ice_dcb_lib.h
ice_dcb_nl.c ice: field get conversion 2023-12-18 11:20:43 -08:00
ice_dcb_nl.h
ice_dcb.c ice: cleanup inconsistent code 2023-12-18 11:20:43 -08:00
ice_dcb.h
ice_ddp.c ice: parse and init various DDP parser sections 2024-08-13 14:51:28 -07:00
ice_ddp.h ice: parse and init various DDP parser sections 2024-08-13 14:51:28 -07:00
ice_debugfs.c ice: ensure the copied buf is NUL terminated 2024-04-25 19:23:11 -07:00
ice_devids.h ice: update E830 device ids and comments 2024-05-06 09:18:48 -07:00
ice_dpll.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-03-07 10:29:36 -08:00
ice_dpll.h ice: dpll: fix check for dpll input priority range 2023-11-13 10:02:15 -08:00
ice_eswitch_br.c ice: store representor ID in bridge port 2024-06-21 07:44:33 -07:00
ice_eswitch_br.h ice: store representor ID in bridge port 2024-06-21 07:44:33 -07:00
ice_eswitch.c ice: remove eswitch rebuild 2024-07-11 10:58:00 -07:00
ice_eswitch.h ice: remove eswitch rebuild 2024-07-11 10:58:00 -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_ethtool.c ethtool: rss: don't report key if device doesn't support it 2024-08-12 14:16:24 +01:00
ice_ethtool.h ice: Implement driver functionality to dump serdes equalizer values 2024-07-10 19:09:45 -07:00
ice_fdir.c ice: Implement 'flow-type ether' rules 2024-04-12 10:34:24 -07:00
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: enable FDIR filters from raw binary patterns for VFs 2024-08-13 14:51:29 -07:00
ice_flex_type.h ice: Add support for PFCP hardware offload in switchdev 2024-04-01 10:49:29 +01:00
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 ice: Add tx_scheduling_layers devlink param 2024-04-22 13:05:19 -07:00
ice_fw_update.h ice: Add tx_scheduling_layers devlink param 2024-04-22 13:05:19 -07:00
ice_fwlog.c ice: Fix debugfs with devlink reload 2024-02-12 10:12:42 -08:00
ice_fwlog.h ice: add ability to read and configure FW log data 2023-12-14 09:50:58 -08:00
ice_gnss.c ice: check netlist before enabling ICE_F_GNSS 2023-09-18 11:27:33 -07:00
ice_gnss.h
ice_hw_autogen.h ice: Adjust PTP init for 2x50G E825C devices 2024-06-01 15:51:52 -07:00
ice_hwmon.c ice: use proper macro for testing bit 2024-07-03 19:36:52 -07:00
ice_hwmon.h ice: read internal temperature sensor 2023-12-05 11:40:12 +01:00
ice_idc_int.h
ice_idc.c
ice_irq.c
ice_irq.h
ice_lag.c Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue 2024-03-28 22:50:22 -07:00
ice_lag.h ice: control default Tx rule in lag 2024-03-25 13:08:05 -07:00
ice_lan_tx_rx.h net: intel: introduce {, Intel} Ethernet common library 2024-04-24 11:06:25 -07:00
ice_lib.c ice: use irq_update_affinity_hint() 2024-06-10 19:52:45 -07:00
ice_lib.h ice: refactor struct ice_vsi_cfg_params to be inside of struct ice_vsi 2024-05-06 09:21:00 -07:00
ice_main.c ice: Fix reset handler 2024-08-07 10:52:20 -07:00
ice_nvm.c ice: fix reads from NVM Shadow RAM on E830 and E825-C devices 2024-06-05 19:27:55 -07:00
ice_nvm.h ice: Add tx_scheduling_layers devlink param 2024-04-22 13:05:19 -07:00
ice_osdep.h ice: implement and use rd32_poll_timeout for ice_sq_done timeout 2024-08-26 09:34:38 -07:00
ice_parser_rt.c ice: Fix a 32bit bug 2024-08-21 17:21:47 -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_pf_vsi_vlan_ops.c
ice_pf_vsi_vlan_ops.h
ice_protocol_type.h ice: Remove unused members from switch API 2024-07-11 09:40:56 -07:00
ice_ptp_consts.h ice: Add support for E825-C TS PLL handling 2024-06-01 15:51:51 -07:00
ice_ptp_hw.c ice: Extend Sideband Queue command to support flags 2024-07-10 19:09:45 -07:00
ice_ptp_hw.h ice: Add support for E825-C TS PLL handling 2024-06-01 15:51:51 -07:00
ice_ptp.c ice: Skip PTP HW writes during PTP reset procedure 2024-08-07 10:55:36 -07:00
ice_ptp.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-07-04 14:16:11 -07:00
ice_repr.c ice: move VSI configuration outside repr setup 2024-06-21 08:51:50 -07:00
ice_repr.h ice: store representor ID in bridge port 2024-06-21 07:44:33 -07:00
ice_sbq_cmd.h ice: Introduce ETH56G PHY model for E825C products 2024-06-01 15:51:51 -07:00
ice_sched.c ice: Adjust the VSI/Aggregator layers 2024-04-22 13:05:19 -07:00
ice_sched.h ice: Support 5 layer topology 2024-04-22 13:05:19 -07:00
ice_sriov.c ice: Add get/set hw address for VFs using devlink commands 2024-06-28 10:23:10 -07:00
ice_sriov.h ice: Add get/set hw address for VFs using devlink commands 2024-06-28 10:23:10 -07:00
ice_switch.c ice: Fix recipe read procedure 2024-07-23 15:26:41 -07:00
ice_switch.h ice: Remove unused members from switch API 2024-07-11 09:40:56 -07:00
ice_tc_lib.c ice: flower: validate encapsulation control flags 2024-06-12 17:56:01 -07:00
ice_tc_lib.h ice: Add support for PFCP hardware offload in switchdev 2024-04-01 10:49:29 +01:00
ice_trace.h ice: Add tracepoint for adding and removing switch rules 2024-07-11 09:40:56 -07:00
ice_txrx_lib.c net: intel: introduce {, Intel} Ethernet common library 2024-04-24 11:06:25 -07:00
ice_txrx_lib.h ice: work on pre-XDP prog frag count 2024-01-24 16:24:06 -08:00
ice_txrx.c ice: fix truesize operations for PAGE_SIZE >= 8192 2024-08-20 13:22:01 -07:00
ice_txrx.h ice: do switchdev slow-path Rx using PF VSI 2024-03-25 13:08:47 -07:00
ice_type.h ice: parse and init various DDP parser sections 2024-08-13 14:51:28 -07:00
ice_vf_lib_private.h ice: replace ice_vf_recreate_vsi() with ice_vf_reconfig_vsi() 2024-01-02 11:18:32 -08:00
ice_vf_lib.c ice: update representor when VSI is ready 2024-06-21 08:51:58 -07:00
ice_vf_lib.h ice: enable FDIR filters from raw binary patterns for VFs 2024-08-13 14:51:29 -07:00
ice_vf_mbx.c
ice_vf_mbx.h
ice_vf_vsi_vlan_ops.c ice: fix enabling RX VLAN filtering 2024-04-03 09:16:19 -07:00
ice_vf_vsi_vlan_ops.h
ice_virtchnl_allowlist.c ice: virtchnl: stop pretending to support RSS over AQ or registers 2024-03-05 09:49:21 -08: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_virtchnl.c iavf: add support for offloading tc U32 cls filters 2024-08-13 14:51:29 -07:00
ice_virtchnl.h ice: use relative VSI index for VFs instead of PF VSI number 2024-03-04 10:24:13 -08:00
ice_vlan_mode.c
ice_vlan_mode.h
ice_vlan.h
ice_vsi_vlan_lib.c ice: fix accounting if a VLAN already exists 2024-05-27 17:11:43 -07:00
ice_vsi_vlan_lib.h
ice_vsi_vlan_ops.c ice: remove switchdev control plane VSI 2024-03-25 13:08:05 -07:00
ice_vsi_vlan_ops.h
ice_xsk.c ice: xsk: fix txq interrupt mapping 2024-07-29 08:52:29 -07:00
ice_xsk.h ice: improve updating ice_{t,r}x_ring::xsk_pool 2024-07-29 08:52:29 -07:00
ice.h ice: improve updating ice_{t,r}x_ring::xsk_pool 2024-07-29 08:52:29 -07:00
Makefile ice: add parser execution main loop 2024-08-13 14:51:28 -07:00