[ovs-dev] [emc processing optimization v2 (rebase) 2/2] dpif-netdev: optmizing emc_processing()
Daniele Di Proietto
diproiettod at vmware.com
Tue Feb 2 03:02:27 UTC 2016
Thanks for the patch!
Acked-by: Daniele Di Proietto <diproiettod at vmware.com>
On 01/02/2016 12:46, "Andy Zhou" <azhou at ovn.org> wrote:
>Commit d262ac2c60ce1da7b477737f70e8efd38b32502d introduced a slight
>performance drop for the fast path, where every packets hits the
>emc cache. This patch removes that performance drop by only reloading
>the key pointer on emc cache miss.
>
>Sgned-off-by: Andy Zhou <azhou at ovn.org>
^typo
>---
> lib/dpif-netdev.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
>diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
>index c619b86..faf5d45 100644
>--- a/lib/dpif-netdev.c
>+++ b/lib/dpif-netdev.c
>@@ -3297,6 +3297,7 @@ emc_processing(struct dp_netdev_pmd_thread *pmd,
>struct dp_packet **packets,
> struct packet_batch batches[], size_t *n_batches)
> {
> struct emc_cache *flow_cache = &pmd->flow_cache;
>+ struct netdev_flow_key *key = &keys[0];
> size_t i, n_missed = 0, n_dropped = 0;
>
> for (i = 0; i < cnt; i++) {
>@@ -3314,8 +3315,7 @@ emc_processing(struct dp_netdev_pmd_thread *pmd,
>struct dp_packet **packets,
> OVS_PREFETCH(dp_packet_data(packets[i+1]));
> }
>
>- struct netdev_flow_key *key = &keys[n_missed];
>- miniflow_extract(packets[i], &key->mf);
>+ miniflow_extract(packet, &key->mf);
> key->len = 0; /* Not computed yet. */
> key->hash = dpif_netdev_packet_get_rss_hash(packet, &key->mf);
>
>@@ -3326,7 +3326,8 @@ emc_processing(struct dp_netdev_pmd_thread *pmd,
>struct dp_packet **packets,
> } else {
> /* Exact match cache missed. Group missed packets together at
> * the beginning of the 'packets' array. */
>- packets[n_missed++] = packet;
>+ packets[n_missed] = packet;
>+ key = &keys[n_missed++];
> }
> }
>
>--
>1.9.1
>
>_______________________________________________
>dev mailing list
>dev at openvswitch.org
>http://openvswitch.org/mailman/listinfo/dev
More information about the dev
mailing list