summaryrefslogtreecommitdiff
path: root/scripts/selinux
diff options
context:
space:
mode:
authorJesse Gross <jesse@nicira.com>2014-10-04 02:35:29 +0400
committerDavid S. Miller <davem@davemloft.net>2014-10-06 08:32:20 +0400
commit0714812134d7dcadeb7ecfbfeb18788aa7e1eaac (patch)
tree881bb28da2ca3882fd0a6a30574e98787d5feafb /scripts/selinux
parent0b5e8b8eeae40bae6ad7c7e91c97c3c0d0e57882 (diff)
downloadlinux-0714812134d7dcadeb7ecfbfeb18788aa7e1eaac.tar.xz
openvswitch: Eliminate memset() from flow_extract.
As new protocols are added, the size of the flow key tends to increase although few protocols care about all of the fields. In order to optimize this for hashing and matching, OVS uses a variable length portion of the key. However, when fields are extracted from the packet we must still zero out the entire key. This is no longer necessary now that OVS implements masking. Any fields (or holes in the structure) which are not part of a given protocol will be by definition not part of the mask and zeroed out during lookup. Furthermore, since masking already uses variable length keys this zeroing operation automatically benefits as well. In principle, the only thing that needs to be done at this point is remove the memset() at the beginning of flow. However, some fields assume that they are initialized to zero, which now must be done explicitly. In addition, in the event of an error we must also zero out corresponding fields to signal that there is no valid data present. These increase the total amount of code but very little of it is executed in non-error situations. Removing the memset() reduces the profile of ovs_flow_extract() from 0.64% to 0.56% when tested with large packets on a 10G link. Suggested-by: Pravin Shelar <pshelar@nicira.com> Signed-off-by: Jesse Gross <jesse@nicira.com> Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'scripts/selinux')
0 files changed, 0 insertions, 0 deletions