svn commit: r366458 - stable/12/sys/dev/cxgbe
Navdeep Parhar
np at FreeBSD.org
Mon Oct 5 18:49:56 UTC 2020
Author: np
Date: Mon Oct 5 18:49:55 2020
New Revision: 366458
URL: https://svnweb.freebsd.org/changeset/base/366458
Log:
MFC r366245:
cxgbe(4): adjust the doorbell threshold for netmap freelists to match the
maximum burst size used when fetching descriptors from the list.
Sponsored by: Chelsio Communications
Modified:
stable/12/sys/dev/cxgbe/adapter.h
stable/12/sys/dev/cxgbe/t4_netmap.c
Directory Properties:
stable/12/ (props changed)
Modified: stable/12/sys/dev/cxgbe/adapter.h
==============================================================================
--- stable/12/sys/dev/cxgbe/adapter.h Mon Oct 5 18:47:12 2020 (r366457)
+++ stable/12/sys/dev/cxgbe/adapter.h Mon Oct 5 18:49:55 2020 (r366458)
@@ -716,6 +716,7 @@ struct sge_nm_rxq {
uint32_t fl_sidx2; /* copy of fl_sidx */
uint32_t fl_db_val;
u_int fl_db_saved;
+ u_int fl_db_threshold; /* in descriptors */
u_int fl_hwidx:4;
/*
Modified: stable/12/sys/dev/cxgbe/t4_netmap.c
==============================================================================
--- stable/12/sys/dev/cxgbe/t4_netmap.c Mon Oct 5 18:47:12 2020 (r366457)
+++ stable/12/sys/dev/cxgbe/t4_netmap.c Mon Oct 5 18:49:55 2020 (r366458)
@@ -196,6 +196,9 @@ alloc_nm_rxq_hwq(struct vi_info *vi, struct sge_nm_rxq
nm_rxq->fl_cntxt_id = be16toh(c.fl0id);
nm_rxq->fl_pidx = nm_rxq->fl_cidx = 0;
+ nm_rxq->fl_db_saved = 0;
+ /* matches the X_FETCHBURSTMAX_512B or X_FETCHBURSTMAX_256B above. */
+ nm_rxq->fl_db_threshold = chip_id(sc) <= CHELSIO_T5 ? 8 : 4;
MPASS(nm_rxq->fl_sidx == na->num_rx_desc);
cntxt_id = nm_rxq->fl_cntxt_id - sc->sge.eq_start;
if (cntxt_id >= sc->sge.neq) {
@@ -1063,7 +1066,7 @@ cxgbe_netmap_rxsync(struct netmap_kring *kring, int fl
fl_pidx = 0;
slot = &ring->slot[0];
}
- if (++dbinc == 8 && n >= 32) {
+ if (++dbinc == nm_rxq->fl_db_threshold) {
wmb();
if (starve_fl)
nm_rxq->fl_db_saved += dbinc;
More information about the svn-src-stable-12
mailing list