Hello.

On 2/1/2016 12:37 AM, Tom Herbert wrote:

Call get_unaligned_be32 when we access 32-bit fields in
__skb_flow_dissect. At the beginning check for unlikely case of
1-byte aligned packet.

Note that flow_dissector may be asked to parse packet unaligned
fields in two instances:

1) Packet from a driver which is aligned to Ethernet header
    (2-byte alignment)
2) Parsing inner headers of a received GRE-TEB packet

Testing: Ran super_netperf tests did not see a regression. This was on
x86 which does not have problems with unaligned data.

Signed-off-by: Tom Herbert <t...@herbertland.com>
---
  net/core/flow_dissector.c | 19 ++++++++++++++-----
  1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index d79699c..1c64a1a 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
[...]
@@ -116,6 +116,10 @@ EXPORT_SYMBOL(__skb_flow_get_ports);
   * by flow_dissector from either the skbuff or a raw buffer specified by the
   * rest parameters.
   *
+ * This function does not assume 4-byte alignment, but it does assume 2-byte
+ * alignment (false is returned for 1-byte alignment). get_unaligned_be32
+ * is called to get thirty-two values out of the packet.

   32-bit, maybe?

[...]

MBR, Sergei

Reply via email to