0039-net-next-dsa-add-flow_dissect-callback-to-struct-dsa.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. From 22e8b65ea4bf8a1fa757137bdcbdefe505fa4044 Mon Sep 17 00:00:00 2001
  2. From: John Crispin <[email protected]>
  3. Date: Mon, 7 Aug 2017 16:35:43 +0200
  4. Subject: [PATCH 39/57] net-next: dsa: add flow_dissect callback to struct
  5. dsa_device_ops
  6. When the flow dissector first sees packets coming in on a DSA devices the
  7. 802.3 header wont be located where the code expects it to be as the tag
  8. is still present. Adding this new callback allows a DSA device to provide a
  9. new function that the flow_disscetor can use to get the correct offsets
  10. for the protocol field and network header offset.
  11. Signed-off-by: John Crispin <[email protected]>
  12. ---
  13. include/net/dsa.h | 4 +++-
  14. 1 file changed, 3 insertions(+), 1 deletion(-)
  15. --- a/include/net/dsa.h
  16. +++ b/include/net/dsa.h
  17. @@ -90,9 +90,11 @@ struct packet_type;
  18. struct dsa_device_ops {
  19. struct sk_buff *(*xmit)(struct sk_buff *skb, struct net_device *dev);
  20. - int sk_buff *(*rcv)(struct sk_buff *skb, struct net_device *dev,
  21. + int (*rcv)(struct sk_buff *skb, struct net_device *dev,
  22. struct packet_type *pt,
  23. struct net_device *orig_dev);
  24. + int (*flow_dissect)(const struct sk_buff *skb, __be16 *proto,
  25. + int *offset);
  26. };
  27. struct dsa_switch_tree {