From nobody Sat Dec 18 22:49:31 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E7A331903561; Sat, 18 Dec 2021 22:49:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JGgyh26pCz3vgy; Sat, 18 Dec 2021 22:49:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A3FB177D9; Sat, 18 Dec 2021 22:49:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BIMnV7r093385; Sat, 18 Dec 2021 22:49:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BIMnVsY093384; Sat, 18 Dec 2021 22:49:31 GMT (envelope-from git) Date: Sat, 18 Dec 2021 22:49:31 GMT Message-Id: <202112182249.1BIMnVsY093384@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: e363f832cfb2 - main - if_oce: fix epoch handling List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e363f832cfb283a543fa8e47ebd9e51817994fde Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639867772; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7tJjCqaAabpmvD+chDkR9sAawsBCHY3mNHcp9kzls0I=; b=pI+aLL3fBnVFc5TUwuODkrvY7mGGIgHqxIQudQuKsYiFLn2azKzzIjxsgufgW3ULigqPVc liOF7bU53k6HztFNt2ej7IZn69vSgJ4Sh3GH1iOw7rKcVw3mkWS0hL4VWxzPwtjOAyxF1e byRzgNQ1uBZQ6762HRsYFZayXxGEiQdLMkitZauE3J+5yUT3fDbz6B4vTTmOTGU+RP3ASO mOesIxJbiFMLda87XSxc8yFNshcw+Eh6q/XEcpEqOrRsO/USliawFJxxCR1bfP0GewbNry cScxo1kKIKwbyzq4mra32GdfA0DtLqMwHX156bDkhNjIKm0TAs65E/olLXmGxw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639867772; a=rsa-sha256; cv=none; b=gXfwZNOBvMiBda4ULQnOEeWKVvNaAg/wQU/1Wox95lpCNM/TNohH+zayE4BvP/r9sKhcwH W6iMAy/nNGlxviysIpnqeRX49uLxzNDDsBaNoIK5VM6z7Bk+IvzUykND0RYbRnJucZ3vCc 9gCIQWGb3UJPkdjT2NKmICMdZoa3SVPhXGJhxYeAID9kJbOvcD7moLE4zqzYF6e9SLJY6f EmRWuOg+t3Ci0hlaKSMft+jBf0JRTPv/J3cTzaLe+eBYklUjdgWjfB6E+Wwc3rv6JARFGS sGtLji9ArwQvpgEoITLtLdn3OheuKGgVBFqgjc4JV2o4loWrbzMMC1eOUX4bcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e363f832cfb283a543fa8e47ebd9e51817994fde commit e363f832cfb283a543fa8e47ebd9e51817994fde Author: Michael Tuexen AuthorDate: 2021-12-18 22:43:00 +0000 Commit: Michael Tuexen CommitDate: 2021-12-18 22:43:00 +0000 if_oce: fix epoch handling Thanks to gallatin@ for suggesting the patch. PR: 260330 Reported by: Vincent Milum Jr. Reviewed by: gallatin, glebius Tested by: Vincent Milum Jr. MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D33395 --- sys/dev/oce/oce_if.c | 6 +++++- sys/dev/oce/oce_if.h | 1 + sys/dev/oce/oce_queue.c | 5 ++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sys/dev/oce/oce_if.c b/sys/dev/oce/oce_if.c index 271c35015a9f..1127565282c1 100644 --- a/sys/dev/oce/oce_if.c +++ b/sys/dev/oce/oce_if.c @@ -2039,14 +2039,17 @@ exit_rq_handler_lro: uint16_t oce_rq_handler(void *arg) { + struct epoch_tracker et; struct oce_rq *rq = (struct oce_rq *)arg; struct oce_cq *cq = rq->cq; POCE_SOFTC sc = rq->parent; struct oce_nic_rx_cqe *cqe; int num_cqes = 0; + NET_EPOCH_ENTER(et); if(rq->islro) { oce_rq_handler_lro(arg); + NET_EPOCH_EXIT(et); return 0; } LOCK(&rq->rx_lock); @@ -2090,6 +2093,7 @@ oce_rq_handler(void *arg) oce_check_rx_bufs(sc, num_cqes, rq); UNLOCK(&rq->rx_lock); + NET_EPOCH_EXIT(et); return 0; } @@ -2110,7 +2114,7 @@ oce_attach_ifp(POCE_SOFTC sc) ifmedia_add(&sc->media, IFM_ETHER | IFM_AUTO, 0, NULL); ifmedia_set(&sc->media, IFM_ETHER | IFM_AUTO); - sc->ifp->if_flags = IFF_BROADCAST | IFF_MULTICAST; + sc->ifp->if_flags = IFF_BROADCAST | IFF_MULTICAST | IFF_KNOWSEPOCH; sc->ifp->if_ioctl = oce_ioctl; sc->ifp->if_start = oce_start; sc->ifp->if_init = oce_init; diff --git a/sys/dev/oce/oce_if.h b/sys/dev/oce/oce_if.h index 8938dd86ecce..c7386aab68f8 100644 --- a/sys/dev/oce/oce_if.h +++ b/sys/dev/oce/oce_if.h @@ -42,6 +42,7 @@ #include #include +#include #include #include #include diff --git a/sys/dev/oce/oce_queue.c b/sys/dev/oce/oce_queue.c index 04c92a5f397b..da4d33065d40 100644 --- a/sys/dev/oce/oce_queue.c +++ b/sys/dev/oce/oce_queue.c @@ -1233,13 +1233,15 @@ oce_rx_cq_clean(struct oce_rq *rq) void oce_stop_rx(POCE_SOFTC sc) { + struct epoch_tracker et; struct oce_mbx mbx; struct mbx_delete_nic_rq *fwcmd; struct mbx_delete_nic_rq_v1 *fwcmd1; struct oce_rq *rq; int i = 0; - /* before deleting disable hwlro */ + NET_EPOCH_ENTER(et); + /* before deleting disable hwlro */ if(sc->enable_hwlro) oce_mbox_nic_set_iface_lro_config(sc, 0); @@ -1274,6 +1276,7 @@ oce_stop_rx(POCE_SOFTC sc) UNLOCK(&rq->rx_lock); } } + NET_EPOCH_EXIT(et); } int