cxgbe/t4_tom: completely avoid L2T entries during stop/suspend.

1. Mark the L2T entry valid only if t4_write_l2e succeeds, which won't
   happen if the adapter is stopped.  This prevents L2T entries from
   sometimes getting (re)promoted to VALID on Tx activity during stop.
2. Discard a work request immediately instead of enqueueing it to the
   arp queue if the adapter is stopped.

Fixes:	c1c524852f cxgbe/t4_tom: Implement uld_stop and uld_restart for ULD_TOM.
MFC after:	1 week
Sponsored by:	Chelsio Communications
This commit is contained in:
Navdeep Parhar 2024-09-13 21:23:23 -07:00
parent 855c3dacfc
commit 07f47e8850

View file

@ -212,20 +212,18 @@ update_entry(struct adapter *sc, struct l2t_entry *e, uint8_t *lladdr,
e->state = L2T_STATE_STALE;
} else {
} else if (e->state == L2T_STATE_RESOLVING ||
e->state == L2T_STATE_FAILED ||
memcmp(e->dmac, lladdr, ETHER_ADDR_LEN)) {
if (e->state == L2T_STATE_RESOLVING ||
e->state == L2T_STATE_FAILED ||
memcmp(e->dmac, lladdr, ETHER_ADDR_LEN)) {
/* unresolved -> resolved; or dmac changed */
/* unresolved -> resolved; or dmac changed */
memcpy(e->dmac, lladdr, ETHER_ADDR_LEN);
e->vlan = vtag;
t4_write_l2e(e, 1);
}
memcpy(e->dmac, lladdr, ETHER_ADDR_LEN);
e->vlan = vtag;
if (t4_write_l2e(e, 1) == 0)
e->state = L2T_STATE_VALID;
} else
e->state = L2T_STATE_VALID;
}
}
static int
@ -291,7 +289,10 @@ t4_l2t_send_slow(struct adapter *sc, struct wrqe *wr, struct l2t_entry *e)
mtx_unlock(&e->lock);
goto again;
}
arpq_enqueue(e, wr);
if (adapter_stopped(sc))
free(wr, M_CXGBE);
else
arpq_enqueue(e, wr);
mtx_unlock(&e->lock);
if (resolve_entry(sc, e) == EWOULDBLOCK)