summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authordavidcs <davidcs@FreeBSD.org>2015-04-07 18:04:18 +0000
committerdavidcs <davidcs@FreeBSD.org>2015-04-07 18:04:18 +0000
commit788993fc41f2549c7ca282a9e1bc3ca4dd88596e (patch)
tree97a1e6b4a5393ca53a52915e057be55d52e8c62f /sys/dev
parent5ac556fbb884358c57287b3ce67b5244c2192fdd (diff)
downloadFreeBSD-src-788993fc41f2549c7ca282a9e1bc3ca4dd88596e.zip
FreeBSD-src-788993fc41f2549c7ca282a9e1bc3ca4dd88596e.tar.gz
MFC r281006
When an mbuf allocation fails in the receive path, the mbuf containing the received packet is not sent to the host network stack and is reused again on the receive ring. Remaining received packets in the ring are not processed in that invocation of bxe_rxeof() and defered to the task thread
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/bxe/bxe.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/dev/bxe/bxe.c b/sys/dev/bxe/bxe.c
index f66e216..5a56a46 100644
--- a/sys/dev/bxe/bxe.c
+++ b/sys/dev/bxe/bxe.c
@@ -3257,7 +3257,7 @@ bxe_rxeof(struct bxe_softc *sc,
uint16_t bd_cons, bd_prod, bd_prod_fw, comp_ring_cons;
uint16_t hw_cq_cons, sw_cq_cons, sw_cq_prod;
int rx_pkts = 0;
- int rc;
+ int rc = 0;
BXE_FP_RX_LOCK(fp);
@@ -3399,6 +3399,10 @@ bxe_rxeof(struct bxe_softc *sc,
(sc->max_rx_bufs != RX_BD_USABLE) ?
bd_prod : bd_cons);
if (rc != 0) {
+
+ /* we simply reuse the received mbuf and don't post it to the stack */
+ m = NULL;
+
BLOGE(sc, "mbuf alloc fail for fp[%02d] rx chain (%d)\n",
fp->index, rc);
fp->eth_q_stats.rx_soft_errors++;
@@ -3487,6 +3491,9 @@ next_cqe:
sw_cq_cons = RCQ_NEXT(sw_cq_cons);
/* limit spinning on the queue */
+ if (rc != 0)
+ break;
+
if (rx_pkts == sc->rx_budget) {
fp->eth_q_stats.rx_budget_reached++;
break;
OpenPOWER on IntegriCloud