From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [patch iproute2 v8 1/2] lib/libnetlink: Add functions rtnl_talk_msg and rtnl_talk_iov Date: Thu, 11 Jan 2018 17:06:03 -0700 Message-ID: References: <20180110032742.8127-1-chrism@mellanox.com> <20180110032742.8127-2-chrism@mellanox.com> <20180110201245.GR32305@orbyte.nwl.cc> <20180111150853.GT32305@orbyte.nwl.cc> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit To: Phil Sutter , Chris Mi , netdev@vger.kernel.org, gerlitz.or@gmail.com, stephen@networkplumber.org, marcelo.leitner@gmail.com Return-path: Received: from mail-pf0-f195.google.com ([209.85.192.195]:36911 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932068AbeALAGI (ORCPT ); Thu, 11 Jan 2018 19:06:08 -0500 Received: by mail-pf0-f195.google.com with SMTP id p1so3010889pfh.4 for ; Thu, 11 Jan 2018 16:06:08 -0800 (PST) In-Reply-To: <20180111150853.GT32305@orbyte.nwl.cc> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 1/11/18 8:08 AM, Phil Sutter wrote: > On Wed, Jan 10, 2018 at 09:12:45PM +0100, Phil Sutter wrote: >> On Wed, Jan 10, 2018 at 12:20:36PM -0700, David Ahern wrote: >> [...] >>> 2. I am using a batch file with drop filters: >>> >>> filter add dev eth2 ingress protocol ip pref 273 flower dst_ip >>> 192.168.253.0/16 action drop >>> >>> and for each command tc is trying to dlopen m_drop.so: >>> >>> open("/usr/lib/tc//m_drop.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such >>> file or directory) >> >> [...] >> >>> Can you look at a follow on patch (not part of this set) to cache status >>> of dlopen attempts? >> >> IMHO the logic used in get_action_kind() for gact is the culprit here: >> After trying to dlopen m_drop.so, it dlopens m_gact.so although it is >> present already. (Unless I missed something.) > > Not quite, m_gact.c is statically compiled in and there is logic around > dlopen(NULL, ...) to prevent calling it twice. > >> I guess the better (and easier) fix would be to create some more struct >> action_util instances in m_gact.c for the primitives it supports so that >> the lookup in action_list succeeds for consecutive uses. Note that >> parse_gact() even supports this already. > > Sadly, this doesn't fly: If a lookup for action 'drop' is successful, > that value is set as TCA_ACT_KIND and the kernel doesn't know about it. > > I came up with an alternative solution, what do you think about attached > patch? Looks ok to me and removes the repeated open overhead. Send it formally and cc Jiri and Jamal. Thanks,