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:53:44 +0000 (15:53 -0800)
commiteec140bc8e7a49e7faafd10184fa5f4310566cb2
tree651e393eaf932469827fd9178b00b8412a2d5574
parent1497929329faed1d840c1539b9e69f78bd26e756
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