Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jiri Pirko and committed by
David S. Miller
a5148626 9d9f3fba

+4 -59
-1
arch/mips/configs/malta_defconfig
··· 210 210 CONFIG_NET_ACT_PEDIT=m 211 211 CONFIG_NET_ACT_SIMP=m 212 212 CONFIG_NET_ACT_SKBEDIT=m 213 - CONFIG_NET_CLS_IND=y 214 213 CONFIG_CFG80211=m 215 214 CONFIG_MAC80211=m 216 215 CONFIG_MAC80211_MESH=y
-1
arch/mips/configs/malta_kvm_defconfig
··· 215 215 CONFIG_NET_ACT_PEDIT=m 216 216 CONFIG_NET_ACT_SIMP=m 217 217 CONFIG_NET_ACT_SKBEDIT=m 218 - CONFIG_NET_CLS_IND=y 219 218 CONFIG_CFG80211=m 220 219 CONFIG_MAC80211=m 221 220 CONFIG_MAC80211_MESH=y
-1
arch/mips/configs/malta_kvm_guest_defconfig
··· 212 212 CONFIG_NET_ACT_PEDIT=m 213 213 CONFIG_NET_ACT_SIMP=m 214 214 CONFIG_NET_ACT_SKBEDIT=m 215 - CONFIG_NET_CLS_IND=y 216 215 CONFIG_CFG80211=m 217 216 CONFIG_MAC80211=m 218 217 CONFIG_MAC80211_MESH=y
-1
arch/mips/configs/malta_qemu_32r6_defconfig
··· 74 74 CONFIG_NET_CLS_RSVP6=m 75 75 CONFIG_NET_CLS_ACT=y 76 76 CONFIG_NET_ACT_POLICE=y 77 - CONFIG_NET_CLS_IND=y 78 77 # CONFIG_WIRELESS is not set 79 78 CONFIG_DEVTMPFS=y 80 79 CONFIG_BLK_DEV_LOOP=y
-1
arch/mips/configs/maltaaprp_defconfig
··· 76 76 CONFIG_NET_CLS_RSVP6=m 77 77 CONFIG_NET_CLS_ACT=y 78 78 CONFIG_NET_ACT_POLICE=y 79 - CONFIG_NET_CLS_IND=y 80 79 # CONFIG_WIRELESS is not set 81 80 CONFIG_DEVTMPFS=y 82 81 CONFIG_BLK_DEV_LOOP=y
-1
arch/mips/configs/maltasmvp_defconfig
··· 77 77 CONFIG_NET_CLS_RSVP6=m 78 78 CONFIG_NET_CLS_ACT=y 79 79 CONFIG_NET_ACT_POLICE=y 80 - CONFIG_NET_CLS_IND=y 81 80 # CONFIG_WIRELESS is not set 82 81 CONFIG_DEVTMPFS=y 83 82 CONFIG_BLK_DEV_LOOP=y
-1
arch/mips/configs/maltasmvp_eva_defconfig
··· 78 78 CONFIG_NET_CLS_RSVP6=m 79 79 CONFIG_NET_CLS_ACT=y 80 80 CONFIG_NET_ACT_POLICE=y 81 - CONFIG_NET_CLS_IND=y 82 81 # CONFIG_WIRELESS is not set 83 82 CONFIG_DEVTMPFS=y 84 83 CONFIG_BLK_DEV_LOOP=y
-1
arch/mips/configs/maltaup_defconfig
··· 75 75 CONFIG_NET_CLS_RSVP6=m 76 76 CONFIG_NET_CLS_ACT=y 77 77 CONFIG_NET_ACT_POLICE=y 78 - CONFIG_NET_CLS_IND=y 79 78 # CONFIG_WIRELESS is not set 80 79 CONFIG_DEVTMPFS=y 81 80 CONFIG_BLK_DEV_LOOP=y
-1
arch/mips/configs/maltaup_xpa_defconfig
··· 212 212 CONFIG_NET_ACT_PEDIT=m 213 213 CONFIG_NET_ACT_SIMP=m 214 214 CONFIG_NET_ACT_SKBEDIT=m 215 - CONFIG_NET_CLS_IND=y 216 215 CONFIG_CFG80211=m 217 216 CONFIG_MAC80211=m 218 217 CONFIG_MAC80211_MESH=y
-1
arch/mips/configs/rb532_defconfig
··· 103 103 CONFIG_NET_ACT_MIRRED=m 104 104 CONFIG_NET_ACT_IPT=m 105 105 CONFIG_NET_ACT_PEDIT=m 106 - CONFIG_NET_CLS_IND=y 107 106 CONFIG_HAMRADIO=y 108 107 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 109 108 CONFIG_MTD=y
-1
arch/powerpc/configs/ppc6xx_defconfig
··· 301 301 CONFIG_NET_ACT_PEDIT=m 302 302 CONFIG_NET_ACT_SIMP=m 303 303 CONFIG_NET_ACT_SKBEDIT=m 304 - CONFIG_NET_CLS_IND=y 305 304 CONFIG_IRDA=m 306 305 CONFIG_IRLAN=m 307 306 CONFIG_IRNET=m
-1
arch/sh/configs/se7712_defconfig
··· 63 63 CONFIG_NET_CLS_TCINDEX=y 64 64 CONFIG_NET_CLS_ROUTE4=y 65 65 CONFIG_NET_CLS_FW=y 66 - CONFIG_NET_CLS_IND=y 67 66 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 68 67 CONFIG_MTD=y 69 68 CONFIG_MTD_BLOCK=y
-1
arch/sh/configs/se7721_defconfig
··· 62 62 CONFIG_NET_CLS_TCINDEX=y 63 63 CONFIG_NET_CLS_ROUTE4=y 64 64 CONFIG_NET_CLS_FW=y 65 - CONFIG_NET_CLS_IND=y 66 65 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 67 66 CONFIG_MTD=y 68 67 CONFIG_MTD_BLOCK=y
-1
arch/sh/configs/titan_defconfig
··· 142 142 CONFIG_NET_ACT_MIRRED=m 143 143 CONFIG_NET_ACT_IPT=m 144 144 CONFIG_NET_ACT_PEDIT=m 145 - CONFIG_NET_CLS_IND=y 146 145 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 147 146 CONFIG_FW_LOADER=m 148 147 CONFIG_CONNECTOR=m
+1 -4
include/net/pkt_cls.h
··· 7 7 #include <net/sch_generic.h> 8 8 #include <net/act_api.h> 9 9 #include <net/flow_offload.h> 10 + #include <net/net_namespace.h> 10 11 11 12 /* TC action not accessible from user space */ 12 13 #define TC_ACT_REINSERT (TC_ACT_VALUE_MAX + 1) ··· 577 576 (ptr <= (ptr + len))); 578 577 } 579 578 580 - #ifdef CONFIG_NET_CLS_IND 581 - #include <net/net_namespace.h> 582 - 583 579 static inline int 584 580 tcf_change_indev(struct net *net, struct nlattr *indev_tlv, 585 581 struct netlink_ext_ack *extack) ··· 603 605 return false; 604 606 return ifindex == skb->skb_iif; 605 607 } 606 - #endif /* CONFIG_NET_CLS_IND */ 607 608 608 609 int tc_setup_flow_action(struct flow_action *flow_action, 609 610 const struct tcf_exts *exts);
+1 -1
include/uapi/linux/pkt_cls.h
··· 295 295 TCA_FW_UNSPEC, 296 296 TCA_FW_CLASSID, 297 297 TCA_FW_POLICE, 298 - TCA_FW_INDEV, /* used by CONFIG_NET_CLS_IND */ 298 + TCA_FW_INDEV, 299 299 TCA_FW_ACT, /* used by CONFIG_NET_CLS_ACT */ 300 300 TCA_FW_MASK, 301 301 __TCA_FW_MAX
-8
net/sched/Kconfig
··· 941 941 tristate "Support to encoding decoding skb tcindex on IFE action" 942 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 944 endif # NET_SCHED 953 945 954 946 config NET_SCH_FIFO
+1 -2
net/sched/cls_flower.c
··· 1010 1010 { 1011 1011 __be16 ethertype; 1012 1012 int ret = 0; 1013 - #ifdef CONFIG_NET_CLS_IND 1013 + 1014 1014 if (tb[TCA_FLOWER_INDEV]) { 1015 1015 int err = tcf_change_indev(net, tb[TCA_FLOWER_INDEV], extack); 1016 1016 if (err < 0) ··· 1018 1018 key->indev_ifindex = err; 1019 1019 mask->indev_ifindex = 0xffffffff; 1020 1020 } 1021 - #endif 1022 1021 1023 1022 fl_set_key_val(tb, key->eth.dst, TCA_FLOWER_KEY_ETH_DST, 1024 1023 mask->eth.dst, TCA_FLOWER_KEY_ETH_DST_MASK,
-13
net/sched/cls_fw.c
··· 8 8 * Karlis Peisenieks <karlis@mt.lv> : 990415 : fw_walk off by one 9 9 * Karlis Peisenieks <karlis@mt.lv> : 990415 : fw_delete killed all the filter (and kernel). 10 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 13 #include <linux/module.h> ··· 34 37 struct fw_filter __rcu *next; 35 38 u32 id; 36 39 struct tcf_result res; 37 - #ifdef CONFIG_NET_CLS_IND 38 40 int ifindex; 39 - #endif /* CONFIG_NET_CLS_IND */ 40 41 struct tcf_exts exts; 41 42 struct tcf_proto *tp; 42 43 struct rcu_work rwork; ··· 62 67 f = rcu_dereference_bh(f->next)) { 63 68 if (f->id == id) { 64 69 *res = f->res; 65 - #ifdef CONFIG_NET_CLS_IND 66 70 if (!tcf_match_indev(skb, f->ifindex)) 67 71 continue; 68 - #endif /* CONFIG_NET_CLS_IND */ 69 72 r = tcf_exts_exec(skb, &f->exts, res); 70 73 if (r < 0) 71 74 continue; ··· 215 222 tcf_bind_filter(tp, &f->res, base); 216 223 } 217 224 218 - #ifdef CONFIG_NET_CLS_IND 219 225 if (tb[TCA_FW_INDEV]) { 220 226 int ret; 221 227 ret = tcf_change_indev(net, tb[TCA_FW_INDEV], extack); ··· 222 230 return ret; 223 231 f->ifindex = ret; 224 232 } 225 - #endif /* CONFIG_NET_CLS_IND */ 226 233 227 234 err = -EINVAL; 228 235 if (tb[TCA_FW_MASK]) { ··· 267 276 268 277 fnew->id = f->id; 269 278 fnew->res = f->res; 270 - #ifdef CONFIG_NET_CLS_IND 271 279 fnew->ifindex = f->ifindex; 272 - #endif /* CONFIG_NET_CLS_IND */ 273 280 fnew->tp = f->tp; 274 281 275 282 err = tcf_exts_init(&fnew->exts, net, TCA_FW_ACT, ··· 394 405 if (f->res.classid && 395 406 nla_put_u32(skb, TCA_FW_CLASSID, f->res.classid)) 396 407 goto nla_put_failure; 397 - #ifdef CONFIG_NET_CLS_IND 398 408 if (f->ifindex) { 399 409 struct net_device *dev; 400 410 dev = __dev_get_by_index(net, f->ifindex); 401 411 if (dev && nla_put_string(skb, TCA_FW_INDEV, dev->name)) 402 412 goto nla_put_failure; 403 413 } 404 - #endif /* CONFIG_NET_CLS_IND */ 405 414 if (head->mask != 0xFFFFFFFF && 406 415 nla_put_u32(skb, TCA_FW_MASK, head->mask)) 407 416 goto nla_put_failure;
-15
net/sched/cls_u32.c
··· 20 20 * pure RSVP doesn't need such a general approach and can use 21 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 23 * nfmark match added by Catalin(ux aka Dino) BOIE <catab at umbrella.ro> 27 24 */ 28 25 ··· 45 48 u32 handle; 46 49 struct tc_u_hnode __rcu *ht_up; 47 50 struct tcf_exts exts; 48 - #ifdef CONFIG_NET_CLS_IND 49 51 int ifindex; 50 - #endif 51 52 u8 fshift; 52 53 struct tcf_result res; 53 54 struct tc_u_hnode __rcu *ht_down; ··· 171 176 if (n->sel.flags & TC_U32_TERMINAL) { 172 177 173 178 *res = n->res; 174 - #ifdef CONFIG_NET_CLS_IND 175 179 if (!tcf_match_indev(skb, n->ifindex)) { 176 180 n = rcu_dereference_bh(n->next); 177 181 goto next_knode; 178 182 } 179 - #endif 180 183 #ifdef CONFIG_CLS_U32_PERF 181 184 __this_cpu_inc(n->pf->rhit); 182 185 #endif ··· 754 761 tcf_bind_filter(tp, &n->res, base); 755 762 } 756 763 757 - #ifdef CONFIG_NET_CLS_IND 758 764 if (tb[TCA_U32_INDEV]) { 759 765 int ret; 760 766 ret = tcf_change_indev(net, tb[TCA_U32_INDEV], extack); ··· 761 769 return -EINVAL; 762 770 n->ifindex = ret; 763 771 } 764 - #endif 765 772 return 0; 766 773 } 767 774 ··· 808 817 new->handle = n->handle; 809 818 RCU_INIT_POINTER(new->ht_up, n->ht_up); 810 819 811 - #ifdef CONFIG_NET_CLS_IND 812 820 new->ifindex = n->ifindex; 813 - #endif 814 821 new->fshift = n->fshift; 815 822 new->res = n->res; 816 823 new->flags = n->flags; ··· 1340 1351 if (tcf_exts_dump(skb, &n->exts) < 0) 1341 1352 goto nla_put_failure; 1342 1353 1343 - #ifdef CONFIG_NET_CLS_IND 1344 1354 if (n->ifindex) { 1345 1355 struct net_device *dev; 1346 1356 dev = __dev_get_by_index(net, n->ifindex); 1347 1357 if (dev && nla_put_string(skb, TCA_U32_INDEV, dev->name)) 1348 1358 goto nla_put_failure; 1349 1359 } 1350 - #endif 1351 1360 #ifdef CONFIG_CLS_U32_PERF 1352 1361 gpf = kzalloc(sizeof(struct tc_u32_pcnt) + 1353 1362 n->sel.nkeys * sizeof(u64), ··· 1409 1422 #ifdef CONFIG_CLS_U32_PERF 1410 1423 pr_info(" Performance counters on\n"); 1411 1424 #endif 1412 - #ifdef CONFIG_NET_CLS_IND 1413 1425 pr_info(" input device check on\n"); 1414 - #endif 1415 1426 #ifdef CONFIG_NET_CLS_ACT 1416 1427 pr_info(" Actions configured\n"); 1417 1428 #endif
+1 -1
tools/include/uapi/linux/pkt_cls.h
··· 257 257 TCA_FW_UNSPEC, 258 258 TCA_FW_CLASSID, 259 259 TCA_FW_POLICE, 260 - TCA_FW_INDEV, /* used by CONFIG_NET_CLS_IND */ 260 + TCA_FW_INDEV, 261 261 TCA_FW_ACT, /* used by CONFIG_NET_CLS_ACT */ 262 262 TCA_FW_MASK, 263 263 __TCA_FW_MAX
-1
tools/testing/selftests/tc-testing/config
··· 45 45 CONFIG_NET_IFE_SKBMARK=m 46 46 CONFIG_NET_IFE_SKBPRIO=m 47 47 CONFIG_NET_IFE_SKBTCINDEX=m 48 - CONFIG_NET_CLS_IND=y 49 48 CONFIG_NET_SCH_FIFO=y