From nobody Wed Aug 23 12:47:47 2023 X-Original-To: dev-commits-src-main@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 4RW5bR6NJXz4qZGT; Wed, 23 Aug 2023 12:47:47 +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 4RW5bR5g6gz3SZp; Wed, 23 Aug 2023 12:47:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692794867; 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=bgKrxf4WRTlPj3/jGFZ5l2LmxLL3XvAhdUnio4ms9U8=; b=S3eGnhlf7GYskc7bFQdT3aGQ24b9ZUUH+IkVoI9No4ynADemgrUrmVXRiiiEO2Ijy+8CCi rLBXeFkd5DIxMF8PpydqHqOaDdm4q3dEGjkd2ASsqAi4yYcdF2yfRBof0C3EMDD1xEN1lC bb97fEI7y7ThGD9WvQARKyda6q3D+OmPPhSI4OXCgZV0+TkRtlZofxzAuvpUkUDLTAS/bc tmvB/nYUQEr6Myx1ME4XF4oQX5YmBiBDHgH0VTyj/g/WsBkvIE6GCUp3sFaAmr1DUBFfKd E98CegYcfZ0TFqrVdnGG/K5YG/L5GpP7Z3Etv+n+6SS43D1WDKL/9JBUTGd3SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692794867; 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=bgKrxf4WRTlPj3/jGFZ5l2LmxLL3XvAhdUnio4ms9U8=; b=VJHYozVAPZS3EFTOGVissny81WRG+RcANqw9EgffidNwi4Rn7a7fnQC9rItUlSvvDm9Sp8 66acwQKYa2ihf2p9Jvm+PD42/zqqcTxK6fufUcAinTSVlKDzqWujXgC31XADDI8IKwfwW+ TjLiV8r6f1R/IpelbLvuQ7JxGD8Qy9H5dipGXKGxNHYEn++tcMlagg6NICxIIlGXUSBnpt VkdTVj5nUHeE0RqSqP6KqbgI5mJrTicQnso2BmKMxn+Fj67YVwanwWG4ADgljb2HzJJSR0 udsLkFoVQPjTjkmMNhyb7f3LDmu+dZ1VoMksfyAjTErfeykte7rkwWRNmaUbag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692794867; a=rsa-sha256; cv=none; b=yKqsUSNZbMeb7pEfy+KzRjlq40kKxKYmWdlZp8baCNRbEjKsDofSYBcCX8hYgbDYO3a1rx 2mqJ88jvPlRfaRFxxNiW1KlCL8gw+SLkddj9zL95OT+c9AcBXi4n5zr/2lvqMVAVnlMxJZ 9UXIeK9iZ90coHrN4UCK4shLRKTKsXx+/2FqEIEmZChwQfY/YgTiQ4GK3Zp32ShUIhl0sy us0scVUDXn43Lxc0kJN8tu7v6IpqpulSc3pnMvZiZS3OIhn2iulW9/A2WocZhzldH0i2Y+ tRB30gpfyRWMoEHZCuBTuEpLqXPXH+8LJUrOZk80NeHN/qeh/FgDds2VbrrhWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4RW5bR494bzlZK; Wed, 23 Aug 2023 12:47:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37NCllBn042509; Wed, 23 Aug 2023 12:47:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37NCllfv042506; Wed, 23 Aug 2023 12:47:47 GMT (envelope-from git) Date: Wed, 23 Aug 2023 12:47:47 GMT Message-Id: <202308231247.37NCllfv042506@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Kubaj Subject: git: 0834f13da9e3 - main - iavf: remove compatibility code and address some warnings List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pkubaj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0834f13da9e3b2912368f9ee3467997cd76911a4 Auto-Submitted: auto-generated The branch main has been updated by pkubaj: URL: https://cgit.FreeBSD.org/src/commit/?id=0834f13da9e3b2912368f9ee3467997cd76911a4 commit 0834f13da9e3b2912368f9ee3467997cd76911a4 Author: Piotr Kubaj AuthorDate: 2023-08-22 10:45:56 +0000 Commit: Piotr Kubaj CommitDate: 2023-08-23 12:48:11 +0000 iavf: remove compatibility code and address some warnings Code for pre-11 FreeBSD versions is removed. Also removed are macros that are not used anymore and "i" variable does not shadow anymore other "i" variable. Differential Revision: https://reviews.freebsd.org/D41547 Approved by: erj --- sys/dev/iavf/iavf_iflib.h | 3 --- sys/dev/iavf/iavf_lib.h | 14 -------------- sys/dev/iavf/iavf_vc_common.c | 34 +++++++++++----------------------- sys/dev/iavf/if_iavf_iflib.c | 4 ++-- 4 files changed, 13 insertions(+), 42 deletions(-) diff --git a/sys/dev/iavf/iavf_iflib.h b/sys/dev/iavf/iavf_iflib.h index 927c89fceeed..ec083d66a209 100644 --- a/sys/dev/iavf/iavf_iflib.h +++ b/sys/dev/iavf/iavf_iflib.h @@ -122,9 +122,6 @@ ((struct iavf_sc *)iflib_get_softc(_ctx)) /* Use the correct assert function for each lock type */ -#define IFLIB_CTX_ASSERT(_ctx) \ - sx_assert(iflib_ctx_lock_get(_ctx), SA_XLOCKED) - #define IAVF_VC_LOCK(_sc) mtx_lock(&(_sc)->vc_mtx) #define IAVF_VC_UNLOCK(_sc) mtx_unlock(&(_sc)->vc_mtx) #define IAVF_VC_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->vc_mtx) diff --git a/sys/dev/iavf/iavf_lib.h b/sys/dev/iavf/iavf_lib.h index d560d971b0f6..f3ccd9f0c52f 100644 --- a/sys/dev/iavf/iavf_lib.h +++ b/sys/dev/iavf/iavf_lib.h @@ -204,20 +204,6 @@ MALLOC_DECLARE(M_IAVF); IAVF_DEFAULT_RSS_HENA_BASE | \ IAVF_DEFAULT_ADV_RSS_HENA) -/* Pre-11 counter(9) compatibility */ -#define IAVF_SET_IPACKETS(vsi, count) (vsi)->ipackets = (count) -#define IAVF_SET_IERRORS(vsi, count) (vsi)->ierrors = (count) -#define IAVF_SET_OPACKETS(vsi, count) (vsi)->opackets = (count) -#define IAVF_SET_OERRORS(vsi, count) (vsi)->oerrors = (count) -#define IAVF_SET_COLLISIONS(vsi, count) /* Do nothing; collisions is always 0. */ -#define IAVF_SET_IBYTES(vsi, count) (vsi)->ibytes = (count) -#define IAVF_SET_OBYTES(vsi, count) (vsi)->obytes = (count) -#define IAVF_SET_IMCASTS(vsi, count) (vsi)->imcasts = (count) -#define IAVF_SET_OMCASTS(vsi, count) (vsi)->omcasts = (count) -#define IAVF_SET_IQDROPS(vsi, count) (vsi)->iqdrops = (count) -#define IAVF_SET_OQDROPS(vsi, count) (vsi)->oqdrops = (count) -#define IAVF_SET_NOPROTO(vsi, count) (vsi)->noproto = (count) - /* For stats sysctl naming */ #define IAVF_QUEUE_NAME_LEN 32 diff --git a/sys/dev/iavf/iavf_vc_common.c b/sys/dev/iavf/iavf_vc_common.c index 4577757090f5..8f45fe044094 100644 --- a/sys/dev/iavf/iavf_vc_common.c +++ b/sys/dev/iavf/iavf_vc_common.c @@ -39,10 +39,6 @@ */ #include "iavf_vc_common.h" -/* busy wait delay in msec */ -#define IAVF_BUSY_WAIT_DELAY 10 -#define IAVF_BUSY_WAIT_COUNT 50 - /* Static function decls */ static void iavf_handle_link_event(struct iavf_sc *sc, struct virtchnl_pf_event *vpe); @@ -662,27 +658,19 @@ void iavf_update_stats_counters(struct iavf_sc *sc, struct iavf_eth_stats *es) { struct iavf_vsi *vsi = &sc->vsi; - uint64_t tx_discards; - - tx_discards = es->tx_discards; /* Update ifnet stats */ - IAVF_SET_IPACKETS(vsi, es->rx_unicast + - es->rx_multicast + - es->rx_broadcast); - IAVF_SET_OPACKETS(vsi, es->tx_unicast + - es->tx_multicast + - es->tx_broadcast); - IAVF_SET_IBYTES(vsi, es->rx_bytes); - IAVF_SET_OBYTES(vsi, es->tx_bytes); - IAVF_SET_IMCASTS(vsi, es->rx_multicast); - IAVF_SET_OMCASTS(vsi, es->tx_multicast); - - IAVF_SET_OERRORS(vsi, es->tx_errors); - IAVF_SET_IQDROPS(vsi, es->rx_discards); - IAVF_SET_OQDROPS(vsi, tx_discards); - IAVF_SET_NOPROTO(vsi, es->rx_unknown_protocol); - IAVF_SET_COLLISIONS(vsi, 0); + vsi->ipackets = es->rx_unicast + es->rx_multicast + es->rx_broadcast; + vsi->opackets = es->tx_unicast + es->tx_multicast + es->tx_broadcast; + vsi->ibytes = es->rx_bytes; + vsi->obytes = es->tx_bytes; + vsi->imcasts = es->rx_multicast; + vsi->omcasts = es->tx_multicast; + + vsi->oerrors = es->tx_errors; + vsi->iqdrops = es->rx_discards; + vsi->oqdrops = es->tx_discards; + vsi->noproto = es->rx_unknown_protocol; vsi->eth_stats = *es; } diff --git a/sys/dev/iavf/if_iavf_iflib.c b/sys/dev/iavf/if_iavf_iflib.c index d53e59e29b51..b2531b797941 100644 --- a/sys/dev/iavf/if_iavf_iflib.c +++ b/sys/dev/iavf/if_iavf_iflib.c @@ -728,7 +728,7 @@ iavf_if_init(if_ctx_t ctx) INIT_DBG_IF(ifp, "begin"); - IFLIB_CTX_ASSERT(ctx); + sx_assert(iflib_ctx_lock_get(ctx), SA_XLOCKED); error = iavf_reset_complete(hw); if (error) { @@ -870,7 +870,7 @@ iavf_if_msix_intr_assign(if_ctx_t ctx, int msix __unused) fail: iflib_irq_free(ctx, &vsi->irq); rx_que = vsi->rx_queues; - for (int i = 0; i < vsi->num_rx_queues; i++, rx_que++) + for (i = 0; i < vsi->num_rx_queues; i++, rx_que++) iflib_irq_free(ctx, &rx_que->que_irq); return (err); }