summaryrefslogtreecommitdiff
path: root/include/sparse/linux
Commit message (Collapse)AuthorAgeFilesLines
* sparse: Configure target operating system and fix fallout.Ben Pfaff2019-04-241-0/+30
| | | | | | | | | | | | | | | | | cgcc, the "sparse" wrapper that OVS uses, can be told the host architecture or the host OS or both. Until now, OVS has told it the host architecture because it is fairly common that it doesn't guess it automatically. Until now, OS has not told it the host OS, assuming that it would get it right. However, it doesn't--if you tell it the host OS or the host architecture, it doesn't really have a default for the other. This means that on Linux (presumably the only OS where sparse works properly for OVS), it was not defining __linux__, which caused some weird behavior. This commit adds a flag to the cgcc invocation to make it define __linux__ on Linux, and it fixes some errors that this would otherwise cause. Acked-by: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* lib/tc: make pedit mask calculations byte order agnosticPieter Jansen van Vuuren2019-01-311-0/+29
pedit allows setting entire words with an optional mask and OVS makes use of such masks to allow setting fields that do not span entire words. The struct tc_pedit_key structure, which is part of the kernel ABI, uses host byte order fields to store the mask and value for a pedit action, however, these fields contain values in network byte order. In order to allow static analysis tools to check for endianness problems this patch adds a local version of struct tc_pedit_key which uses big endian types and refactors the relevant code as appropriate. In the course of making this change it became apparent that the calculation of masks was occurring using host byte order although the values are in network byte order. This patch also fixes that problem by shifting values in host byte order and then converting them to network byte order. It is believe this fixes a bug on big endian systems although we are not in a position to test that. Signed-off-by: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com> Signed-off-by: Simon Horman <simon.horman@netronome.com>