Page MenuHomeFreeBSD

D58607.diff
No OneTemporary

D58607.diff

diff --git a/sys/dev/bnxt/bnxt_en/bnxt.h b/sys/dev/bnxt/bnxt_en/bnxt.h
--- a/sys/dev/bnxt/bnxt_en/bnxt.h
+++ b/sys/dev/bnxt/bnxt_en/bnxt.h
@@ -1350,6 +1350,9 @@
struct bnxt_nvram_info *nvm_info;
bool wol;
bool is_dev_init;
+ /* Cross-thread flag; access only via atomic_load_acq_int()/
+ * atomic_store_rel_int(), never as a plain bool. */
+ volatile int detached;
struct bnxt_hw_lro hw_lro;
uint8_t wol_filter_id;
uint16_t rx_coal_usecs;
diff --git a/sys/dev/bnxt/bnxt_en/if_bnxt.c b/sys/dev/bnxt/bnxt_en/if_bnxt.c
--- a/sys/dev/bnxt/bnxt_en/if_bnxt.c
+++ b/sys/dev/bnxt/bnxt_en/if_bnxt.c
@@ -3202,6 +3202,11 @@
struct bnxt_vlan_tag *tmp;
int i;
+ /* Set first: the admin task isn't drained before IFDI_DETACH and can
+ * still fire concurrently, so it must see this immediately via
+ * atomic_store_rel_int()/atomic_load_acq_int(). */
+ atomic_store_rel_int(&softc->detached, 1);
+
bnxt_mpc_irq_cleanup(softc);
bnxt_rdma_aux_device_uninit(softc);
cancel_delayed_work_sync(&softc->fw_reset_task);
@@ -4217,6 +4222,9 @@
if (!BNXT_PF(softc))
return;
+ if (atomic_load_acq_int(&softc->detached))
+ return;
+
bnxt_hwrm_port_qstats(softc);
if (BNXT_CHIP_P5_PLUS(softc) &&

File Metadata

Mime Type
text/plain
Expires
Mon, Oct 12, 10:51 PM (12 h, 47 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40708493
Default Alt Text
D58607.diff (1 KB)

Event Timeline