net: sched: remove tcf block API
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 9 Jul 2019 20:55:47 +0000 (22:55 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 9 Jul 2019 21:38:50 +0000 (14:38 -0700)
Unused, now replaced by flow block API.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/pkt_cls.h
net/sched/cls_api.c

index 9cf606b88526340beaac1ceebef660868e8657f5..17c388090c3cce8cc6ce9f1e17c446004d3bf703 100644 (file)
@@ -66,22 +66,6 @@ static inline struct Qdisc *tcf_block_q(struct tcf_block *block)
        return block->q;
 }
 
-void *tcf_block_cb_priv(struct tcf_block_cb *block_cb);
-struct tcf_block_cb *tcf_block_cb_lookup(struct tcf_block *block,
-                                        tc_setup_cb_t *cb, void *cb_ident);
-void tcf_block_cb_incref(struct tcf_block_cb *block_cb);
-unsigned int tcf_block_cb_decref(struct tcf_block_cb *block_cb);
-struct tcf_block_cb *__tcf_block_cb_register(struct tcf_block *block,
-                                            tc_setup_cb_t *cb, void *cb_ident,
-                                            void *cb_priv,
-                                            struct netlink_ext_ack *extack);
-int tcf_block_cb_register(struct tcf_block *block,
-                         tc_setup_cb_t *cb, void *cb_ident,
-                         void *cb_priv, struct netlink_ext_ack *extack);
-void __tcf_block_cb_unregister(struct tcf_block *block,
-                              struct tcf_block_cb *block_cb);
-void tcf_block_cb_unregister(struct tcf_block *block,
-                            tc_setup_cb_t *cb, void *cb_ident);
 int __tc_indr_block_cb_register(struct net_device *dev, void *cb_priv,
                                tc_indr_block_bind_cb_t *cb, void *cb_ident);
 int tc_indr_block_cb_register(struct net_device *dev, void *cb_priv,
@@ -144,59 +128,6 @@ void tc_setup_cb_block_unregister(struct tcf_block *block, tc_setup_cb_t *cb,
 {
 }
 
-static inline
-void *tcf_block_cb_priv(struct tcf_block_cb *block_cb)
-{
-       return NULL;
-}
-
-static inline
-struct tcf_block_cb *tcf_block_cb_lookup(struct tcf_block *block,
-                                        tc_setup_cb_t *cb, void *cb_ident)
-{
-       return NULL;
-}
-
-static inline
-void tcf_block_cb_incref(struct tcf_block_cb *block_cb)
-{
-}
-
-static inline
-unsigned int tcf_block_cb_decref(struct tcf_block_cb *block_cb)
-{
-       return 0;
-}
-
-static inline
-struct tcf_block_cb *__tcf_block_cb_register(struct tcf_block *block,
-                                            tc_setup_cb_t *cb, void *cb_ident,
-                                            void *cb_priv,
-                                            struct netlink_ext_ack *extack)
-{
-       return NULL;
-}
-
-static inline
-int tcf_block_cb_register(struct tcf_block *block,
-                         tc_setup_cb_t *cb, void *cb_ident,
-                         void *cb_priv, struct netlink_ext_ack *extack)
-{
-       return 0;
-}
-
-static inline
-void __tcf_block_cb_unregister(struct tcf_block *block,
-                              struct tcf_block_cb *block_cb)
-{
-}
-
-static inline
-void tcf_block_cb_unregister(struct tcf_block *block,
-                            tc_setup_cb_t *cb, void *cb_ident)
-{
-}
-
 static inline
 int __tc_indr_block_cb_register(struct net_device *dev, void *cb_priv,
                                tc_indr_block_bind_cb_t *cb, void *cb_ident)
index 3589ccff5570277ba4a51bad94f707390d25a0d6..638c1bc1ea1b04b3eded868a61baeece574aea95 100644 (file)
@@ -1513,43 +1513,6 @@ void tcf_block_put(struct tcf_block *block)
 
 EXPORT_SYMBOL(tcf_block_put);
 
-struct tcf_block_cb {
-       struct list_head list;
-       tc_setup_cb_t *cb;
-       void *cb_ident;
-       void *cb_priv;
-       unsigned int refcnt;
-};
-
-void *tcf_block_cb_priv(struct tcf_block_cb *block_cb)
-{
-       return block_cb->cb_priv;
-}
-EXPORT_SYMBOL(tcf_block_cb_priv);
-
-struct tcf_block_cb *tcf_block_cb_lookup(struct tcf_block *block,
-                                        tc_setup_cb_t *cb, void *cb_ident)
-{      struct tcf_block_cb *block_cb;
-
-       list_for_each_entry(block_cb, &block->cb_list, list)
-               if (block_cb->cb == cb && block_cb->cb_ident == cb_ident)
-                       return block_cb;
-       return NULL;
-}
-EXPORT_SYMBOL(tcf_block_cb_lookup);
-
-void tcf_block_cb_incref(struct tcf_block_cb *block_cb)
-{
-       block_cb->refcnt++;
-}
-EXPORT_SYMBOL(tcf_block_cb_incref);
-
-unsigned int tcf_block_cb_decref(struct tcf_block_cb *block_cb)
-{
-       return --block_cb->refcnt;
-}
-EXPORT_SYMBOL(tcf_block_cb_decref);
-
 static int
 tcf_block_playback_offloads(struct tcf_block *block, tc_setup_cb_t *cb,
                            void *cb_priv, bool add, bool offload_in_use,
@@ -1591,67 +1554,6 @@ err_playback_remove:
        return err;
 }
 
-struct tcf_block_cb *__tcf_block_cb_register(struct tcf_block *block,
-                                            tc_setup_cb_t *cb, void *cb_ident,
-                                            void *cb_priv,
-                                            struct netlink_ext_ack *extack)
-{
-       struct tcf_block_cb *block_cb;
-       int err;
-
-       /* Replay any already present rules */
-       err = tcf_block_playback_offloads(block, cb, cb_priv, true,
-                                         tcf_block_offload_in_use(block),
-                                         extack);
-       if (err)
-               return ERR_PTR(err);
-
-       block_cb = kzalloc(sizeof(*block_cb), GFP_KERNEL);
-       if (!block_cb)
-               return ERR_PTR(-ENOMEM);
-       block_cb->cb = cb;
-       block_cb->cb_ident = cb_ident;
-       block_cb->cb_priv = cb_priv;
-       list_add(&block_cb->list, &block->cb_list);
-       return block_cb;
-}
-EXPORT_SYMBOL(__tcf_block_cb_register);
-
-int tcf_block_cb_register(struct tcf_block *block,
-                         tc_setup_cb_t *cb, void *cb_ident,
-                         void *cb_priv, struct netlink_ext_ack *extack)
-{
-       struct tcf_block_cb *block_cb;
-
-       block_cb = __tcf_block_cb_register(block, cb, cb_ident, cb_priv,
-                                          extack);
-       return PTR_ERR_OR_ZERO(block_cb);
-}
-EXPORT_SYMBOL(tcf_block_cb_register);
-
-void __tcf_block_cb_unregister(struct tcf_block *block,
-                              struct tcf_block_cb *block_cb)
-{
-       tcf_block_playback_offloads(block, block_cb->cb, block_cb->cb_priv,
-                                   false, tcf_block_offload_in_use(block),
-                                   NULL);
-       list_del(&block_cb->list);
-       kfree(block_cb);
-}
-EXPORT_SYMBOL(__tcf_block_cb_unregister);
-
-void tcf_block_cb_unregister(struct tcf_block *block,
-                            tc_setup_cb_t *cb, void *cb_ident)
-{
-       struct tcf_block_cb *block_cb;
-
-       block_cb = tcf_block_cb_lookup(block, cb, cb_ident);
-       if (!block_cb)
-               return;
-       __tcf_block_cb_unregister(block, block_cb);
-}
-EXPORT_SYMBOL(tcf_block_cb_unregister);
-
 static int tcf_block_bind(struct tcf_block *block,
                          struct flow_block_offload *bo)
 {