return dpif_linux_port_query__(dpif, 0, devname, dpif_port);
}
+static int
+dpif_linux_get_max_ports(const struct dpif *dpif OVS_UNUSED)
+{
+ /* If the datapath increases its range of supported ports, then it should
+ * start reporting that. */
+ return 1024;
+}
+
static int
dpif_linux_flow_flush(struct dpif *dpif_)
{
}
static int
-dpif_linux_flow_get(const struct dpif *dpif_, struct odp_flow flows[], int n)
+dpif_linux_flow_get(const struct dpif *dpif_, struct odp_flow *flow)
{
- struct odp_flowvec fv;
- fv.flows = flows;
- fv.n_flows = n;
- return do_ioctl(dpif_, ODP_FLOW_GET, &fv);
+ return do_ioctl(dpif_, ODP_FLOW_GET, flow);
}
static int
poll_fd_wait(dpif->fd, POLLIN);
}
+static void
+dpif_linux_recv_purge(struct dpif *dpif_)
+{
+ struct dpif_linux *dpif = dpif_linux_cast(dpif_);
+ int i;
+
+ /* This is somewhat bogus because it assumes that the following macros have
+ * fixed values, but it's going to go away later. */
+#define DP_N_QUEUES 3
+#define DP_MAX_QUEUE_LEN 100
+ for (i = 0; i < DP_N_QUEUES * DP_MAX_QUEUE_LEN; i++) {
+ /* Reading even 1 byte discards a whole datagram and saves time. */
+ char buffer;
+
+ if (read(dpif->fd, &buffer, 1) != 1) {
+ break;
+ }
+ }
+}
+
const struct dpif_class dpif_linux_class = {
"system",
NULL,
dpif_linux_port_del,
dpif_linux_port_query_by_number,
dpif_linux_port_query_by_name,
+ dpif_linux_get_max_ports,
dpif_linux_port_dump_start,
dpif_linux_port_dump_next,
dpif_linux_port_dump_done,
dpif_linux_queue_to_priority,
dpif_linux_recv,
dpif_linux_recv_wait,
+ dpif_linux_recv_purge,
};
\f
static int get_openvswitch_major(void);