vtnet: don't provide VIRTIO_NET_HDR_F_DATA_VALID

According to section 5.1.6.2.1 of version 1.3 of the virtio
specification, the driver MUST NOT set VIRTIO_NET_HDR_F_DATA_VALID in
the flags. So don't do that.

Reviewed by: 		Timo Völker
Differential Revision:	https://reviews.freebsd.org/D53650

(cherry picked from commit 836b3cd9d7910aff5225e9e58189067ca03fae30)
This commit is contained in:
Michael Tuexen 2025-11-10 16:28:04 +01:00 committed by Franco Fichtner
parent c3ae6f4a90
commit 747d7b2ce9

View file

@ -2523,10 +2523,6 @@ vtnet_txq_offload(struct vtnet_txq *txq, struct mbuf *m,
hdr->csum_start = vtnet_gtoh16(sc, csum_start);
hdr->csum_offset = vtnet_gtoh16(sc, m->m_pkthdr.csum_data);
txq->vtntx_stats.vtxs_csum++;
} else if ((flags & (CSUM_DATA_VALID | CSUM_PSEUDO_HDR)) &&
(proto == IPPROTO_TCP || proto == IPPROTO_UDP) &&
(m->m_pkthdr.csum_data == 0xFFFF)) {
hdr->flags |= VIRTIO_NET_HDR_F_DATA_VALID;
}
if (flags & (CSUM_IP_TSO | CSUM_IP6_TSO)) {
@ -2640,8 +2636,7 @@ vtnet_txq_encap(struct vtnet_txq *txq, struct mbuf **m_head, int flags)
m->m_flags &= ~M_VLANTAG;
}
if (m->m_pkthdr.csum_flags &
(VTNET_CSUM_ALL_OFFLOAD | CSUM_DATA_VALID)) {
if (m->m_pkthdr.csum_flags & VTNET_CSUM_ALL_OFFLOAD) {
m = vtnet_txq_offload(txq, m, hdr);
if ((*m_head = m) == NULL) {
error = ENOBUFS;