@@ -1669,7 +1669,7 @@ pub mod tests {
16691669 let mem = single_region_mem ( 2 * MAX_BUFFER_SIZE ) ;
16701670 let mut th = TestHelper :: get_default ( & mem) ;
16711671 th. activate_net ( ) ;
1672- let tap_traffic_simulator = TapTrafficSimulator :: new ( if_index ( & th. net ( ) . tap ) ) ;
1672+ let tap_traffic_simulator = TapTrafficSimulator :: new ( & th. net ( ) . backend ) ;
16731673
16741674 th. add_desc_chain ( NetQueue :: Tx , 0 , & [ ( 0 , 4096 , 0 ) ] ) ;
16751675 th. net ( ) . queue_evts [ TX_INDEX ] . read ( ) . unwrap ( ) ;
@@ -1690,7 +1690,7 @@ pub mod tests {
16901690 let mem = single_region_mem ( 2 * MAX_BUFFER_SIZE ) ;
16911691 let mut th = TestHelper :: get_default ( & mem) ;
16921692 th. activate_net ( ) ;
1693- let tap_traffic_simulator = TapTrafficSimulator :: new ( if_index ( & th. net ( ) . tap ) ) ;
1693+ let tap_traffic_simulator = TapTrafficSimulator :: new ( & th. net ( ) . backend ) ;
16941694
16951695 let desc_list = [ ( 0 , 100 , 0 ) , ( 1 , 100 , VIRTQ_DESC_F_WRITE ) , ( 2 , 500 , 0 ) ] ;
16961696 th. add_desc_chain ( NetQueue :: Tx , 0 , & desc_list) ;
@@ -1714,7 +1714,7 @@ pub mod tests {
17141714 let mem = single_region_mem ( 2 * MAX_BUFFER_SIZE ) ;
17151715 let mut th = TestHelper :: get_default ( & mem) ;
17161716 th. activate_net ( ) ;
1717- let tap_traffic_simulator = TapTrafficSimulator :: new ( if_index ( & th. net ( ) . tap ) ) ;
1717+ let tap_traffic_simulator = TapTrafficSimulator :: new ( & th. net ( ) . backend ) ;
17181718
17191719 // Send an invalid frame (too small, VNET header missing).
17201720 th. add_desc_chain ( NetQueue :: Tx , 0 , & [ ( 0 , 1 , 0 ) ] ) ;
@@ -1741,7 +1741,7 @@ pub mod tests {
17411741 let mem = single_region_mem ( 2 * MAX_BUFFER_SIZE ) ;
17421742 let mut th = TestHelper :: get_default ( & mem) ;
17431743 th. activate_net ( ) ;
1744- let tap_traffic_simulator = TapTrafficSimulator :: new ( if_index ( & th. net ( ) . tap ) ) ;
1744+ let tap_traffic_simulator = TapTrafficSimulator :: new ( & th. net ( ) . backend ) ;
17451745
17461746 // Send an invalid frame (too big, maximum buffer is MAX_BUFFER_SIZE).
17471747 th. add_desc_chain (
@@ -1772,7 +1772,7 @@ pub mod tests {
17721772 let mem = single_region_mem ( 2 * MAX_BUFFER_SIZE ) ;
17731773 let mut th = TestHelper :: get_default ( & mem) ;
17741774 th. activate_net ( ) ;
1775- let tap_traffic_simulator = TapTrafficSimulator :: new ( if_index ( & th. net ( ) . tap ) ) ;
1775+ let tap_traffic_simulator = TapTrafficSimulator :: new ( & th. net ( ) . backend ) ;
17761776
17771777 // Send an invalid frame (too small, VNET header missing).
17781778 th. add_desc_chain ( NetQueue :: Tx , 0 , & [ ( 0 , 0 , 0 ) ] ) ;
@@ -1799,7 +1799,7 @@ pub mod tests {
17991799 let mem = single_region_mem ( 2 * MAX_BUFFER_SIZE ) ;
18001800 let mut th = TestHelper :: get_default ( & mem) ;
18011801 th. activate_net ( ) ;
1802- let tap_traffic_simulator = TapTrafficSimulator :: new ( if_index ( & th. net ( ) . tap ) ) ;
1802+ let tap_traffic_simulator = TapTrafficSimulator :: new ( & th. net ( ) . backend ) ;
18031803
18041804 // Add invalid descriptor chain - writeable descriptor.
18051805 th. add_desc_chain (
@@ -1846,7 +1846,7 @@ pub mod tests {
18461846 let mem = single_region_mem ( 2 * MAX_BUFFER_SIZE ) ;
18471847 let mut th = TestHelper :: get_default ( & mem) ;
18481848 th. activate_net ( ) ;
1849- let tap_traffic_simulator = TapTrafficSimulator :: new ( if_index ( & th. net ( ) . tap ) ) ;
1849+ let tap_traffic_simulator = TapTrafficSimulator :: new ( & th. net ( ) . backend ) ;
18501850
18511851 // Add gaps between the descriptor ids in order to ensure that we follow
18521852 // the `next` field.
@@ -1881,7 +1881,7 @@ pub mod tests {
18811881 th. activate_net ( ) ;
18821882 // force the next write to the tap to return an error by simply closing the fd
18831883 // SAFETY: its a valid fd
1884- unsafe { libc:: close ( th. net . lock ( ) . unwrap ( ) . tap . as_raw_fd ( ) ) } ;
1884+ unsafe { libc:: close ( th. net . lock ( ) . unwrap ( ) . backend . as_raw_fd ( ) ) } ;
18851885
18861886 let desc_list = [ ( 0 , 1000 , 0 ) ] ;
18871887 th. add_desc_chain ( NetQueue :: Tx , 0 , & desc_list) ;
@@ -1911,7 +1911,7 @@ pub mod tests {
19111911 let mem = single_region_mem ( 2 * MAX_BUFFER_SIZE ) ;
19121912 let mut th = TestHelper :: get_default ( & mem) ;
19131913 th. activate_net ( ) ;
1914- let tap_traffic_simulator = TapTrafficSimulator :: new ( if_index ( & th. net ( ) . tap ) ) ;
1914+ let tap_traffic_simulator = TapTrafficSimulator :: new ( & th. net ( ) . backend ) ;
19151915
19161916 // Write the first frame to the Tx queue
19171917 let desc_list = [ ( 0 , 50 , 0 ) , ( 1 , 100 , 0 ) , ( 2 , 150 , 0 ) ] ;
@@ -2022,7 +2022,7 @@ pub mod tests {
20222022 & mut net. tx_rate_limiter,
20232023 & mut headers,
20242024 & buffer,
2025- & mut net. tap ,
2025+ & mut net. backend ,
20262026 Some ( src_mac) ,
20272027 & net. metrics,
20282028 )
@@ -2061,7 +2061,7 @@ pub mod tests {
20612061 & mut net. tx_rate_limiter,
20622062 & mut headers,
20632063 & buffer,
2064- & mut net. tap ,
2064+ & mut net. backend ,
20652065 Some ( guest_mac) ,
20662066 & net. metrics,
20672067 )
@@ -2076,7 +2076,7 @@ pub mod tests {
20762076 & mut net. tx_rate_limiter,
20772077 & mut headers,
20782078 & buffer,
2079- & mut net. tap ,
2079+ & mut net. backend ,
20802080 Some ( not_guest_mac) ,
20812081 & net. metrics,
20822082 )
@@ -2116,7 +2116,7 @@ pub mod tests {
21162116 th. activate_net ( ) ;
21172117 // force the next write to the tap to return an error by simply closing the fd
21182118 // SAFETY: its a valid fd
2119- unsafe { libc:: close ( th. net . lock ( ) . unwrap ( ) . tap . as_raw_fd ( ) ) } ;
2119+ unsafe { libc:: close ( th. net . lock ( ) . unwrap ( ) . backend . as_raw_fd ( ) ) } ;
21202120
21212121 // The RX queue is empty and there is a deferred frame.
21222122 th. net ( ) . rx_buffer . used_descriptors = 1 ;
0 commit comments