ofproto-dpif-upcall: Avoid unnecessarily installing datapath flows.
authorBen Pfaff <blp@nicira.com>
Mon, 13 Jan 2014 23:33:27 +0000 (15:33 -0800)
committerBen Pfaff <blp@nicira.com>
Mon, 13 Jan 2014 23:33:27 +0000 (15:33 -0800)
commit73e141f977163d93e60c30a177a99c44ecf72fe2
tree3388da0336beb0f7874437b52a360adaa5d906c8
parentdb1fc2103d73ae0451f569200e70e808a7d7d79f
ofproto-dpif-upcall: Avoid unnecessarily installing datapath flows.

handle_upcalls() always installed a flow for every packet, as long as
the datapath didn't already have too many flows, but there are cases where
we don't want to do this:

    - If we get multiple packets in a single microflow all in one batch
      (perhaps due to GSO breaking up a large TCP packet for sending to
      userspace, or for another reason), then we only need to install the
      datapath flow once.

    - For a slow-pathed flow received via a slow-path action in the kernel,
      we know that the kernel flow is already there (because otherwise it
      would have been received as "no match" instead of an action), so
      there is no benefit to reinstalling it.

Noticed because a CFM slow-pathed flow was getting reinstalled every time
a CFM packet was received.

Reported-by: Guolin Yang <gyang@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto/ofproto-dpif-upcall.c