diff options
author | Thomas Graf <tgraf@suug.ch> | 2015-07-25 10:51:47 +0200 |
---|---|---|
committer | Thomas Graf <tgraf@suug.ch> | 2015-07-25 10:51:47 +0200 |
commit | 2027a634a72b8cb0a6e0e863c2a55b123e4cd213 (patch) | |
tree | b0a5a52e15d14d867555ed69f5c381f227dacb16 | |
parent | 30946f2d783dc0ef0aeef3b5bc91f581fcea2fc4 (diff) |
netlink: Only disable TC stats if QoS is not available in kernel
Up to now, the entire Netlink module was disable if QoS statistics were
not available. Merely disable TC stats themselves but continue using
the input module.
Reported-by: Wen Chiu <Wen.Chiu@brocade.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
-rw-r--r-- | src/in_netlink.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/in_netlink.c b/src/in_netlink.c index d71ee9a..683e05f 100644 --- a/src/in_netlink.c +++ b/src/in_netlink.c @@ -738,7 +738,7 @@ static void do_link(struct nl_object *obj, void *arg) attr_update(e, m->attrid, c_rx, c_tx, flags); } - if (!c_notc) + if (!c_notc && qdisc_cache) handle_tc(e, link); element_notify_update(e, NULL); @@ -754,7 +754,8 @@ static void netlink_read(void) goto disable; } - if ((err = nl_cache_resync(sock, qdisc_cache, NULL, NULL)) < 0) { + if (qdisc_cache && + (err = nl_cache_resync(sock, qdisc_cache, NULL, NULL)) < 0) { fprintf(stderr, "Unable to resync qdisc cache: %s\n", nl_geterror(err)); goto disable; } @@ -805,8 +806,9 @@ static int netlink_do_init(void) } if ((err = rtnl_qdisc_alloc_cache(sock, &qdisc_cache)) < 0) { - fprintf(stderr, "Unable to allocate qdisc cache: %s\n", nl_geterror(err)); - goto disable; + fprintf(stderr, "Warning: Unable to allocate qdisc cache: %s\n", nl_geterror(err)); + fprintf(stderr, "Disabling QoS statistics.\n"); + qdisc_cache = NULL; } netlink_use_bit(link_attrs, ARRAY_SIZE(link_attrs)); |