mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-23 11:18:54 +00:00
Avoid deadlock in fxp driver when system runs out of mbufs.
MFC after: 1 week Provided by: Ernie Smallis <esmallis@stbernard.com>
This commit is contained in:
parent
e7acea8202
commit
1026fbd360
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=147282
@ -1576,6 +1576,7 @@ fxp_intr_body(struct fxp_softc *sc, struct ifnet *ifp, uint8_t statack,
|
||||
struct fxp_rx *rxp;
|
||||
struct fxp_rfa *rfa;
|
||||
int rnr = (statack & FXP_SCB_STATACK_RNR) ? 1 : 0;
|
||||
int fxp_rc = 0;
|
||||
|
||||
FXP_LOCK_ASSERT(sc, MA_OWNED);
|
||||
if (rnr)
|
||||
@ -1666,7 +1667,8 @@ fxp_intr_body(struct fxp_softc *sc, struct ifnet *ifp, uint8_t statack,
|
||||
* If this fails, the old buffer is recycled
|
||||
* instead.
|
||||
*/
|
||||
if (fxp_add_rfabuf(sc, rxp) == 0) {
|
||||
fxp_rc = fxp_add_rfabuf(sc, rxp);
|
||||
if (fxp_rc == 0) {
|
||||
int total_len;
|
||||
|
||||
/*
|
||||
@ -1718,6 +1720,9 @@ fxp_intr_body(struct fxp_softc *sc, struct ifnet *ifp, uint8_t statack,
|
||||
FXP_UNLOCK(sc);
|
||||
(*ifp->if_input)(ifp, m);
|
||||
FXP_LOCK(sc);
|
||||
} else if (fxp_rc == ENOBUFS) {
|
||||
rnr = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (rnr) {
|
||||
|
Loading…
Reference in New Issue
Block a user