Hi Volkan replies inline. Regards, Antonio
> -----Original Message----- > From: discuss [mailto:discuss-boun...@openvswitch.org] On Behalf Of > Ali Volkan Atli > Sent: Friday, April 29, 2016 2:16 PM > To: discuss@openvswitch.org > Subject: [ovs-discuss] DPDK-OvS Cache Architecture > > Hi > > I am trying to understand DPDK cache architecture for pmd threads. > There are three hash tables (flow_cache, cls and flow_table) in the > dp_netdev_pmd_thread structure. First, dp_netdev_input() calls > emc_processing() and it tries to match the packet in flow_cache for > the related pmd thread. If it's unsuccessful, it performs a > classifier lookup using dpcls_lookup() for cls in > fast_path_processing(). If still unsuccessful, it executes an upcall > using dp_netdev_upcall(). > > Now the cache issues are not clear for me. > > 1) Are flow_cache, cls and flow_table in the real CPU caches like L1, > L2 etc? [Antonio F] No, the word 'cache' refers to the fact that the table would respond faster when a match is found. A packet should be matched against the ofproto table, the one that is visible to the user/controller and that is filled by openflow commands like 'ovs-ofctl add-flow..'. The trick is that there are 2 underlying tables which 'cache' the recent values hopefully to process the packets faster. One table works on an exact match, the other on a wildcarded match criteria. > 2) flow_cache does not have wildcarding, does it only depends on > exact match? [Antonio F] Yes, it's an exact match cache table, aka EMC. > 3) Does cls have wildcarding? If not, why we use mask while [Antonio F] Yes, 'cls' is a wildcarded match table. You need to store also a mask in its entries. In general, you can think of EMC and cls as tables storing {key, value} couples. The 'value' is a pointer to a 'dp_netdev_flow' element into the 'flow_table', which stores info like the Action to be performed. In EMC an entry is found when the key is matching exactly the tested key. In cls an entry is found when the wildcarded key is matching. When a EMC/cls key is matching the corresponding value is used to retrieve the 'flow_table' entry so to execute the proper action on that packet. > inserting? in the line: dpcls_insert(&pmd->cls, &flow->cr, &mask) > 4) What is the difference between cls and flow_table? [Antonio F] The main purpose of cls is to collect Rules, eg IP source = 1.2.*.* AND UDPport=123 IP protocol = TCP AND IP dest = 11.11.11.* ... flow_table collects dp_netdev_flow entries, so among the other infos it collects the action to be performed, if that flow was hit recently and so on. > > Thanks in advance > > - Volkan > _______________________________________________ > discuss mailing list > discuss@openvswitch.org > http://openvswitch.org/mailman/listinfo/discuss _______________________________________________ discuss mailing list discuss@openvswitch.org http://openvswitch.org/mailman/listinfo/discuss