970983ea01a5b3af098870d02bb09326d47b3175
[oweals/openwrt.git] / target / linux / ipq40xx / patches-5.4 / 703-net-IPQ4019-needs-rfs-vlan_tag-callbacks-in.patch
1 From 7c129254adb1093d10a62ed7bf7b956fcc6ffe34 Mon Sep 17 00:00:00 2001
2 From: Rakesh Nair <ranair@codeaurora.org>
3 Date: Wed, 20 Jul 2016 15:02:01 +0530
4 Subject: [PATCH] net: IPQ4019 needs rfs/vlan_tag callbacks in
5  netdev_ops
6
7 Add callback support to get default vlan tag and register
8 receive flow steering filter.
9
10 Used by IPQ4019 ess-edma driver.
11
12 BUG=chrome-os-partner:33096
13 TEST=none
14
15 Change-Id: I266070e4a0fbe4a0d9966fe79a71e50ec4f26c75
16 Signed-off-by: Rakesh Nair <ranair@codeaurora.org>
17 Reviewed-on: https://chromium-review.googlesource.com/362203
18 Commit-Ready: Grant Grundler <grundler@chromium.org>
19 Tested-by: Grant Grundler <grundler@chromium.org>
20 Reviewed-by: Grant Grundler <grundler@chromium.org>
21 ---
22  include/linux/netdevice.h | 13 +++++++++++++
23  1 file changed, 13 insertions(+)
24
25 --- a/include/linux/netdevice.h
26 +++ b/include/linux/netdevice.h
27 @@ -771,6 +771,16 @@ struct xps_map {
28  #define XPS_MIN_MAP_ALLOC ((L1_CACHE_ALIGN(offsetof(struct xps_map, queues[1])) \
29         - sizeof(struct xps_map)) / sizeof(u16))
30  
31 +#ifdef CONFIG_RFS_ACCEL
32 +typedef int (*set_rfs_filter_callback_t)(struct net_device *dev,
33 +                                     __be32 src,
34 +                                     __be32 dst,
35 +                                     __be16 sport,
36 +                                     __be16 dport,
37 +                                     u8 proto,
38 +                                     u16 rxq_index,
39 +                                     u32 action);
40 +#endif
41  /*
42   * This structure holds all XPS maps for device.  Maps are indexed by CPU.
43   */
44 @@ -1374,6 +1384,9 @@ struct net_device_ops {
45                                                      const struct sk_buff *skb,
46                                                      u16 rxq_index,
47                                                      u32 flow_id);
48 +        int                     (*ndo_register_rfs_filter)(struct net_device *dev,
49 +                                                              set_rfs_filter_callback_t set_filter);
50 +        int                     (*ndo_get_default_vlan_tag)(struct net_device *net);
51  #endif
52         int                     (*ndo_add_slave)(struct net_device *dev,
53                                                  struct net_device *slave_dev,