git: 20285cad7a55 - main - vtnet: remove M_HASHTYPE when there is only one pair of rx/tx queue

From: Cheng Cui <cc_at_FreeBSD.org>
Date: Wed, 28 Jan 2026 21:51:15 UTC
The branch main has been updated by cc:

URL: https://cgit.FreeBSD.org/src/commit/?id=20285cad7a55ecd0020f51f3daee74db8b1ea5a0

commit 20285cad7a55ecd0020f51f3daee74db8b1ea5a0
Author:     Cheng Cui <cc@FreeBSD.org>
AuthorDate: 2026-01-28 17:27:34 +0000
Commit:     Cheng Cui <cc@FreeBSD.org>
CommitDate: 2026-01-28 21:46:07 +0000

    vtnet: remove M_HASHTYPE when there is only one pair of rx/tx queue
    
    Summary:
    Doing so will let the upper layer know how to deal with software hash,
    with benefits like inp_flowid can be set and m_pkthdr.flowid can be set
    in output path.
    
    Reviewed by: tuexen
    Differential Revision: https://reviews.freebsd.org/D54929
---
 sys/dev/virtio/network/if_vtnet.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c
index 19775416f8d4..da89dea03f87 100644
--- a/sys/dev/virtio/network/if_vtnet.c
+++ b/sys/dev/virtio/network/if_vtnet.c
@@ -2059,8 +2059,16 @@ vtnet_rxq_input(struct vtnet_rxq *rxq, struct mbuf *m,
 		}
 	}
 
-	m->m_pkthdr.flowid = rxq->vtnrx_id;
-	M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE);
+	if (sc->vtnet_act_vq_pairs == 1) {
+		/*
+		 * When RSS is not needed (one active rx queue), let the upper
+		 * layer know and react.
+		 */
+		M_HASHTYPE_CLEAR(m);
+	} else {
+		m->m_pkthdr.flowid = rxq->vtnrx_id;
+		M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE);
+	}
 
 	if (hdr->flags &
 	    (VIRTIO_NET_HDR_F_NEEDS_CSUM | VIRTIO_NET_HDR_F_DATA_VALID)) {