aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCheng Cui <cc@FreeBSD.org>2026-01-28 17:27:34 +0000
committerCheng Cui <cc@FreeBSD.org>2026-01-28 21:46:07 +0000
commit20285cad7a55ecd0020f51f3daee74db8b1ea5a0 (patch)
tree8d185c868f5228379041d52b4d7f4fc6166f4940
parent670b568ec1c36464c6d55e400382c290b0391ccf (diff)
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
-rw-r--r--sys/dev/virtio/network/if_vtnet.c12
1 files 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)) {