[PATCH] act: remove rtnl_act_alloc_cache()

Cong Wang xiyou.wangcong at gmail.com
Tue Jan 14 20:37:42 EST 2014


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 at suug.ch>
Cc: Thomas Haller <thaller at redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong at gmail.com>
---
 include/netlink/route/action.h |  4 ----
 lib/route/act.c                | 42 ------------------------------------------
 2 files changed, 46 deletions(-)

diff --git a/include/netlink/route/action.h b/include/netlink/route/action.h
index c80f6cf..e904432 100644
--- a/include/netlink/route/action.h
+++ b/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);
diff --git a/lib/route/act.c b/lib/route/act.c
index ea43210..2bb222b 100644
--- a/lib/route/act.c
+++ b/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)
 {
 }
-- 
1.8.3.1




More information about the libnl mailing list