From nobody Tue Feb 15 07:33:11 2022 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 0AB6A19B2683; Tue, 15 Feb 2022 07:33:12 +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 4JyXr76pdgz3P9q; Tue, 15 Feb 2022 07:33:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644910392; 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=bl57ru5LPzmFdbxA6gejY8PJxWlxJ0DTvpyuG1HPeRI=; b=OZq8rDhBKNMkYyy2Jn5Rf88sT6Qkbz2t2pVr7SpKi+U/IJhggISD7Sb40B9hD+E/LFjqS4 BCoRIN1Jv8t+LnhKwXsNzIAOGTILusBO5wGIBxaKhT3ZmcRxZhdPEhwnTgTLNpM6nq/yhi 6GJgyGAdq9wr6PGiPG4tfIA6cIRZlewLcBga1Q6zhD4ISUcOwfUWom7VonDzvi10jvdEHj DLJqdVLoYcUvKLb7SdVJhs0Mwkfchz88d6yQP249ifmk/TfIR8DRmoiJb7BQ0RWC5HfO+5 9+O4cPlHJDeQ1EPIfKxyZCfyJNY9OBXwutFAOo5vd+SJq+mqDgYequo1o6ojsA== 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 C9CED1E46F; Tue, 15 Feb 2022 07:33:11 +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 21F7XBNB088593; Tue, 15 Feb 2022 07:33:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21F7XBxX088592; Tue, 15 Feb 2022 07:33:11 GMT (envelope-from git) Date: Tue, 15 Feb 2022 07:33:11 GMT Message-Id: <202202150733.21F7XBxX088592@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wei Hu Subject: git: de64aa32c810 - main - mana: Add handling of CQE_RX_TRUNCATED 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: whu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: de64aa32c810f154ac66661a234118cba8f802f9 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644910392; 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=bl57ru5LPzmFdbxA6gejY8PJxWlxJ0DTvpyuG1HPeRI=; b=VMxsyZefPz4x04Y4mrdkQYqAKxG0ozg0f4dsBkODl6w8vrtTob5QG7lXvZyfNEbcZH4kCT ft7OSlsOj5dsQv2B8DDgTeUmCIR4YyxZN9LSxxCQVpHgpb1xw4VBtrahHPYTVNmiBioXTG KhJ6gvPI/DsdffmPoMU/KeEDj0JKeilILR+tm7NHan73+rVXyFxPiuK8kdvvvbUKmXmWh6 DcCg19xcB8sqAX+yrGat/BPuPfoOGWTnEksqSbk2L7EbOojNG9t19pRJEqnL78frO44h/F YlZe3ARTJFuRTGDz2svT04uKqaFECL+wGK+2KUI6N4yqwS45JMcKHKx4bdQMhQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644910392; a=rsa-sha256; cv=none; b=FdR8b5Qv1nXdlOBHB9CbPoSUAFPoXMD0zYuZykQTMtjqpbZbP0NsIrFpy5z0PRDc/c2feo FOxmcOa983TZs9o5NvE7xOJwkamGx1+enNFJVkiJe9omJazz0/RkiOmsfgLOkwm127qsxn klnRJWbiypqHY5cbc43nsNshFzY6H5lbl/0Fe0R48naikLzvExuGcskTxGOkHpcFBBeB2I XmPxRN3uRan0gxElMI50w1QfQxC+r9TQALsyxO1p22qJO/wvwknl+z2vDrFuYGEdOeO6Fu IP3wJSOPscLuh6O/xYc9s63rakoFY6pzabbFuiQC8ctod+ZahhBQ4pXJYPytRQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by whu: URL: https://cgit.FreeBSD.org/src/commit/?id=de64aa32c810f154ac66661a234118cba8f802f9 commit de64aa32c810f154ac66661a234118cba8f802f9 Author: Wei Hu AuthorDate: 2022-02-15 07:07:31 +0000 Commit: Wei Hu CommitDate: 2022-02-15 07:27:42 +0000 mana: Add handling of CQE_RX_TRUNCATED The proper way to drop this kind of CQE is advancing rxq tail without indicating the packet to the upper network layer. MFC after: 2 weeks Sponsored by: Microsoft --- sys/dev/mana/mana_en.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/dev/mana/mana_en.c b/sys/dev/mana/mana_en.c index 171b530e5350..a075851a6ab5 100644 --- a/sys/dev/mana/mana_en.c +++ b/sys/dev/mana/mana_en.c @@ -1613,8 +1613,11 @@ mana_process_rx_cqe(struct mana_rxq *rxq, struct mana_cq *cq, break; case CQE_RX_TRUNCATED: + apc = if_getsoftc(ndev); + counter_u64_add(apc->port_stats.rx_drops, 1); + rxbuf_oob = &rxq->rx_oobs[rxq->buf_index]; if_printf(ndev, "Dropped a truncated packet\n"); - return; + goto drop; case CQE_RX_COALESCED_4: if_printf(ndev, "RX coalescing is unsupported\n"); @@ -1680,6 +1683,7 @@ mana_process_rx_cqe(struct mana_rxq *rxq, struct mana_cq *cq, mana_rx_mbuf(old_mbuf, oob, rxq); +drop: mana_move_wq_tail(rxq->gdma_rq, rxbuf_oob->wqe_inf.wqe_size_in_bu); mana_post_pkt_rxq(rxq);