datapath: Increase maximum number of actions per flow.
authorBen Pfaff <blp@nicira.com>
Tue, 14 Sep 2010 20:32:36 +0000 (13:32 -0700)
committerJustin Pettit <jpettit@nicira.com>
Tue, 5 Oct 2010 23:40:54 +0000 (16:40 -0700)
Until now the number of actions in a flow has been limited to what fits in
a page.  Each action is 8 bytes, and on 32-bit architectures there is a
12-byte header, so with 4-kB pages that limits flows to 510 actions.  We
and Citrix have noticed that OVS stops working properly after about 509
VIFs are added to a bridge.  According to log messages this is the reason:
at this point it is no longer possible to flood a packet to all ports.

This commit should help, by increasing the maximum number of actions in a
flow.  In the long term, though, we should adopt use of port groups or
otherwise reduce the number of actions needed to flood a packet.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Bug #3573.
NIC-234.

datapath/flow.c

index dbfe5dd..7684c06 100644 (file)
@@ -108,7 +108,10 @@ struct sw_flow_actions *flow_actions_alloc(size_t n_actions)
 {
        struct sw_flow_actions *sfa;
 
-       if (n_actions > (PAGE_SIZE - sizeof *sfa) / sizeof(union odp_action))
+       /* At least DP_MAX_PORTS actions are required to be able to flood a
+        * packet to every port.  Factor of 2 allows for setting VLAN tags,
+        * etc. */
+       if (n_actions > 2 * DP_MAX_PORTS)
                return ERR_PTR(-EINVAL);
 
        sfa = kmalloc(sizeof *sfa + n_actions * sizeof(union odp_action),