aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ixgbe
diff options
context:
space:
mode:
authorEric Joyner <erj@FreeBSD.org>2018-10-14 05:09:43 +0000
committerEric Joyner <erj@FreeBSD.org>2018-10-14 05:09:43 +0000
commitadf93b56dc59e43a2a953f2809a5120e0c39610e (patch)
treed3db419c8da9cd4facf081c374c85d1da4e07e56 /sys/dev/ixgbe
parentbfe5c1dcd44ecd4b6accdb53369544722fda0e36 (diff)
downloadsrc-adf93b56dc59e43a2a953f2809a5120e0c39610e.tar.gz
src-adf93b56dc59e43a2a953f2809a5120e0c39610e.zip
em/igb/ix(4): Port two Tx/Rx fixes made to ixl in r339338
- Fix assert/panic on receive when Jumbo Frames are enabled. From the commit I made to ixl: "It turns out that *_isc_rxd_available is supposed to return how many packets are available to be cleaned on the rx ring. This patch removes a section of code where if the budget argument is 1, the function would return one if there was a descriptor available, not necessarily a packet. This is okay in regular mtu 1500 traffic since the max frame size is less than the configured receive buffer size (2048), but this doesn't work when received packets can span more than one descriptor, as is the case when the mtu is 9000 and the receive buffer size is 4096." - Fix possible Tx hang because *_isc_txd_credits_update returns incorrect result From the commit by Krzysztof Galazka to ixl: "Function isc_txd_update_credits called with clear set to false should return 1 if there are TX descriptors already handled by HW. It was always returning 0 causing troubles with UDP TX traffic." PR: 231659 Reported by: lev@ Approved by: re (gjb@) Sponsored by: Intel Corporation
Notes
Notes: svn path=/head/; revision=339354
Diffstat (limited to 'sys/dev/ixgbe')
-rw-r--r--sys/dev/ixgbe/ix_txrx.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/sys/dev/ixgbe/ix_txrx.c b/sys/dev/ixgbe/ix_txrx.c
index 91c92c56a6df..63a29d69d5f9 100644
--- a/sys/dev/ixgbe/ix_txrx.c
+++ b/sys/dev/ixgbe/ix_txrx.c
@@ -285,8 +285,13 @@ ixgbe_isc_txd_credits_update(void *arg, uint16_t txqid, bool clear)
status = txr->tx_base[cur].wb.status;
updated = !!(status & IXGBE_TXD_STAT_DD);
- if (clear == false || updated == 0)
- return (updated);
+ if (!updated)
+ return (0);
+
+ /* If clear is false just let caller know that there
+ * are descriptors to reclaim */
+ if (!clear)
+ return (1);
prev = txr->tx_cidx_processed;
ntxd = scctx->isc_ntxd[0];
@@ -362,17 +367,8 @@ ixgbe_isc_rxd_available(void *arg, uint16_t qsidx, qidx_t pidx, qidx_t budget)
u32 staterr;
int cnt, i, nrxd;
- if (budget == 1) {
- rxd = &rxr->rx_base[pidx];
- staterr = le32toh(rxd->wb.upper.status_error);
-
- return (staterr & IXGBE_RXD_STAT_DD);
- }
-
nrxd = sc->shared->isc_nrxd[0];
- // em has cnt < nrxd. off by 1 here or there?
-// for (cnt = 0, i = pidx; cnt < nrxd && cnt <= budget;) {
- for (cnt = 0, i = pidx; cnt < nrxd-1 && cnt <= budget;) {
+ for (cnt = 0, i = pidx; cnt < nrxd && cnt <= budget;) {
rxd = &rxr->rx_base[i];
staterr = le32toh(rxd->wb.upper.status_error);
@@ -383,7 +379,6 @@ ixgbe_isc_rxd_available(void *arg, uint16_t qsidx, qidx_t pidx, qidx_t budget)
if (staterr & IXGBE_RXD_STAT_EOP)
cnt++;
}
-
return (cnt);
} /* ixgbe_isc_rxd_available */