-/* $OpenBSD: qwx.c,v 1.51 2024/02/22 21:21:35 stsp Exp $ */
+/* $OpenBSD: qwx.c,v 1.52 2024/02/24 15:21:39 cheloha Exp $ */
/*
* Copyright 2023 Stefan Sperling <stsp@openbsd.org>
struct qwx_softc *sc = dp->sc;
struct dp_rx_tid *rx_tid = ctx;
struct dp_reo_cache_flush_elem *elem, *tmp;
- time_t now;
+ uint64_t now;
if (status == HAL_REO_CMD_DRAIN) {
goto free_desc;
if (!elem)
goto free_desc;
- now = gettime();
+ now = getnsecuptime();
elem->ts = now;
memcpy(&elem->data, rx_tid, sizeof(*rx_tid));
/* Flush and invalidate aged REO desc from HW cache */
TAILQ_FOREACH_SAFE(elem, &dp->reo_cmd_cache_flush_list, entry, tmp) {
if (dp->reo_cmd_cache_flush_count > DP_REO_DESC_FREE_THRESHOLD ||
- now < elem->ts + DP_REO_DESC_FREE_TIMEOUT_MS) {
+ now >= elem->ts + MSEC_TO_NSEC(DP_REO_DESC_FREE_TIMEOUT_MS)) {
TAILQ_REMOVE(&dp->reo_cmd_cache_flush_list, elem, entry);
dp->reo_cmd_cache_flush_count--;
#ifdef notyet
-/* $OpenBSD: qwxvar.h,v 1.22 2024/02/22 09:08:08 stsp Exp $ */
+/* $OpenBSD: qwxvar.h,v 1.23 2024/02/24 15:21:39 cheloha Exp $ */
/*
* Copyright (c) 2018-2019 The Linux Foundation.
struct dp_reo_cache_flush_elem {
TAILQ_ENTRY(dp_reo_cache_flush_elem) entry;
struct dp_rx_tid data;
- unsigned long ts;
+ uint64_t ts;
};
TAILQ_HEAD(dp_reo_cmd_cache_flush_head, dp_reo_cache_flush_elem);