File tree Expand file tree Collapse file tree
vm/devices/net/mana_driver/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1495,15 +1495,16 @@ impl<T: DeviceBacking> GdmaDriver<T> {
14951495 )
14961496 . await
14971497 }
1498+
1499+ /// Returns true if the HWC has failed and no further requests will succeed.
1500+ pub fn hwc_failure ( & self ) -> bool {
1501+ self . hwc_failure
1502+ }
14981503}
14991504
15001505#[ cfg( test) ]
15011506impl < T : DeviceBacking > GdmaDriver < T > {
15021507 pub ( crate ) fn hwc_timeout_in_ms ( & self ) -> u32 {
15031508 self . hwc_timeout_in_ms
15041509 }
1505-
1506- pub ( crate ) fn hwc_failure ( & self ) -> bool {
1507- self . hwc_failure
1508- }
15091510}
Original file line number Diff line number Diff line change @@ -63,12 +63,23 @@ impl ResourceArena {
6363 }
6464
6565 pub ( crate ) async fn destroy < T : DeviceBacking > ( mut self , gdma : & mut GdmaDriver < T > ) {
66+ // When HWC has already failed, skip sending teardown commands for HWC resources:
67+ // DmaRegion, Eq, BnicQueue. HWC requests all fail: "Previous hardware failure".
68+ // Device should reclaim resources on its own reset.
69+ let skip_hwc = gdma. hwc_failure ( ) ;
70+ if skip_hwc {
71+ tracing:: info!(
72+ count = self . resources. len( ) ,
73+ "skipping HWC resource teardown after hardware failure"
74+ ) ;
75+ }
6676 for resource in self . resources . drain ( ..) . rev ( ) {
6777 let r = match resource {
6878 Resource :: MemoryBlock ( mem) => {
6979 drop ( ManuallyDrop :: into_inner ( mem) ) ;
7080 Ok ( ( ) )
7181 }
82+ _ if skip_hwc => continue ,
7283 Resource :: DmaRegion {
7384 dev_id,
7485 gdma_region,
You can’t perform that action at this time.
0 commit comments