diff options
| author | Ben Pfaff <blp@nicira.com> | 2010-08-04 14:08:26 -0700 |
|---|---|---|
| committer | Ben Pfaff <blp@nicira.com> | 2010-08-27 10:10:23 -0700 |
| commit | 9dbb9d5e94d1db5a0fb5cb3867c26d7c3d07d0c4 (patch) | |
| tree | d1554eccb64ba2442ec26371b1425a57e1af8276 /lib/dpif-provider.h | |
| parent | 3a46ca6e46d32a2bc898ff7238f8276db952c050 (diff) | |
| download | openvswitch-9dbb9d5e94d1db5a0fb5cb3867c26d7c3d07d0c4.tar.gz | |
ofproto: Avoid user->kernel->user round-trip for many controller actions.
When an OpenFlow flow says to send packets to the controller, until now
ofproto has executed that using dpif_execute(), which passes the packet up
to the kernel. The kernel queues the packet into its "action" queue, and
then later ofproto pulls the packet back down from the kernel and sends it
to the controller.
However, this is unnecessary. Open vSwitch can just recognize in advance
that it will get the packet back and handle it directly, skipping the round
trip. This commit implements this optimization.
This generally affects only the first packet in a flow, since generally the
rest come directly down from the kernel. It only optimizes the "easy" case
where the first action in a flow is to send the packet to the controller,
since this seems to be the common case in the flows that I'm looking at
now.
Diffstat (limited to 'lib/dpif-provider.h')
| -rw-r--r-- | lib/dpif-provider.h | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/lib/dpif-provider.h b/lib/dpif-provider.h index b2f9d4bd1..1106db888 100644 --- a/lib/dpif-provider.h +++ b/lib/dpif-provider.h @@ -324,14 +324,6 @@ struct dpif_class { void (*recv_wait)(struct dpif *dpif); }; -/* Minimum number of bytes of headroom for a packet returned by the 'recv' - * member function (see above). This headroom allows "struct odp_msg" to be - * replaced by "struct ofp_packet_in" without copying the buffer. */ -#define DPIF_RECV_MSG_PADDING (sizeof(struct ofp_packet_in) \ - - sizeof(struct odp_msg)) -BUILD_ASSERT_DECL(sizeof(struct ofp_packet_in) > sizeof(struct odp_msg)); -BUILD_ASSERT_DECL(DPIF_RECV_MSG_PADDING % 4 == 0); - extern const struct dpif_class dpif_linux_class; extern const struct dpif_class dpif_netdev_class; |
