udpif_set_threads(struct udpif *udpif, size_t n_handlers,
size_t n_revalidators)
{
- ovsrcu_quiesce_start();
+ int error;
+ ovsrcu_quiesce_start();
/* Stop the old threads (if any). */
if (udpif->handlers &&
(udpif->n_handlers != n_handlers
udpif->n_handlers = 0;
}
+ error = dpif_handlers_set(udpif->dpif, 1);
+ if (error) {
+ VLOG_ERR("failed to configure handlers in dpif %s: %s",
+ dpif_name(udpif->dpif), ovs_strerror(error));
+ return;
+ }
+
/* Start new threads (if necessary). */
if (!udpif->handlers && n_handlers) {
size_t i;
set_subprogram_name("dispatcher");
while (!latch_is_set(&udpif->exit_latch)) {
recv_upcalls(udpif);
- dpif_recv_wait(udpif->dpif);
+ dpif_recv_wait(udpif->dpif, 0);
latch_wait(&udpif->exit_latch);
poll_block();
}
upcall = xmalloc(sizeof *upcall);
ofpbuf_use_stub(&upcall->upcall_buf, upcall->upcall_stub,
sizeof upcall->upcall_stub);
- error = dpif_recv(udpif->dpif, &upcall->dpif_upcall,
+ error = dpif_recv(udpif->dpif, 0, &upcall->dpif_upcall,
&upcall->upcall_buf);
if (error) {
/* upcall_destroy() can only be called on successfully received
port = xout->slow & (SLOW_CFM | SLOW_BFD | SLOW_LACP | SLOW_STP)
? ODPP_NONE
: odp_in_port;
- pid = dpif_port_get_pid(udpif->dpif, port);
+ pid = dpif_port_get_pid(udpif->dpif, port, 0);
odp_put_userspace_action(pid, &cookie, sizeof cookie.slow_path, buf);
}
type = classify_upcall(upcall);
if (type == MISS_UPCALL) {
uint32_t hash;
- struct pkt_metadata md;
+ struct pkt_metadata md = PKT_METADATA_INITIALIZER_FLOW(&flow);
- pkt_metadata_from_flow(&md, &flow);
flow_extract(packet, &md, &miss->flow);
-
hash = flow_hash(&miss->flow, 0);
existing_miss = flow_miss_find(&misses, ofproto, &miss->flow,
hash);
} else {
miss = existing_miss;
}
- miss->stats.tcp_flags |= packet_get_tcp_flags(packet, &miss->flow);
+ miss->stats.tcp_flags |= ntohs(miss->flow.tcp_flags);
miss->stats.n_bytes += packet->size;
miss->stats.n_packets++;