@@ -133,12 +133,14 @@ static int vtnet_rxq_replace_lro_nomrg_buf(struct vtnet_rxq *,
133133static int vtnet_rxq_replace_buf (struct vtnet_rxq * , struct mbuf * , int );
134134static int vtnet_rxq_enqueue_buf (struct vtnet_rxq * , struct mbuf * );
135135static int vtnet_rxq_new_buf (struct vtnet_rxq * );
136+ #if defined(INET ) || defined(INET6 )
136137static int vtnet_rxq_csum_needs_csum (struct vtnet_rxq * , struct mbuf * ,
137138 bool , int , struct virtio_net_hdr * );
138139static void vtnet_rxq_csum_data_valid (struct vtnet_rxq * , struct mbuf * ,
139140 int );
140141static int vtnet_rxq_csum (struct vtnet_rxq * , struct mbuf * ,
141142 struct virtio_net_hdr * );
143+ #endif
142144static void vtnet_rxq_discard_merged_bufs (struct vtnet_rxq * , int );
143145static void vtnet_rxq_discard_buf (struct vtnet_rxq * , struct mbuf * );
144146static int vtnet_rxq_merged_eof (struct vtnet_rxq * , struct mbuf * , int );
@@ -1761,6 +1763,7 @@ vtnet_rxq_new_buf(struct vtnet_rxq *rxq)
17611763 return (error );
17621764}
17631765
1766+ #if defined(INET ) || defined(INET6 )
17641767static int
17651768vtnet_rxq_csum_needs_csum (struct vtnet_rxq * rxq , struct mbuf * m , bool isipv6 ,
17661769 int protocol , struct virtio_net_hdr * hdr )
@@ -1918,6 +1921,7 @@ vtnet_rxq_csum(struct vtnet_rxq *rxq, struct mbuf *m,
19181921
19191922 return (0 );
19201923}
1924+ #endif
19211925
19221926static void
19231927vtnet_rxq_discard_merged_bufs (struct vtnet_rxq * rxq , int nbufs )
@@ -2040,10 +2044,15 @@ vtnet_rxq_input(struct vtnet_rxq *rxq, struct mbuf *m,
20402044
20412045 if (hdr -> flags &
20422046 (VIRTIO_NET_HDR_F_NEEDS_CSUM | VIRTIO_NET_HDR_F_DATA_VALID )) {
2047+ #if defined(INET ) || defined(INET6 )
20432048 if (vtnet_rxq_csum (rxq , m , hdr ) == 0 )
20442049 rxq -> vtnrx_stats .vrxs_csum ++ ;
20452050 else
20462051 rxq -> vtnrx_stats .vrxs_csum_failed ++ ;
2052+ #else
2053+ sc -> vtnet_stats .rx_csum_bad_ethtype ++ ;
2054+ rxq -> vtnrx_stats .vrxs_csum_failed ++ ;
2055+ #endif
20472056 }
20482057
20492058 if (hdr -> gso_size != 0 ) {
0 commit comments