[ovs-git] [openvswitch/ovs] 6b14ed: dpif-netdev: Fix double parsing of packets when EM...

igsilya noreply at github.com
Thu Apr 18 13:56:59 UTC 2019


  Branch: refs/heads/branch-2.11
  Home:   https://github.com/openvswitch/ovs
  Commit: 6b14ed0393af98c4067930fad2133ab7e5e0d39b
      https://github.com/openvswitch/ovs/commit/6b14ed0393af98c4067930fad2133ab7e5e0d39b
  Author: Ilya Maximets <i.maximets at samsung.com>
  Date:   2019-04-18 (Thu, 18 Apr 2019)

  Changed paths:
    M lib/dpif-netdev.c

  Log Message:
  -----------
  dpif-netdev: Fix double parsing of packets when EMC disabled.

This partially reverts commit bde94613e6276d48a6e0be7a592ebcf9836b4aaf.

Commit bde94613e627 was aimed to slightly ( < 1%) increase performance
in the case where EMC disabled, but it avoids RSS hash calculation and
OVS has to calculate it while executing OVS_ACTION_ATTR_HASH in order
to handle balanced-tcp bonding. At the time of executing that action
there is no parsed flow, and OVS parses the packet for the second time
to calculate the hash. This happens for all packets received from the
virtual interfaces because they have no HW RSS.

Here is the example of 'perf' output for VM --> (bonded PHY) traffic:

  Samples: 401K of event 'cycles', Event count (approx.): 50964771478
  Overhead  Shared Object       Symbol
    27.50%  ovs-vswitchd        [.] dpcls_lookup.370382
    16.30%  ovs-vswitchd        [.] rte_vhost_dequeue_burst.9267
    14.95%  ovs-vswitchd        [.] miniflow_extract
     7.22%  ovs-vswitchd        [.] flow_extract
     7.10%  ovs-vswitchd        [.] dp_netdev_input__.371002.4826
     4.01%  ovs-vswitchd        [.] fast_path_processing.370987.4893

We can see that packet parsed twice. First time by 'miniflow_extract'
right after receiving and the second time by 'flow_extract' while
executing actions.

In this particular case calculating RSS on receive saves > 7% of the
total CPU processing time. It varies from ~7 to ~10 % depending on
scenario/traffic types.

It's better to calculate hash each time because performance
improvements of avoiding are negligible in compare with performance
drop in case of sending packets to bonded interface.

Another solution could be to pass the parsed flow explicitly through
the datapath, but this will require big code changes and will have
additional overhead for metadata updating on packet changes.

Also, this change should have small impact since SMC works well in most
cases and will be enabled/recommended by default in the future.

CC: Antonio Fischetti <antonio.fischetti at intel.com>
Fixes: bde94613e627 ("dpif-netdev: Avoid reading RSS hash when EMC is disabled.")
Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
Signed-off-by: Ian Stokes <ian.stokes at intel.com>




More information about the git mailing list