@@ -1132,24 +1132,31 @@ impl PmdPort {
11321132 path : Option < String > ,
11331133 queue_size : Option < u32 > ,
11341134 queues : Option < u32 > ,
1135+ rx_pcap : Option < String > ,
1136+ tx_pcap : Option < String > ,
11351137 }
11361138
11371139 fn parse_spec ( spec : & str ) -> DevSpec {
11381140 let mut iface = None ;
11391141 let mut path = None ;
11401142 let mut queue_size = None ;
11411143 let mut queues = None ;
1144+ let mut rx_pcap = None ;
1145+ let mut tx_pcap = None ;
11421146 let mut name = String :: new ( ) ;
11431147
11441148 for ( i, s) in spec. split_terminator ( ',' ) . enumerate ( ) {
11451149 if i == 0 {
1150+ // we take as name key everything before the first ','
11461151 name = s. to_string ( ) ;
11471152 } else {
11481153 let key_val: Vec < _ > = s. split_terminator ( '=' ) . collect ( ) ;
11491154 if key_val. len ( ) == 2 {
11501155 match key_val[ 0 ] {
11511156 "iface" => iface = Some ( key_val[ 1 ] . to_string ( ) ) ,
11521157 "path" => path = Some ( key_val[ 1 ] . to_string ( ) ) ,
1158+ "rx_pcap" => rx_pcap = Some ( key_val[ 1 ] . to_string ( ) ) ,
1159+ "tx_pcap" => tx_pcap = Some ( key_val[ 1 ] . to_string ( ) ) ,
11531160 "queue_size" => queue_size = key_val[ 1 ] . parse :: < u32 > ( ) . ok ( ) ,
11541161 "queues" => queues = key_val[ 1 ] . parse :: < u32 > ( ) . ok ( ) ,
11551162 _ => ( ) ,
@@ -1166,34 +1173,47 @@ impl PmdPort {
11661173 path,
11671174 queue_size,
11681175 queues,
1176+ rx_pcap,
1177+ tx_pcap,
11691178 }
11701179 }
11711180
11721181 match parts[ 0 ] {
11731182 "bess" => PmdPort :: new_bess_port ( parts[ 1 ] , rx_cores[ 0 ] ) ,
11741183 "ovs" => PmdPort :: new_ovs_port ( parts[ 1 ] , rx_cores[ 0 ] ) ,
1175- "dpdk" => PmdPort :: new_dpdk_port (
1176- name,
1177- kni,
1178- None ,
1179- parts[ 1 ] ,
1180- rx_cores,
1181- tx_cores,
1182- nrxd,
1183- ntxd,
1184- loopback,
1185- tso,
1186- csumoffload,
1187- driver,
1188- PortType :: Physical ,
1189- fdir_conf,
1190- port_config. flow_steering ,
1191- port_config. net_spec . clone ( ) ,
1192- associated_port. map_or ( None , |p| Some ( p. port_id ( ) ) ) ,
1193- ) ,
1194- "virtio" => {
1184+ /*
1185+ "dpdk" => {
11951186 let dev_spec = parse_spec(name);
1196- debug ! ( "virtio with spec {} parsed as {:?}" , parts[ 1 ] , dev_spec) ;
1187+ debug!("dpdk with spec {} parsed as {:?}", parts[1], dev_spec);
1188+ PmdPort::new_dpdk_port(
1189+ &dev_spec.name,
1190+ kni,
1191+ dev_spec.iface,
1192+ parts[1],
1193+ rx_cores,
1194+ tx_cores,
1195+ nrxd,
1196+ ntxd,
1197+ loopback,
1198+ tso,
1199+ csumoffload,
1200+ driver,
1201+ PortType::Physical,
1202+ fdir_conf,
1203+ port_config.flow_steering,
1204+ port_config.net_spec.clone(),
1205+ associated_port.map_or(None, |p| Some(p.port_id())),
1206+ )
1207+ }
1208+ */
1209+ "virtio" | "dpdk" => {
1210+ let port_type = match parts[ 0 ] {
1211+ "dpdk" => PortType :: Physical ,
1212+ "virtio" => PortType :: Virtio ,
1213+ _ => PortType :: Null ,
1214+ } ;
1215+ let dev_spec = parse_spec ( name) ;
1216+ debug ! ( "spec {} parsed as {:?}" , parts[ 1 ] , dev_spec) ;
11971217 // we must have for each core of the associated port a queue on the virtio device
11981218 let modified_spec = if queues. is_some ( ) {
11991219 parts[ 1 ] . replace ( "queues={}" , & ( "queues=" . to_owned ( ) + & format ! ( "{}" , queues. unwrap( ) ) ) )
@@ -1214,7 +1234,7 @@ impl PmdPort {
12141234 tso,
12151235 csumoffload,
12161236 driver,
1217- PortType :: Virtio ,
1237+ port_type ,
12181238 fdir_conf,
12191239 port_config. flow_steering ,
12201240 port_config. net_spec . clone ( ) ,
0 commit comments