From nobody Thu Dec 28 17:24:49 2023 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 4T1FkV1W09z56CpD; Thu, 28 Dec 2023 17:24:50 +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 4T1FkV0xWbz3dSh; Thu, 28 Dec 2023 17:24:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703784290; 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=d5/3znyI2JeaxwDazDDkfC4DOAWP2cD5DGO6c0kR+e4=; b=Vur/0dbQFGDd2cgGZt0N1LUITHyplu2qADcOxmTlDFMdd3AdH454fojhCpR9s1bbvCdRPb v3PhHKpPLA4ntTUfA2ZzXuMROTfGj6KYWTH+DUL2LlXW4GpUFxByXL2WRChIzuqGT8QmYw 8m3umkaee2h+f1mPAF6rJXbhpai/XcnRqJLotb5M7/3Kxeu4h+vz70FKBG5sjdOa5SxeyH aCzwcN1Wf/fybTPgBarLxwnRvEAiwSjizCr8pt0rH24gc3HVkE2doQPsXYdjeFlo7rSDno KVgeeAl6GixBaHpkpZIQBWWBA0kZZeYxJDYYpcRH1i9H2ecToHkEE+Bc/Xf4Cw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703784290; a=rsa-sha256; cv=none; b=YGfqqpHx2ohnoMDm9ImC7wHa7h3kohSMhczoro4+sqOYEaASHcpEhSsMRdCwF7qwOIlkXW WqLG2KnfPtwwUUI0JYBBuon0r1+AXBb404IlLyP0tiQBW1ri1J3RbI542E5T1TjZVTq8+E EkE099f3CyoFboIdaDHaibvbvv+RSOLpD1U/QL2PpzTi66PnWmlihpJtE8OLCZa1hQAATo mtgAwk6jhXB5tQIHu9yT7DrufDkVIzSUWmHdBVrw48F3Ewk6vKXhcYlSOh0hbdOxrQgIZO AME5fk5P0Anm32Y1SY0L2hictMTZO8vzXGBDjJqGFwfXO1KOhUkgSucmqpatGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703784290; 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=d5/3znyI2JeaxwDazDDkfC4DOAWP2cD5DGO6c0kR+e4=; b=QxLZwxNr04ph7qVn+HiDVGca72575hZYSeXbwCJGPcoZtVlY5Nd3k7mPPNqX/YmyQU5pB9 LZrFuKcoV9DqhjOxsUn1ehqry+WZ+z2rujz2grYXu2RBxK8Cl4xTqhGB59T0szWCwCRbQh OP/8WivOHJ1EoQumm7WGqlWbb7VfVi8wj+IpdUE426rZJKLiN0RqKF42PfTT4XF6GlbOcA BY3XSvzsyNe3rtR7jZv2wC42a9mi8A0HSOfajE8nrkxSJ5Q3TRi94PlE1imCoGgJ+qHO2G saflRY1dYKpJqvGxCWYe1lNI039XxlH/l9h9VbULuHqE/J8XO9J4POfYMrZInA== 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 4T1FkT7156zXgT; Thu, 28 Dec 2023 17:24:49 +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 3BSHOnfK090601; Thu, 28 Dec 2023 17:24:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BSHOnqk090598; Thu, 28 Dec 2023 17:24:49 GMT (envelope-from git) Date: Thu, 28 Dec 2023 17:24:49 GMT Message-Id: <202312281724.3BSHOnqk090598@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 8ee1cc4a7f2e - main - Revert "vtnet: Better adjust for ethernet alignment." 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8ee1cc4a7f2e0a3fb9cb4f9514da07f2572a7f4c Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8ee1cc4a7f2e0a3fb9cb4f9514da07f2572a7f4c commit 8ee1cc4a7f2e0a3fb9cb4f9514da07f2572a7f4c Author: Warner Losh AuthorDate: 2023-12-28 17:20:24 +0000 Commit: Warner Losh CommitDate: 2023-12-28 17:22:14 +0000 Revert "vtnet: Better adjust for ethernet alignment." This reverts commit e9da71cd35d46ca13da4396d99e0af1703290e68. This was inadvertantly pushed and turns out ot be not quite right. Requested by: markj --- sys/dev/virtio/network/if_vtnet.c | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index db7a1a18ebc2..360176e4f845 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -1532,8 +1532,8 @@ vtnet_rx_alloc_buf(struct vtnet_softc *sc, int nbufs, struct mbuf **m_tailp) m_freem(m_head); return (NULL); } - m->m_len = size; + m_adj(m, ETHER_ALIGN); if (m_head != NULL) { m_tail->m_next = m; m_tail = m; @@ -1587,15 +1587,6 @@ vtnet_rxq_replace_lro_nomrg_buf(struct vtnet_rxq *rxq, struct mbuf *m0, ("%s: mbuf size %d not expected cluster size %d", __func__, m->m_len, clustersz)); -#ifdef __NO_STRICT_ALIGNMENT - /* - * Need to offset the first mbuf in this chain to align the IP - * structure because this host requires strict alignment. - */ - if (m_prev == NULL) { - m_adj(m, ETHER_ALIGN); - } -#endif m->m_len = MIN(m->m_len, len); len -= m->m_len; @@ -1664,13 +1655,6 @@ vtnet_rxq_replace_buf(struct vtnet_rxq *rxq, struct mbuf *m, int len) if (m_new == NULL) return (ENOBUFS); -#ifdef __NO_STRICT_ALIGNMENT - /* - * Need to offset the first mbuf in this chain to align the IP - * structure because this host requires strict alignment. - */ - m_adj(m_new, ETHER_ALIGN); -#endif error = vtnet_rxq_enqueue_buf(rxq, m_new); if (error) { sc->vtnet_stats.rx_enq_replacement_failed++; @@ -1738,13 +1722,6 @@ vtnet_rxq_new_buf(struct vtnet_rxq *rxq) if (m == NULL) return (ENOBUFS); -#ifdef __NO_STRICT_ALIGNMENT - /* - * Need to offset the first mbuf in this chain to align the IP - * structure because this host requires strict alignment. - */ - m_adj(m, ETHER_ALIGN); -#endif error = vtnet_rxq_enqueue_buf(rxq, m); if (error) m_freem(m); @@ -1930,10 +1907,8 @@ vtnet_rxq_discard_buf(struct vtnet_rxq *rxq, struct mbuf *m) int error __diagused; /* - * Requeue the discarded mbuf. This should always be successful since it - * was just dequeued. There's no need to adjust for ethernet alignment - * here on strict alignment hosts because we're requeueing a packet - * already adjusted. + * Requeue the discarded mbuf. This should always be successful + * since it was just dequeued. */ error = vtnet_rxq_enqueue_buf(rxq, m); KASSERT(error == 0,