Permalink
Browse files

act: remove rtnl_act_alloc_cache()

It is complicated to cache tc actions, they are different
from tc qdisc's and filters by design. So, it is simple
if we just don't cache them.

This patch only removes the tc action cache allocation API.
We still need to bypass the libnl cache layer from scratch,
but that would not break ABI any more, therefore we can do
it later.

Cc: Thomas Graf <tgraf@suug.ch>
Cc: Thomas Haller <thaller@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
  • Loading branch information...
1 parent 8dabf9f commit aa8877d5c1ef6bd7555ae5b187dc4b695dabc9f2 @congwang congwang committed with Jan 15, 2014
Showing with 0 additions and 46 deletions.
  1. +0 −4 include/netlink/route/action.h
  2. +0 −42 lib/route/act.c
View
4 include/netlink/route/action.h
@@ -23,10 +23,6 @@ extern "C" {
extern struct rtnl_act *rtnl_act_alloc(void);
extern void rtnl_act_put(struct rtnl_act *);
-
-extern int rtnl_act_alloc_cache(struct nl_sock *, int, uint32_t,
- struct nl_cache **);
-
extern int rtnl_act_build_add_request(struct rtnl_act *, int,
struct nl_msg **);
extern int rtnl_act_add(struct nl_sock *, struct rtnl_act *, int);
View
42 lib/route/act.c
@@ -363,48 +363,6 @@ int rtnl_act_delete(struct nl_sock *sk, struct rtnl_act *act, int flags)
/** @} */
-/**
- * @name Cache Related Functions
- * @{
- */
-
-/**
- * Allocate a cache and fill it with all configured actions
- * @arg sk Netlink socket
- * @arg ifindex Interface index of the network device
- * @arg parent Parent qdisc/traffic class class
- * @arg result Pointer to store the created cache
- *
- * Allocates a new action cache and fills it with a list of all
- * configured action attached to the specified parent qdisc/traffic
- * class on the specified network device. Release the cache with
- * nl_cache_free().
- *
- * @return 0 on success or a negative error code.
- */
-int rtnl_act_alloc_cache(struct nl_sock *sk, int ifindex, uint32_t parent,
- struct nl_cache **result)
-{
- struct nl_cache * cache;
- int err;
-
- if (!(cache = nl_cache_alloc(&rtnl_act_ops)))
- return -NLE_NOMEM;
-
- cache->c_iarg1 = ifindex;
- cache->c_iarg2 = parent;
-
- if (sk && (err = nl_cache_refill(sk, cache)) < 0) {
- nl_cache_free(cache);
- return err;
- }
-
- *result = cache;
- return 0;
-}
-
-/** @} */
-
static void act_dump_line(struct rtnl_tc *tc, struct nl_dump_params *p)
{
}

0 comments on commit aa8877d

Please sign in to comment.