File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
vm/devices/net/net_mana/src Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -1300,6 +1300,22 @@ impl<T: DeviceBacking> ManaQueue<T> {
13001300
13011301 let mut segment_count =
13021302 tail_sgl_offset + meta. segment_count as usize - header_segment_count;
1303+
1304+ // Drop the LSO packet if it only has a header segment.
1305+ // In production builds, this check always runs.
1306+ // For tests, use test hooks to bypass this check for allowing code coverage.
1307+ #[ cfg( not( test) ) ]
1308+ let check_lso_segment_count = true ;
1309+ #[ cfg( test) ]
1310+ let check_lso_segment_count = !self . test_configuration . allow_lso_pkt_with_one_sge ;
1311+
1312+ if check_lso_segment_count
1313+ && meta. flags . offload_tcp_segmentation ( )
1314+ && segment_count == 1
1315+ {
1316+ return Ok ( None ) ;
1317+ }
1318+
13031319 let mut sgl_idx = tail_sgl_offset - 1 ;
13041320 let sgl = if segment_count <= hardware_segment_limit {
13051321 for ( tail, sge) in segments[ header_segment_count..]
You can’t perform that action at this time.
0 commit comments