diff options
| author | Przemek Kitszel <[email protected]> | 2023-08-08 21:54:16 +0000 |
|---|---|---|
| committer | Tony Nguyen <[email protected]> | 2023-08-17 20:59:46 +0000 |
| commit | b214b98a7fc4dfcce7b67b2e08a22b7fe62c55d0 (patch) | |
| tree | 3d44d8e4873de0eb7fae4c3118c089c4727bd33a /drivers/net/ethernet/intel/ice/ice.h | |
| parent | ice: ice_aq_check_events: fix off-by-one check when filling buffer (diff) | |
| download | kernel-b214b98a7fc4dfcce7b67b2e08a22b7fe62c55d0.tar.gz kernel-b214b98a7fc4dfcce7b67b2e08a22b7fe62c55d0.zip | |
ice: embed &ice_rq_event_info event into struct ice_aq_task
Expose struct ice_aq_task to callers,
what takes burden of memory ownership out from AQ-wait family of functions,
and reduces need for heap-based allocations.
Embed struct ice_rq_event_info event into struct ice_aq_task
(instead of it being a ptr) to remove some more code from the callers.
Subsequent commit will improve more based on this one.
Reviewed-by: Jacob Keller <[email protected]>
Signed-off-by: Przemek Kitszel <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Tested-by: Pucha Himasekhar Reddy <[email protected]> (A Contingent worker at Intel)
Reviewed-by: Leon Romanovsky <[email protected]>
Signed-off-by: Tony Nguyen <[email protected]>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice.h')
| -rw-r--r-- | drivers/net/ethernet/intel/ice/ice.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h index 5ac0ad12f9f1..9a334287bd92 100644 --- a/drivers/net/ethernet/intel/ice/ice.h +++ b/drivers/net/ethernet/intel/ice/ice.h @@ -917,8 +917,22 @@ void ice_fdir_release_flows(struct ice_hw *hw); void ice_fdir_replay_flows(struct ice_hw *hw); void ice_fdir_replay_fltrs(struct ice_pf *pf); int ice_fdir_create_dflt_rules(struct ice_pf *pf); -int ice_aq_wait_for_event(struct ice_pf *pf, u16 opcode, unsigned long timeout, - struct ice_rq_event_info *event); + +enum ice_aq_task_state { + ICE_AQ_TASK_WAITING, + ICE_AQ_TASK_COMPLETE, + ICE_AQ_TASK_CANCELED, +}; + +struct ice_aq_task { + struct hlist_node entry; + struct ice_rq_event_info event; + enum ice_aq_task_state state; + u16 opcode; +}; + +int ice_aq_wait_for_event(struct ice_pf *pf, struct ice_aq_task *task, + u16 opcode, unsigned long timeout); int ice_open(struct net_device *netdev); int ice_open_internal(struct net_device *netdev); int ice_stop(struct net_device *netdev); |
