[ovs-dev] [PATCH v4 0/2] dpif-netdev: Combine CD/DFC patch for datapath refactor

Yipeng Wang yipeng1.wang at intel.com
Fri Jun 29 17:52:50 UTC 2018


This patch set is the V4 implementation to combine the CD and DFC design.
Both patches intend to refactor datapath to avoid costly sequential subtable
search.

We rename the CD/DFC as signature match cache (SMC) to be more clear since the
proposed cache structure stores signatures of flows. SMC works well when
traffic flow count is much larger than EMC size especially when subtable count
is large. Our tests show that with 20 subtables, the throughput could be
increased by more than 2x with SMC enabled.

In this version, SMC is made experimental and by default turned off.

CD and DFC patch sets:
CD: [PATCH v2 0/5] dpif-netdev: Cuckoo-Distributor implementation
https://mail.openvswitch.org/pipermail/ovs-dev/2017-October/340305.html

DFC: [PATCH] dpif-netdev: Refactor datapath flow cache
https://mail.openvswitch.org/pipermail/ovs-dev/2017-November/341066.html


v3->v4:
1. To make it easier for reviewers, we simplify the patch set to have only 2
commits. The first commit includes the main SMC design and the second commit
modifies the unit-test accordingly.
2. SMC is now an experimental feature turned off by default.
3. Remove the EMC changes from the original DFC patch set to make this patch
set smaller and more focus.
4. Remove adaptive turn on/off mechanism since it is now an experimental
feature turned off by default, and can be turned on manually by user.
5. Add documentation for SMC.
6. Packets hit SMC now verify input port when match dp_netdev_flow. This is
because SMC will bypass per-port classifier.

v2->v3:
1. Add the 5th commit: it is to automatically turn off DFC/CD when the number
of megaflow is larger than 2^16 since we use 16bits in the distributor to index
megaflows.
2. Add the 6th commit: since the pmd stats now print out the DFC/CD statistics
one of the unit test has mismatch output. This commit fixed this issue.
3. In first commit, the char key[248] array is changed to uint64_t key[31]
because of the OSX compilation warning that char array is 1 byte alligned while
8-byte alignment is required during type conversion.

v1->v2:
1. Add comment and follow code style for cmap code (Ben's comment)
2. Fix a bug in the first commit that fails multiple unit tests. Since DFC is
   per PMD not per port, the port mask should be included in rule.
3. Added commit 4. This commit separates DFC to be EMC cache and SMC (signature
   match cache) for easier optimization and readability.
4. In commit 4, DFC lookup is refactored to do batching lookup.
5. Rebase and other minor changes.

RFC->V1:
1. rebase to master head.
2. The last commit is totally rewritten to use the flow_table as indirect table.
   The CD/DFC distributor will cache the index of flow_table entry.
3. Incorporate commit 2 into commit 1. (Bhanu's comment)
4. Change DFC to be always on in commit 1. (Bhanu's comment)

RFC of this patch set:
https://mail.openvswitch.org/pipermail/ovs-dev/2018-January/343411.html

Yipeng Wang (2):
  dpif-netdev: Add SMC cache after EMC cache
  tests: Fix unit test case caused by SMC cache.

 Documentation/topics/dpdk/bridge.rst |  15 ++
 NEWS                                 |   2 +
 lib/cmap.c                           |  73 +++++++++
 lib/cmap.h                           |   5 +
 lib/dpif-netdev-perf.h               |   1 +
 lib/dpif-netdev.c                    | 310 ++++++++++++++++++++++++++++++-----
 tests/pmd.at                         |   7 +-
 vswitchd/vswitch.xml                 |  14 ++
 8 files changed, 388 insertions(+), 39 deletions(-)

-- 
2.7.4



More information about the dev mailing list