git: 6b53aeed9162 - main - if_vtnet: Set lro_nsegs for host LRO packets

Bryan Venteicher bryanv at FreeBSD.org
Tue Jan 19 05:08:39 UTC 2021


The branch main has been updated by bryanv:

URL: https://cgit.FreeBSD.org/src/commit/?id=6b53aeed9162c258ae8516cdc11ac2b66a9edd93

commit 6b53aeed9162c258ae8516cdc11ac2b66a9edd93
Author:     Bryan Venteicher <bryanv at FreeBSD.org>
AuthorDate: 2021-01-19 04:55:25 +0000
Commit:     Bryan Venteicher <bryanv at FreeBSD.org>
CommitDate: 2021-01-19 04:55:25 +0000

    if_vtnet: Set lro_nsegs for host LRO packets
    
    Reviewed by: grehan (mentor)
    Differential Revision: https://reviews.freebsd.org/D27933
---
 sys/dev/virtio/network/if_vtnet.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c
index ad53f3d24e02..3da945baab63 100644
--- a/sys/dev/virtio/network/if_vtnet.c
+++ b/sys/dev/virtio/network/if_vtnet.c
@@ -2010,6 +2010,16 @@ vtnet_rxq_input(struct vtnet_rxq *rxq, struct mbuf *m,
 			rxq->vtnrx_stats.vrxs_csum_failed++;
 	}
 
+	if (hdr->gso_size != 0) {
+		switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) {
+		case VIRTIO_NET_HDR_GSO_TCPV4:
+		case VIRTIO_NET_HDR_GSO_TCPV6:
+			m->m_pkthdr.lro_nsegs =
+			    howmany(m->m_pkthdr.len, hdr->gso_size);
+			break;
+		}
+	}
+
 	rxq->vtnrx_stats.vrxs_ipackets++;
 	rxq->vtnrx_stats.vrxs_ibytes += m->m_pkthdr.len;
 


More information about the dev-commits-src-all mailing list