diff options
author | Jiri Pirko <jiri@mellanox.com> | 2019-06-15 05:03:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-15 17:06:13 -0400 |
commit | a51486266c3ba8e035a47fa96df67f274fe0c7d0 (patch) | |
tree | 2d0cd2c81384ecf30958dc563d8ebacb4bbc0816 | |
parent | 9d9f3fba4c46a88d51cd3be580419b52e0d74c6d (diff) |
net: sched: remove NET_CLS_IND config option
This config option makes only couple of lines optional.
Two small helpers and an int in couple of cls structs.
Remove the config option and always compile this in.
This saves the user from unexpected surprises when he adds
a filter with ingress device match which is silently ignored
in case the config option is not set.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | arch/mips/configs/malta_defconfig | 1 | ||||
-rw-r--r-- | arch/mips/configs/malta_kvm_defconfig | 1 | ||||
-rw-r--r-- | arch/mips/configs/malta_kvm_guest_defconfig | 1 | ||||
-rw-r--r-- | arch/mips/configs/malta_qemu_32r6_defconfig | 1 | ||||
-rw-r--r-- | arch/mips/configs/maltaaprp_defconfig | 1 | ||||
-rw-r--r-- | arch/mips/configs/maltasmvp_defconfig | 1 | ||||
-rw-r--r-- | arch/mips/configs/maltasmvp_eva_defconfig | 1 | ||||
-rw-r--r-- | arch/mips/configs/maltaup_defconfig | 1 | ||||
-rw-r--r-- | arch/mips/configs/maltaup_xpa_defconfig | 1 | ||||
-rw-r--r-- | arch/mips/configs/rb532_defconfig | 1 | ||||
-rw-r--r-- | arch/powerpc/configs/ppc6xx_defconfig | 1 | ||||
-rw-r--r-- | arch/sh/configs/se7712_defconfig | 1 | ||||
-rw-r--r-- | arch/sh/configs/se7721_defconfig | 1 | ||||
-rw-r--r-- | arch/sh/configs/titan_defconfig | 1 | ||||
-rw-r--r-- | include/net/pkt_cls.h | 5 | ||||
-rw-r--r-- | include/uapi/linux/pkt_cls.h | 2 | ||||
-rw-r--r-- | net/sched/Kconfig | 8 | ||||
-rw-r--r-- | net/sched/cls_flower.c | 3 | ||||
-rw-r--r-- | net/sched/cls_fw.c | 13 | ||||
-rw-r--r-- | net/sched/cls_u32.c | 15 | ||||
-rw-r--r-- | tools/include/uapi/linux/pkt_cls.h | 2 | ||||
-rw-r--r-- | tools/testing/selftests/tc-testing/config | 1 |
22 files changed, 4 insertions, 59 deletions
diff --git a/arch/mips/configs/malta_defconfig b/arch/mips/configs/malta_defconfig index 0ee5e677662e..0de92ac1ca64 100644 --- a/arch/mips/configs/malta_defconfig +++ b/arch/mips/configs/malta_defconfig | |||
@@ -210,7 +210,6 @@ CONFIG_NET_ACT_NAT=m | |||
210 | CONFIG_NET_ACT_PEDIT=m | 210 | CONFIG_NET_ACT_PEDIT=m |
211 | CONFIG_NET_ACT_SIMP=m | 211 | CONFIG_NET_ACT_SIMP=m |
212 | CONFIG_NET_ACT_SKBEDIT=m | 212 | CONFIG_NET_ACT_SKBEDIT=m |
213 | CONFIG_NET_CLS_IND=y | ||
214 | CONFIG_CFG80211=m | 213 | CONFIG_CFG80211=m |
215 | CONFIG_MAC80211=m | 214 | CONFIG_MAC80211=m |
216 | CONFIG_MAC80211_MESH=y | 215 | CONFIG_MAC80211_MESH=y |
diff --git a/arch/mips/configs/malta_kvm_defconfig b/arch/mips/configs/malta_kvm_defconfig index 041bffac043b..efc3abace048 100644 --- a/arch/mips/configs/malta_kvm_defconfig +++ b/arch/mips/configs/malta_kvm_defconfig | |||
@@ -215,7 +215,6 @@ CONFIG_NET_ACT_NAT=m | |||
215 | CONFIG_NET_ACT_PEDIT=m | 215 | CONFIG_NET_ACT_PEDIT=m |
216 | CONFIG_NET_ACT_SIMP=m | 216 | CONFIG_NET_ACT_SIMP=m |
217 | CONFIG_NET_ACT_SKBEDIT=m | 217 | CONFIG_NET_ACT_SKBEDIT=m |
218 | CONFIG_NET_CLS_IND=y | ||
219 | CONFIG_CFG80211=m | 218 | CONFIG_CFG80211=m |
220 | CONFIG_MAC80211=m | 219 | CONFIG_MAC80211=m |
221 | CONFIG_MAC80211_MESH=y | 220 | CONFIG_MAC80211_MESH=y |
diff --git a/arch/mips/configs/malta_kvm_guest_defconfig b/arch/mips/configs/malta_kvm_guest_defconfig index 511065e62182..c6ceeca4394d 100644 --- a/arch/mips/configs/malta_kvm_guest_defconfig +++ b/arch/mips/configs/malta_kvm_guest_defconfig | |||
@@ -212,7 +212,6 @@ CONFIG_NET_ACT_NAT=m | |||
212 | CONFIG_NET_ACT_PEDIT=m | 212 | CONFIG_NET_ACT_PEDIT=m |
213 | CONFIG_NET_ACT_SIMP=m | 213 | CONFIG_NET_ACT_SIMP=m |
214 | CONFIG_NET_ACT_SKBEDIT=m | 214 | CONFIG_NET_ACT_SKBEDIT=m |
215 | CONFIG_NET_CLS_IND=y | ||
216 | CONFIG_CFG80211=m | 215 | CONFIG_CFG80211=m |
217 | CONFIG_MAC80211=m | 216 | CONFIG_MAC80211=m |
218 | CONFIG_MAC80211_MESH=y | 217 | CONFIG_MAC80211_MESH=y |
diff --git a/arch/mips/configs/malta_qemu_32r6_defconfig b/arch/mips/configs/malta_qemu_32r6_defconfig index 299088043164..e6c600dc1814 100644 --- a/arch/mips/configs/malta_qemu_32r6_defconfig +++ b/arch/mips/configs/malta_qemu_32r6_defconfig | |||
@@ -74,7 +74,6 @@ CONFIG_NET_CLS_RSVP=m | |||
74 | CONFIG_NET_CLS_RSVP6=m | 74 | CONFIG_NET_CLS_RSVP6=m |
75 | CONFIG_NET_CLS_ACT=y | 75 | CONFIG_NET_CLS_ACT=y |
76 | CONFIG_NET_ACT_POLICE=y | 76 | CONFIG_NET_ACT_POLICE=y |
77 | CONFIG_NET_CLS_IND=y | ||
78 | # CONFIG_WIRELESS is not set | 77 | # CONFIG_WIRELESS is not set |
79 | CONFIG_DEVTMPFS=y | 78 | CONFIG_DEVTMPFS=y |
80 | CONFIG_BLK_DEV_LOOP=y | 79 | CONFIG_BLK_DEV_LOOP=y |
diff --git a/arch/mips/configs/maltaaprp_defconfig b/arch/mips/configs/maltaaprp_defconfig index 2b4b3a24f637..82b44b774553 100644 --- a/arch/mips/configs/maltaaprp_defconfig +++ b/arch/mips/configs/maltaaprp_defconfig | |||
@@ -76,7 +76,6 @@ CONFIG_NET_CLS_RSVP=m | |||
76 | CONFIG_NET_CLS_RSVP6=m | 76 | CONFIG_NET_CLS_RSVP6=m |
77 | CONFIG_NET_CLS_ACT=y | 77 | CONFIG_NET_CLS_ACT=y |
78 | CONFIG_NET_ACT_POLICE=y | 78 | CONFIG_NET_ACT_POLICE=y |
79 | CONFIG_NET_CLS_IND=y | ||
80 | # CONFIG_WIRELESS is not set | 79 | # CONFIG_WIRELESS is not set |
81 | CONFIG_DEVTMPFS=y | 80 | CONFIG_DEVTMPFS=y |
82 | CONFIG_BLK_DEV_LOOP=y | 81 | CONFIG_BLK_DEV_LOOP=y |
diff --git a/arch/mips/configs/maltasmvp_defconfig b/arch/mips/configs/maltasmvp_defconfig index 425ddfd7cd78..4190fc6189a0 100644 --- a/arch/mips/configs/maltasmvp_defconfig +++ b/arch/mips/configs/maltasmvp_defconfig | |||
@@ -77,7 +77,6 @@ CONFIG_NET_CLS_RSVP=m | |||
77 | CONFIG_NET_CLS_RSVP6=m | 77 | CONFIG_NET_CLS_RSVP6=m |
78 | CONFIG_NET_CLS_ACT=y | 78 | CONFIG_NET_CLS_ACT=y |
79 | CONFIG_NET_ACT_POLICE=y | 79 | CONFIG_NET_ACT_POLICE=y |
80 | CONFIG_NET_CLS_IND=y | ||
81 | # CONFIG_WIRELESS is not set | 80 | # CONFIG_WIRELESS is not set |
82 | CONFIG_DEVTMPFS=y | 81 | CONFIG_DEVTMPFS=y |
83 | CONFIG_BLK_DEV_LOOP=y | 82 | CONFIG_BLK_DEV_LOOP=y |
diff --git a/arch/mips/configs/maltasmvp_eva_defconfig b/arch/mips/configs/maltasmvp_eva_defconfig index 8beaa7ba1e52..a13c10e910ec 100644 --- a/arch/mips/configs/maltasmvp_eva_defconfig +++ b/arch/mips/configs/maltasmvp_eva_defconfig | |||
@@ -78,7 +78,6 @@ CONFIG_NET_CLS_RSVP=m | |||
78 | CONFIG_NET_CLS_RSVP6=m | 78 | CONFIG_NET_CLS_RSVP6=m |
79 | CONFIG_NET_CLS_ACT=y | 79 | CONFIG_NET_CLS_ACT=y |
80 | CONFIG_NET_ACT_POLICE=y | 80 | CONFIG_NET_ACT_POLICE=y |
81 | CONFIG_NET_CLS_IND=y | ||
82 | # CONFIG_WIRELESS is not set | 81 | # CONFIG_WIRELESS is not set |
83 | CONFIG_DEVTMPFS=y | 82 | CONFIG_DEVTMPFS=y |
84 | CONFIG_BLK_DEV_LOOP=y | 83 | CONFIG_BLK_DEV_LOOP=y |
diff --git a/arch/mips/configs/maltaup_defconfig b/arch/mips/configs/maltaup_defconfig index 6e8b95ceb54a..b35f1fc690fb 100644 --- a/arch/mips/configs/maltaup_defconfig +++ b/arch/mips/configs/maltaup_defconfig | |||
@@ -75,7 +75,6 @@ CONFIG_NET_CLS_RSVP=m | |||
75 | CONFIG_NET_CLS_RSVP6=m | 75 | CONFIG_NET_CLS_RSVP6=m |
76 | CONFIG_NET_CLS_ACT=y | 76 | CONFIG_NET_CLS_ACT=y |
77 | CONFIG_NET_ACT_POLICE=y | 77 | CONFIG_NET_ACT_POLICE=y |
78 | CONFIG_NET_CLS_IND=y | ||
79 | # CONFIG_WIRELESS is not set | 78 | # CONFIG_WIRELESS is not set |
80 | CONFIG_DEVTMPFS=y | 79 | CONFIG_DEVTMPFS=y |
81 | CONFIG_BLK_DEV_LOOP=y | 80 | CONFIG_BLK_DEV_LOOP=y |
diff --git a/arch/mips/configs/maltaup_xpa_defconfig b/arch/mips/configs/maltaup_xpa_defconfig index 6c026db96ff9..56861aef2756 100644 --- a/arch/mips/configs/maltaup_xpa_defconfig +++ b/arch/mips/configs/maltaup_xpa_defconfig | |||
@@ -212,7 +212,6 @@ CONFIG_NET_ACT_NAT=m | |||
212 | CONFIG_NET_ACT_PEDIT=m | 212 | CONFIG_NET_ACT_PEDIT=m |
213 | CONFIG_NET_ACT_SIMP=m | 213 | CONFIG_NET_ACT_SIMP=m |
214 | CONFIG_NET_ACT_SKBEDIT=m | 214 | CONFIG_NET_ACT_SKBEDIT=m |
215 | CONFIG_NET_CLS_IND=y | ||
216 | CONFIG_CFG80211=m | 215 | CONFIG_CFG80211=m |
217 | CONFIG_MAC80211=m | 216 | CONFIG_MAC80211=m |
218 | CONFIG_MAC80211_MESH=y | 217 | CONFIG_MAC80211_MESH=y |
diff --git a/arch/mips/configs/rb532_defconfig b/arch/mips/configs/rb532_defconfig index 50632a3103dd..864c70fbe668 100644 --- a/arch/mips/configs/rb532_defconfig +++ b/arch/mips/configs/rb532_defconfig | |||
@@ -103,7 +103,6 @@ CONFIG_GACT_PROB=y | |||
103 | CONFIG_NET_ACT_MIRRED=m | 103 | CONFIG_NET_ACT_MIRRED=m |
104 | CONFIG_NET_ACT_IPT=m | 104 | CONFIG_NET_ACT_IPT=m |
105 | CONFIG_NET_ACT_PEDIT=m | 105 | CONFIG_NET_ACT_PEDIT=m |
106 | CONFIG_NET_CLS_IND=y | ||
107 | CONFIG_HAMRADIO=y | 106 | CONFIG_HAMRADIO=y |
108 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 107 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
109 | CONFIG_MTD=y | 108 | CONFIG_MTD=y |
diff --git a/arch/powerpc/configs/ppc6xx_defconfig b/arch/powerpc/configs/ppc6xx_defconfig index 7c6baf6df139..aa51b9b66fa2 100644 --- a/arch/powerpc/configs/ppc6xx_defconfig +++ b/arch/powerpc/configs/ppc6xx_defconfig | |||
@@ -301,7 +301,6 @@ CONFIG_NET_ACT_NAT=m | |||
301 | CONFIG_NET_ACT_PEDIT=m | 301 | CONFIG_NET_ACT_PEDIT=m |
302 | CONFIG_NET_ACT_SIMP=m | 302 | CONFIG_NET_ACT_SIMP=m |
303 | CONFIG_NET_ACT_SKBEDIT=m | 303 | CONFIG_NET_ACT_SKBEDIT=m |
304 | CONFIG_NET_CLS_IND=y | ||
305 | CONFIG_IRDA=m | 304 | CONFIG_IRDA=m |
306 | CONFIG_IRLAN=m | 305 | CONFIG_IRLAN=m |
307 | CONFIG_IRNET=m | 306 | CONFIG_IRNET=m |
diff --git a/arch/sh/configs/se7712_defconfig b/arch/sh/configs/se7712_defconfig index 5a1097641247..1e116529735f 100644 --- a/arch/sh/configs/se7712_defconfig +++ b/arch/sh/configs/se7712_defconfig | |||
@@ -63,7 +63,6 @@ CONFIG_NET_SCH_NETEM=y | |||
63 | CONFIG_NET_CLS_TCINDEX=y | 63 | CONFIG_NET_CLS_TCINDEX=y |
64 | CONFIG_NET_CLS_ROUTE4=y | 64 | CONFIG_NET_CLS_ROUTE4=y |
65 | CONFIG_NET_CLS_FW=y | 65 | CONFIG_NET_CLS_FW=y |
66 | CONFIG_NET_CLS_IND=y | ||
67 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 66 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
68 | CONFIG_MTD=y | 67 | CONFIG_MTD=y |
69 | CONFIG_MTD_BLOCK=y | 68 | CONFIG_MTD_BLOCK=y |
diff --git a/arch/sh/configs/se7721_defconfig b/arch/sh/configs/se7721_defconfig index 9c0ef13bee10..c66e512719ab 100644 --- a/arch/sh/configs/se7721_defconfig +++ b/arch/sh/configs/se7721_defconfig | |||
@@ -62,7 +62,6 @@ CONFIG_NET_SCH_NETEM=y | |||
62 | CONFIG_NET_CLS_TCINDEX=y | 62 | CONFIG_NET_CLS_TCINDEX=y |
63 | CONFIG_NET_CLS_ROUTE4=y | 63 | CONFIG_NET_CLS_ROUTE4=y |
64 | CONFIG_NET_CLS_FW=y | 64 | CONFIG_NET_CLS_FW=y |
65 | CONFIG_NET_CLS_IND=y | ||
66 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 65 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
67 | CONFIG_MTD=y | 66 | CONFIG_MTD=y |
68 | CONFIG_MTD_BLOCK=y | 67 | CONFIG_MTD_BLOCK=y |
diff --git a/arch/sh/configs/titan_defconfig b/arch/sh/configs/titan_defconfig index 822fa9e96f74..171ab05ce4fc 100644 --- a/arch/sh/configs/titan_defconfig +++ b/arch/sh/configs/titan_defconfig | |||
@@ -142,7 +142,6 @@ CONFIG_GACT_PROB=y | |||
142 | CONFIG_NET_ACT_MIRRED=m | 142 | CONFIG_NET_ACT_MIRRED=m |
143 | CONFIG_NET_ACT_IPT=m | 143 | CONFIG_NET_ACT_IPT=m |
144 | CONFIG_NET_ACT_PEDIT=m | 144 | CONFIG_NET_ACT_PEDIT=m |
145 | CONFIG_NET_CLS_IND=y | ||
146 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 145 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
147 | CONFIG_FW_LOADER=m | 146 | CONFIG_FW_LOADER=m |
148 | CONFIG_CONNECTOR=m | 147 | CONFIG_CONNECTOR=m |
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h index 514e3c80ecc1..720f2b32fc2f 100644 --- a/include/net/pkt_cls.h +++ b/include/net/pkt_cls.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <net/sch_generic.h> | 7 | #include <net/sch_generic.h> |
8 | #include <net/act_api.h> | 8 | #include <net/act_api.h> |
9 | #include <net/flow_offload.h> | 9 | #include <net/flow_offload.h> |
10 | #include <net/net_namespace.h> | ||
10 | 11 | ||
11 | /* TC action not accessible from user space */ | 12 | /* TC action not accessible from user space */ |
12 | #define TC_ACT_REINSERT (TC_ACT_VALUE_MAX + 1) | 13 | #define TC_ACT_REINSERT (TC_ACT_VALUE_MAX + 1) |
@@ -576,9 +577,6 @@ static inline int tcf_valid_offset(const struct sk_buff *skb, | |||
576 | (ptr <= (ptr + len))); | 577 | (ptr <= (ptr + len))); |
577 | } | 578 | } |
578 | 579 | ||
579 | #ifdef CONFIG_NET_CLS_IND | ||
580 | #include <net/net_namespace.h> | ||
581 | |||
582 | static inline int | 580 | static inline int |
583 | tcf_change_indev(struct net *net, struct nlattr *indev_tlv, | 581 | tcf_change_indev(struct net *net, struct nlattr *indev_tlv, |
584 | struct netlink_ext_ack *extack) | 582 | struct netlink_ext_ack *extack) |
@@ -605,7 +603,6 @@ tcf_match_indev(struct sk_buff *skb, int ifindex) | |||
605 | return false; | 603 | return false; |
606 | return ifindex == skb->skb_iif; | 604 | return ifindex == skb->skb_iif; |
607 | } | 605 | } |
608 | #endif /* CONFIG_NET_CLS_IND */ | ||
609 | 606 | ||
610 | int tc_setup_flow_action(struct flow_action *flow_action, | 607 | int tc_setup_flow_action(struct flow_action *flow_action, |
611 | const struct tcf_exts *exts); | 608 | const struct tcf_exts *exts); |
diff --git a/include/uapi/linux/pkt_cls.h b/include/uapi/linux/pkt_cls.h index a93680fc4bfa..8cc6b6777b3c 100644 --- a/include/uapi/linux/pkt_cls.h +++ b/include/uapi/linux/pkt_cls.h | |||
@@ -295,7 +295,7 @@ enum { | |||
295 | TCA_FW_UNSPEC, | 295 | TCA_FW_UNSPEC, |
296 | TCA_FW_CLASSID, | 296 | TCA_FW_CLASSID, |
297 | TCA_FW_POLICE, | 297 | TCA_FW_POLICE, |
298 | TCA_FW_INDEV, /* used by CONFIG_NET_CLS_IND */ | 298 | TCA_FW_INDEV, |
299 | TCA_FW_ACT, /* used by CONFIG_NET_CLS_ACT */ | 299 | TCA_FW_ACT, /* used by CONFIG_NET_CLS_ACT */ |
300 | TCA_FW_MASK, | 300 | TCA_FW_MASK, |
301 | __TCA_FW_MAX | 301 | __TCA_FW_MAX |
diff --git a/net/sched/Kconfig b/net/sched/Kconfig index d104f7ee26c7..360fdd3eaa77 100644 --- a/net/sched/Kconfig +++ b/net/sched/Kconfig | |||
@@ -941,14 +941,6 @@ config NET_IFE_SKBTCINDEX | |||
941 | tristate "Support to encoding decoding skb tcindex on IFE action" | 941 | tristate "Support to encoding decoding skb tcindex on IFE action" |
942 | depends on NET_ACT_IFE | 942 | depends on NET_ACT_IFE |
943 | 943 | ||
944 | config NET_CLS_IND | ||
945 | bool "Incoming device classification" | ||
946 | depends on NET_CLS_U32 || NET_CLS_FW | ||
947 | ---help--- | ||
948 | Say Y here to extend the u32 and fw classifier to support | ||
949 | classification based on the incoming device. This option is | ||
950 | likely to disappear in favour of the metadata ematch. | ||
951 | |||
952 | endif # NET_SCHED | 944 | endif # NET_SCHED |
953 | 945 | ||
954 | config NET_SCH_FIFO | 946 | config NET_SCH_FIFO |
diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c index c388372df0e2..84c7f279855b 100644 --- a/net/sched/cls_flower.c +++ b/net/sched/cls_flower.c | |||
@@ -1010,7 +1010,7 @@ static int fl_set_key(struct net *net, struct nlattr **tb, | |||
1010 | { | 1010 | { |
1011 | __be16 ethertype; | 1011 | __be16 ethertype; |
1012 | int ret = 0; | 1012 | int ret = 0; |
1013 | #ifdef CONFIG_NET_CLS_IND | 1013 | |
1014 | if (tb[TCA_FLOWER_INDEV]) { | 1014 | if (tb[TCA_FLOWER_INDEV]) { |
1015 | int err = tcf_change_indev(net, tb[TCA_FLOWER_INDEV], extack); | 1015 | int err = tcf_change_indev(net, tb[TCA_FLOWER_INDEV], extack); |
1016 | if (err < 0) | 1016 | if (err < 0) |
@@ -1018,7 +1018,6 @@ static int fl_set_key(struct net *net, struct nlattr **tb, | |||
1018 | key->indev_ifindex = err; | 1018 | key->indev_ifindex = err; |
1019 | mask->indev_ifindex = 0xffffffff; | 1019 | mask->indev_ifindex = 0xffffffff; |
1020 | } | 1020 | } |
1021 | #endif | ||
1022 | 1021 | ||
1023 | fl_set_key_val(tb, key->eth.dst, TCA_FLOWER_KEY_ETH_DST, | 1022 | fl_set_key_val(tb, key->eth.dst, TCA_FLOWER_KEY_ETH_DST, |
1024 | mask->eth.dst, TCA_FLOWER_KEY_ETH_DST_MASK, | 1023 | mask->eth.dst, TCA_FLOWER_KEY_ETH_DST_MASK, |
diff --git a/net/sched/cls_fw.c b/net/sched/cls_fw.c index 4dab833f66cb..c9496c920d6f 100644 --- a/net/sched/cls_fw.c +++ b/net/sched/cls_fw.c | |||
@@ -8,9 +8,6 @@ | |||
8 | * Karlis Peisenieks <karlis@mt.lv> : 990415 : fw_walk off by one | 8 | * Karlis Peisenieks <karlis@mt.lv> : 990415 : fw_walk off by one |
9 | * Karlis Peisenieks <karlis@mt.lv> : 990415 : fw_delete killed all the filter (and kernel). | 9 | * Karlis Peisenieks <karlis@mt.lv> : 990415 : fw_delete killed all the filter (and kernel). |
10 | * Alex <alex@pilotsoft.com> : 2004xxyy: Added Action extension | 10 | * Alex <alex@pilotsoft.com> : 2004xxyy: Added Action extension |
11 | * | ||
12 | * JHS: We should remove the CONFIG_NET_CLS_IND from here | ||
13 | * eventually when the meta match extension is made available | ||
14 | */ | 11 | */ |
15 | 12 | ||
16 | #include <linux/module.h> | 13 | #include <linux/module.h> |
@@ -37,9 +34,7 @@ struct fw_filter { | |||
37 | struct fw_filter __rcu *next; | 34 | struct fw_filter __rcu *next; |
38 | u32 id; | 35 | u32 id; |
39 | struct tcf_result res; | 36 | struct tcf_result res; |
40 | #ifdef CONFIG_NET_CLS_IND | ||
41 | int ifindex; | 37 | int ifindex; |
42 | #endif /* CONFIG_NET_CLS_IND */ | ||
43 | struct tcf_exts exts; | 38 | struct tcf_exts exts; |
44 | struct tcf_proto *tp; | 39 | struct tcf_proto *tp; |
45 | struct rcu_work rwork; | 40 | struct rcu_work rwork; |
@@ -67,10 +62,8 @@ static int fw_classify(struct sk_buff *skb, const struct tcf_proto *tp, | |||
67 | f = rcu_dereference_bh(f->next)) { | 62 | f = rcu_dereference_bh(f->next)) { |
68 | if (f->id == id) { | 63 | if (f->id == id) { |
69 | *res = f->res; | 64 | *res = f->res; |
70 | #ifdef CONFIG_NET_CLS_IND | ||
71 | if (!tcf_match_indev(skb, f->ifindex)) | 65 | if (!tcf_match_indev(skb, f->ifindex)) |
72 | continue; | 66 | continue; |
73 | #endif /* CONFIG_NET_CLS_IND */ | ||
74 | r = tcf_exts_exec(skb, &f->exts, res); | 67 | r = tcf_exts_exec(skb, &f->exts, res); |
75 | if (r < 0) | 68 | if (r < 0) |
76 | continue; | 69 | continue; |
@@ -222,7 +215,6 @@ static int fw_set_parms(struct net *net, struct tcf_proto *tp, | |||
222 | tcf_bind_filter(tp, &f->res, base); | 215 | tcf_bind_filter(tp, &f->res, base); |
223 | } | 216 | } |
224 | 217 | ||
225 | #ifdef CONFIG_NET_CLS_IND | ||
226 | if (tb[TCA_FW_INDEV]) { | 218 | if (tb[TCA_FW_INDEV]) { |
227 | int ret; | 219 | int ret; |
228 | ret = tcf_change_indev(net, tb[TCA_FW_INDEV], extack); | 220 | ret = tcf_change_indev(net, tb[TCA_FW_INDEV], extack); |
@@ -230,7 +222,6 @@ static int fw_set_parms(struct net *net, struct tcf_proto *tp, | |||
230 | return ret; | 222 | return ret; |
231 | f->ifindex = ret; | 223 | f->ifindex = ret; |
232 | } | 224 | } |
233 | #endif /* CONFIG_NET_CLS_IND */ | ||
234 | 225 | ||
235 | err = -EINVAL; | 226 | err = -EINVAL; |
236 | if (tb[TCA_FW_MASK]) { | 227 | if (tb[TCA_FW_MASK]) { |
@@ -276,9 +267,7 @@ static int fw_change(struct net *net, struct sk_buff *in_skb, | |||
276 | 267 | ||
277 | fnew->id = f->id; | 268 | fnew->id = f->id; |
278 | fnew->res = f->res; | 269 | fnew->res = f->res; |
279 | #ifdef CONFIG_NET_CLS_IND | ||
280 | fnew->ifindex = f->ifindex; | 270 | fnew->ifindex = f->ifindex; |
281 | #endif /* CONFIG_NET_CLS_IND */ | ||
282 | fnew->tp = f->tp; | 271 | fnew->tp = f->tp; |
283 | 272 | ||
284 | err = tcf_exts_init(&fnew->exts, net, TCA_FW_ACT, | 273 | err = tcf_exts_init(&fnew->exts, net, TCA_FW_ACT, |
@@ -405,14 +394,12 @@ static int fw_dump(struct net *net, struct tcf_proto *tp, void *fh, | |||
405 | if (f->res.classid && | 394 | if (f->res.classid && |
406 | nla_put_u32(skb, TCA_FW_CLASSID, f->res.classid)) | 395 | nla_put_u32(skb, TCA_FW_CLASSID, f->res.classid)) |
407 | goto nla_put_failure; | 396 | goto nla_put_failure; |
408 | #ifdef CONFIG_NET_CLS_IND | ||
409 | if (f->ifindex) { | 397 | if (f->ifindex) { |
410 | struct net_device *dev; | 398 | struct net_device *dev; |
411 | dev = __dev_get_by_index(net, f->ifindex); | 399 | dev = __dev_get_by_index(net, f->ifindex); |
412 | if (dev && nla_put_string(skb, TCA_FW_INDEV, dev->name)) | 400 | if (dev && nla_put_string(skb, TCA_FW_INDEV, dev->name)) |
413 | goto nla_put_failure; | 401 | goto nla_put_failure; |
414 | } | 402 | } |
415 | #endif /* CONFIG_NET_CLS_IND */ | ||
416 | if (head->mask != 0xFFFFFFFF && | 403 | if (head->mask != 0xFFFFFFFF && |
417 | nla_put_u32(skb, TCA_FW_MASK, head->mask)) | 404 | nla_put_u32(skb, TCA_FW_MASK, head->mask)) |
418 | goto nla_put_failure; | 405 | goto nla_put_failure; |
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index c7727de5e073..be9e46c77e8b 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c | |||
@@ -20,9 +20,6 @@ | |||
20 | * pure RSVP doesn't need such a general approach and can use | 20 | * pure RSVP doesn't need such a general approach and can use |
21 | * much simpler (and faster) schemes, sort of cls_rsvp.c. | 21 | * much simpler (and faster) schemes, sort of cls_rsvp.c. |
22 | * | 22 | * |
23 | * JHS: We should remove the CONFIG_NET_CLS_IND from here | ||
24 | * eventually when the meta match extension is made available | ||
25 | * | ||
26 | * nfmark match added by Catalin(ux aka Dino) BOIE <catab at umbrella.ro> | 23 | * nfmark match added by Catalin(ux aka Dino) BOIE <catab at umbrella.ro> |
27 | */ | 24 | */ |
28 | 25 | ||
@@ -48,9 +45,7 @@ struct tc_u_knode { | |||
48 | u32 handle; | 45 | u32 handle; |
49 | struct tc_u_hnode __rcu *ht_up; | 46 | struct tc_u_hnode __rcu *ht_up; |
50 | struct tcf_exts exts; | 47 | struct tcf_exts exts; |
51 | #ifdef CONFIG_NET_CLS_IND | ||
52 | int ifindex; | 48 | int ifindex; |
53 | #endif | ||
54 | u8 fshift; | 49 | u8 fshift; |
55 | struct tcf_result res; | 50 | struct tcf_result res; |
56 | struct tc_u_hnode __rcu *ht_down; | 51 | struct tc_u_hnode __rcu *ht_down; |
@@ -176,12 +171,10 @@ check_terminal: | |||
176 | if (n->sel.flags & TC_U32_TERMINAL) { | 171 | if (n->sel.flags & TC_U32_TERMINAL) { |
177 | 172 | ||
178 | *res = n->res; | 173 | *res = n->res; |
179 | #ifdef CONFIG_NET_CLS_IND | ||
180 | if (!tcf_match_indev(skb, n->ifindex)) { | 174 | if (!tcf_match_indev(skb, n->ifindex)) { |
181 | n = rcu_dereference_bh(n->next); | 175 | n = rcu_dereference_bh(n->next); |
182 | goto next_knode; | 176 | goto next_knode; |
183 | } | 177 | } |
184 | #endif | ||
185 | #ifdef CONFIG_CLS_U32_PERF | 178 | #ifdef CONFIG_CLS_U32_PERF |
186 | __this_cpu_inc(n->pf->rhit); | 179 | __this_cpu_inc(n->pf->rhit); |
187 | #endif | 180 | #endif |
@@ -761,7 +754,6 @@ static int u32_set_parms(struct net *net, struct tcf_proto *tp, | |||
761 | tcf_bind_filter(tp, &n->res, base); | 754 | tcf_bind_filter(tp, &n->res, base); |
762 | } | 755 | } |
763 | 756 | ||
764 | #ifdef CONFIG_NET_CLS_IND | ||
765 | if (tb[TCA_U32_INDEV]) { | 757 | if (tb[TCA_U32_INDEV]) { |
766 | int ret; | 758 | int ret; |
767 | ret = tcf_change_indev(net, tb[TCA_U32_INDEV], extack); | 759 | ret = tcf_change_indev(net, tb[TCA_U32_INDEV], extack); |
@@ -769,7 +761,6 @@ static int u32_set_parms(struct net *net, struct tcf_proto *tp, | |||
769 | return -EINVAL; | 761 | return -EINVAL; |
770 | n->ifindex = ret; | 762 | n->ifindex = ret; |
771 | } | 763 | } |
772 | #endif | ||
773 | return 0; | 764 | return 0; |
774 | } | 765 | } |
775 | 766 | ||
@@ -817,9 +808,7 @@ static struct tc_u_knode *u32_init_knode(struct net *net, struct tcf_proto *tp, | |||
817 | new->handle = n->handle; | 808 | new->handle = n->handle; |
818 | RCU_INIT_POINTER(new->ht_up, n->ht_up); | 809 | RCU_INIT_POINTER(new->ht_up, n->ht_up); |
819 | 810 | ||
820 | #ifdef CONFIG_NET_CLS_IND | ||
821 | new->ifindex = n->ifindex; | 811 | new->ifindex = n->ifindex; |
822 | #endif | ||
823 | new->fshift = n->fshift; | 812 | new->fshift = n->fshift; |
824 | new->res = n->res; | 813 | new->res = n->res; |
825 | new->flags = n->flags; | 814 | new->flags = n->flags; |
@@ -1351,14 +1340,12 @@ static int u32_dump(struct net *net, struct tcf_proto *tp, void *fh, | |||
1351 | if (tcf_exts_dump(skb, &n->exts) < 0) | 1340 | if (tcf_exts_dump(skb, &n->exts) < 0) |
1352 | goto nla_put_failure; | 1341 | goto nla_put_failure; |
1353 | 1342 | ||
1354 | #ifdef CONFIG_NET_CLS_IND | ||
1355 | if (n->ifindex) { | 1343 | if (n->ifindex) { |
1356 | struct net_device *dev; | 1344 | struct net_device *dev; |
1357 | dev = __dev_get_by_index(net, n->ifindex); | 1345 | dev = __dev_get_by_index(net, n->ifindex); |
1358 | if (dev && nla_put_string(skb, TCA_U32_INDEV, dev->name)) | 1346 | if (dev && nla_put_string(skb, TCA_U32_INDEV, dev->name)) |
1359 | goto nla_put_failure; | 1347 | goto nla_put_failure; |
1360 | } | 1348 | } |
1361 | #endif | ||
1362 | #ifdef CONFIG_CLS_U32_PERF | 1349 | #ifdef CONFIG_CLS_U32_PERF |
1363 | gpf = kzalloc(sizeof(struct tc_u32_pcnt) + | 1350 | gpf = kzalloc(sizeof(struct tc_u32_pcnt) + |
1364 | n->sel.nkeys * sizeof(u64), | 1351 | n->sel.nkeys * sizeof(u64), |
@@ -1422,9 +1409,7 @@ static int __init init_u32(void) | |||
1422 | #ifdef CONFIG_CLS_U32_PERF | 1409 | #ifdef CONFIG_CLS_U32_PERF |
1423 | pr_info(" Performance counters on\n"); | 1410 | pr_info(" Performance counters on\n"); |
1424 | #endif | 1411 | #endif |
1425 | #ifdef CONFIG_NET_CLS_IND | ||
1426 | pr_info(" input device check on\n"); | 1412 | pr_info(" input device check on\n"); |
1427 | #endif | ||
1428 | #ifdef CONFIG_NET_CLS_ACT | 1413 | #ifdef CONFIG_NET_CLS_ACT |
1429 | pr_info(" Actions configured\n"); | 1414 | pr_info(" Actions configured\n"); |
1430 | #endif | 1415 | #endif |
diff --git a/tools/include/uapi/linux/pkt_cls.h b/tools/include/uapi/linux/pkt_cls.h index 401d0c1e612d..12153771396a 100644 --- a/tools/include/uapi/linux/pkt_cls.h +++ b/tools/include/uapi/linux/pkt_cls.h | |||
@@ -257,7 +257,7 @@ enum { | |||
257 | TCA_FW_UNSPEC, | 257 | TCA_FW_UNSPEC, |
258 | TCA_FW_CLASSID, | 258 | TCA_FW_CLASSID, |
259 | TCA_FW_POLICE, | 259 | TCA_FW_POLICE, |
260 | TCA_FW_INDEV, /* used by CONFIG_NET_CLS_IND */ | 260 | TCA_FW_INDEV, |
261 | TCA_FW_ACT, /* used by CONFIG_NET_CLS_ACT */ | 261 | TCA_FW_ACT, /* used by CONFIG_NET_CLS_ACT */ |
262 | TCA_FW_MASK, | 262 | TCA_FW_MASK, |
263 | __TCA_FW_MAX | 263 | __TCA_FW_MAX |
diff --git a/tools/testing/selftests/tc-testing/config b/tools/testing/selftests/tc-testing/config index b235efd55367..1adc4f9bb795 100644 --- a/tools/testing/selftests/tc-testing/config +++ b/tools/testing/selftests/tc-testing/config | |||
@@ -45,5 +45,4 @@ CONFIG_NET_ACT_TUNNEL_KEY=m | |||
45 | CONFIG_NET_IFE_SKBMARK=m | 45 | CONFIG_NET_IFE_SKBMARK=m |
46 | CONFIG_NET_IFE_SKBPRIO=m | 46 | CONFIG_NET_IFE_SKBPRIO=m |
47 | CONFIG_NET_IFE_SKBTCINDEX=m | 47 | CONFIG_NET_IFE_SKBTCINDEX=m |
48 | CONFIG_NET_CLS_IND=y | ||
49 | CONFIG_NET_SCH_FIFO=y | 48 | CONFIG_NET_SCH_FIFO=y |