[ovs-dev] [PATCH 7/7] dpif-netdev: Share emc and fast path output batches.
Daniele Di Proietto
diproiettod at vmware.com
Mon May 18 17:42:32 UTC 2015
On 15/05/2015 20:51, "Pravin Shelar" <pshelar at nicira.com> wrote:
>On Thu, Apr 23, 2015 at 11:40 AM, Daniele Di Proietto
><diproiettod at vmware.com> wrote:
>> Until now the exact match cache processing was able to handle only four
>> megaflow. The rest of the packets was passed to the megaflow
>> classifier.
>>
>> The limit was arbitraly set to four also because the algorithm used to
>> group packets in output batches didn't perform well with a lot of
>> megaflows.
>>
>> After changing the algorithm and after some performance testing it seems
>> much better just share the same output batches between the exact match
>> cache and the megaflow classifier.
>>
>> Signed-off-by: Daniele Di Proietto <diproiettod at vmware.com>
>> ---
>...
>
>> * 'packets' array (they have been moved to the beginning of the
>>vector).
>> */
>> static inline size_t
>> emc_processing(struct dp_netdev_pmd_thread *pmd, struct dp_packet
>>**packets,
>> - size_t cnt, struct netdev_flow_key *keys, long long now)
>> + size_t cnt, struct netdev_flow_key *keys,
>> + struct packet_batch batches[], size_t *n_batches)
>> {
>> - struct netdev_flow_key key;
>> - struct packet_batch batches[4];
>> struct emc_cache *flow_cache = &pmd->flow_cache;
>> - size_t n_batches, i;
>> - size_t notfound_cnt = 0;
>> + struct netdev_flow_key key;
>> + size_t i, notfound_cnt = 0;
>>
>> - n_batches = 0;
>> miniflow_initialize(&key.mf, key.buf);
>> for (i = 0; i < cnt; i++) {
>> struct dp_netdev_flow *flow;
>> @@ -3152,8 +3142,7 @@ emc_processing(struct dp_netdev_pmd_thread *pmd,
>>struct dp_packet **packets,
>>
>> flow = emc_lookup(flow_cache, &key);
>> if (OVS_UNLIKELY(!dp_netdev_queue_batches(packets[i], flow,
>>&key.mf,
>> - batches, &n_batches,
>> -
>>ARRAY_SIZE(batches)))) {
>> + batches,
>>n_batches))) {
>Can you move the flow NULL check from dp_netdev_queue_batches(). It
>makes this code bit clear on the packet processing flow.
Agreed. I'm about to send a v2
Thanks for all your suggestions!
More information about the dev
mailing list