Commit 69a1fbc6 authored by HardenedBSD Sync Service's avatar HardenedBSD Sync Service
Browse files

Merge branch 'freebsd/current/main' into hardened/current/master

parents 3bc428ad 90bc1cf6
......@@ -349,7 +349,7 @@ tws_detach(device_t dev)
{
struct tws_softc *sc = device_get_softc(dev);
int i;
u_int32_t reg __diagused;
u_int32_t reg __tws_debug;
TWS_TRACE_DEBUG(sc, "entry", 0, 0);
......
......@@ -82,7 +82,7 @@ void tws_display_ctlr_info(struct tws_softc *sc);
int
tws_init_ctlr(struct tws_softc *sc)
{
u_int64_t reg __diagused;
u_int64_t reg __tws_debug;
u_int32_t regh, regl;
TWS_TRACE_DEBUG(sc, "entry", sc, sc->is64bit);
......
......@@ -61,10 +61,12 @@ void tws_init_qs(struct tws_softc *sc);
#endif
#ifdef TWS_TRACE_DEBUG_ON
#define __tws_debug
#define TWS_TRACE_DEBUG(sc, desc, val1, val2) \
tws_trace(__FILE__, __func__, __LINE__, sc, desc, \
(u_int64_t)val1, (u_int64_t)val2)
#else
#define __tws_debug __unused
#define TWS_TRACE_DEBUG(sc, desc, val1, val2)
#endif
......
......@@ -239,13 +239,14 @@ getnextcpuevent(int idle)
/* Handle hardclock() events, skipping some if CPU is idle. */
event = state->nexthard;
if (idle) {
hardfreq = (u_int)hz / 2;
if (tc_min_ticktock_freq > 2
if (tc_min_ticktock_freq > 1
#ifdef SMP
&& curcpu == CPU_FIRST()
#endif
)
hardfreq = hz / tc_min_ticktock_freq;
else
hardfreq = hz;
if (hardfreq > 1)
event += tick_sbt * (hardfreq - 1);
}
......
......@@ -434,8 +434,7 @@ callout_process(sbintime_t now)
struct callout_cpu *cc;
struct callout_list *sc;
struct thread *td;
sbintime_t first, last, max, tmp_max;
uint32_t lookahead;
sbintime_t first, last, lookahead, max, tmp_max;
u_int firstb, lastb, nowb;
#ifdef CALLOUT_PROFILING
int depth_dir = 0, mpcalls_dir = 0, lockcalls_dir = 0;
......@@ -455,7 +454,7 @@ callout_process(sbintime_t now)
else if (nowb - firstb == 1)
lookahead = (SBT_1S / 8);
else
lookahead = (SBT_1S / 2);
lookahead = SBT_1S;
first = last = now;
first += (lookahead / 2);
last += lookahead;
......
......@@ -337,7 +337,6 @@ struct iflib_txq {
uint64_t ift_map_failed;
uint64_t ift_txd_encap_efbig;
uint64_t ift_pullups;
uint64_t ift_last_timer_tick;
struct mtx ift_mtx;
struct mtx ift_db_mtx;
......@@ -587,9 +586,9 @@ SYSCTL_INT(_net_iflib, OID_AUTO, min_tx_latency, CTLFLAG_RW,
static int iflib_no_tx_batch = 0;
SYSCTL_INT(_net_iflib, OID_AUTO, no_tx_batch, CTLFLAG_RW,
&iflib_no_tx_batch, 0, "minimize transmit latency at the possible expense of throughput");
static int iflib_timer_default = 1000;
SYSCTL_INT(_net_iflib, OID_AUTO, timer_default, CTLFLAG_RW,
&iflib_timer_default, 0, "number of ticks between iflib_timer calls");
static int iflib_timer_period = 500;
SYSCTL_INT(_net_iflib, OID_AUTO, timer_period, CTLFLAG_RW,
&iflib_timer_period, 0, "milliseconds between iflib_timer calls");
#if IFLIB_DEBUG_COUNTERS
......@@ -2393,7 +2392,6 @@ iflib_timer(void *arg)
iflib_txq_t txq = arg;
if_ctx_t ctx = txq->ift_ctx;
if_softc_ctx_t sctx = &ctx->ifc_softc_ctx;
uint64_t this_tick = ticks;
if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING))
return;
......@@ -2403,14 +2401,11 @@ iflib_timer(void *arg)
** can be done without the lock because its RO
** and the HUNG state will be static if set.
*/
if (this_tick - txq->ift_last_timer_tick >= iflib_timer_default) {
txq->ift_last_timer_tick = this_tick;
IFDI_TIMER(ctx, txq->ift_id);
if ((txq->ift_qstatus == IFLIB_QUEUE_HUNG) &&
((txq->ift_cleaned_prev == txq->ift_cleaned) ||
(sctx->isc_pause_frames == 0)))
goto hung;
if (txq->ift_qstatus != IFLIB_QUEUE_IDLE &&
ifmp_ring_is_stalled(txq->ift_br)) {
KASSERT(ctx->ifc_link_state == LINK_STATE_UP,
......@@ -2418,15 +2413,16 @@ iflib_timer(void *arg)
txq->ift_qstatus = IFLIB_QUEUE_HUNG;
}
txq->ift_cleaned_prev = txq->ift_cleaned;
}
/* handle any laggards */
if (txq->ift_db_pending)
GROUPTASK_ENQUEUE(&txq->ift_task);
sctx->isc_pause_frames = 0;
if (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING)
callout_reset_on(&txq->ift_timer, iflib_timer_default, iflib_timer,
txq, txq->ift_timer.c_cpu);
callout_reset_sbt_on(&txq->ift_timer,
iflib_timer_period * SBT_1MS, 0,
iflib_timer, txq, txq->ift_timer.c_cpu, C_PREL(1));
return;
hung:
......@@ -2544,8 +2540,9 @@ iflib_init_locked(if_ctx_t ctx)
IFDI_INTR_ENABLE(ctx);
txq = ctx->ifc_txqs;
for (i = 0; i < sctx->isc_ntxqsets; i++, txq++)
callout_reset_on(&txq->ift_timer, iflib_timer_default, iflib_timer, txq,
txq->ift_timer.c_cpu);
callout_reset_sbt_on(&txq->ift_timer,
iflib_timer_period * SBT_1MS, 0,
iflib_timer, txq, txq->ift_timer.c_cpu, C_PREL(1));
/* Re-enable txsync/rxsync. */
netmap_enable_all_rings(ifp);
......@@ -4067,8 +4064,9 @@ _task_fn_admin(void *context)
}
IFDI_UPDATE_ADMIN_STATUS(ctx);
for (txq = ctx->ifc_txqs, i = 0; i < sctx->isc_ntxqsets; i++, txq++) {
callout_reset_on(&txq->ift_timer, iflib_timer_default, iflib_timer, txq,
txq->ift_timer.c_cpu);
callout_reset_sbt_on(&txq->ift_timer,
iflib_timer_period * SBT_1MS, 0,
iflib_timer, txq, txq->ift_timer.c_cpu, C_PREL(1));
}
IFDI_LINK_INTR_ENABLE(ctx);
if (do_reset)
......@@ -5721,7 +5719,7 @@ iflib_device_iov_add_vf(device_t dev, uint16_t vfnum, const nvlist_t *params)
static int
iflib_module_init(void)
{
iflib_timer_default = hz / 2;
return (0);
}
......
......@@ -277,11 +277,8 @@ readsuper(void *devfd, struct fs **fsp, off_t sblockloc, int isaltsblk,
if (fs->fs_ckhash != (ckhash = ffs_calc_sbhash(fs))) {
if (chkhash == STDSB_NOMSG)
return (EINTEGRITY);
if (chkhash == STDSB_NOHASHFAIL_NOMSG) {
fs->fs_flags |= FS_NEEDSFSCK;
fs->fs_fmod = 1;
if (chkhash == STDSB_NOHASHFAIL_NOMSG)
return (0);
}
#ifdef _KERNEL
res = uprintf("Superblock check-hash failed: recorded "
"check-hash 0x%x != computed check-hash 0x%x%s\n",
......@@ -303,8 +300,6 @@ readsuper(void *devfd, struct fs **fsp, off_t sblockloc, int isaltsblk,
if (chkhash == STDSB)
return (EINTEGRITY);
/* chkhash == STDSB_NOHASHFAIL */
fs->fs_flags |= FS_NEEDSFSCK;
fs->fs_fmod = 1;
return (0);
}
/* Have to set for old filesystems that predate this field */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment