X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fdpif.c;h=7151ef9fb022e2b711ceb439db0cb74f848db66b;hb=99ab7312c17cd4ab603eb6194c50b9f1ef3ca1c9;hp=b284e13c14d8ec90533b2124900e9a680f8f3398;hpb=7fd91025664b6ecbdca51427a2905a4f35ee3a16;p=sliver-openvswitch.git diff --git a/lib/dpif.c b/lib/dpif.c index b284e13c1..7151ef9fb 100644 --- a/lib/dpif.c +++ b/lib/dpif.c @@ -61,6 +61,7 @@ static const struct dpif_class *base_dpif_classes[] = { &dpif_linux_class, #endif &dpif_netdev_class, + &dpif_planetlab_class, }; struct registered_dpif_class { @@ -632,14 +633,6 @@ dpif_port_query_by_name(const struct dpif *dpif, const char *devname, return error; } -/* Returns one greater than the maximum port number accepted in flow - * actions. */ -uint32_t -dpif_get_max_ports(const struct dpif *dpif) -{ - return dpif->dpif_class->get_max_ports(dpif); -} - /* Returns the Netlink PID value to supply in OVS_ACTION_ATTR_USERSPACE actions * as the OVS_USERSPACE_ATTR_PID attribute's value, for use in flows whose * packets arrived on port 'port_no'. @@ -891,15 +884,19 @@ dpif_flow_put__(struct dpif *dpif, const struct dpif_flow_put *put) /* Adds or modifies a flow in 'dpif'. The flow is specified by the Netlink * attribute OVS_FLOW_ATTR_KEY with types OVS_KEY_ATTR_* in the 'key_len' bytes - * starting at 'key', and OVS_FLOW_ATTR_MASK with types of OVS_KEY_ATTR_* in the - * 'mask_len' bytes starting at 'mask'. The associated actions are specified by - * the Netlink attributes with types OVS_ACTION_ATTR_* in the 'actions_len' - * bytes starting at 'actions'. + * starting at 'key', and OVS_FLOW_ATTR_MASK with types of OVS_KEY_ATTR_* in + * the 'mask_len' bytes starting at 'mask'. The associated actions are + * specified by the Netlink attributes with types OVS_ACTION_ATTR_* in the + * 'actions_len' bytes starting at 'actions'. * * - If the flow's key does not exist in 'dpif', then the flow will be added if * 'flags' includes DPIF_FP_CREATE. Otherwise the operation will fail with * ENOENT. * + * The datapath may reject attempts to insert overlapping flows with EINVAL + * or EEXIST, but clients should not rely on this: avoiding overlapping flows + * is primarily the client's responsibility. + * * If the operation succeeds, then 'stats', if nonnull, will be zeroed. * * - If the flow's key does exist in 'dpif', then the flow's actions will be @@ -1183,6 +1180,8 @@ dpif_execute__(struct dpif *dpif, const struct dpif_execute *execute) * OVS_ACTION_ATTR_USERSPACE actions it passes the packet through to the dpif * implementation. * + * This works even if 'actions_len' is too long for a Netlink attribute. + * * Returns 0 if successful, otherwise a positive errno value. */ int dpif_execute(struct dpif *dpif, @@ -1198,7 +1197,7 @@ dpif_execute(struct dpif *dpif, execute.actions = actions; execute.actions_len = actions_len; execute.packet = buf; - execute.needs_help = needs_help; + execute.needs_help = needs_help || nl_attr_oversized(actions_len); return dpif_execute__(dpif, &execute); }