> -----Original Message----- > From: David Ahern [mailto:dsah...@gmail.com] > Sent: Saturday, January 6, 2018 1:51 AM > To: Chris Mi <chr...@mellanox.com>; netdev@vger.kernel.org > Cc: gerlitz...@gmail.com; step...@networkplumber.org; > marcelo.leit...@gmail.com > Subject: Re: [patch iproute2 v6 1/3] lib/libnetlink: Add a function > rtnl_talk_msg > > On 1/4/18 12:34 AM, Chris Mi wrote: > > rtnl_talk can only send a single message to kernel. Add a new function > > rtnl_talk_msg that can send multiple messages to kernel. > > > > Signed-off-by: Chris Mi <chr...@mellanox.com> > > --- > > include/libnetlink.h | 3 +++ > > lib/libnetlink.c | 66 ++++++++++++++++++++++++++++++++++++++---- > ---------- > > 2 files changed, 51 insertions(+), 18 deletions(-) > > > > I think you should add an argument to rtnl_talk_msg to return the number of > messages processed. That can be used to refine which line failed. As batch > size increases the current design puts the burden on the user to scan a lot of > lines to find the one that fails: > > tc -b tc.batch -bs 50 > RTNETLINK answers: File exists > We have an error talking to the kernel, -1 Command failed tc.batch:2-51 > > We should be able to tell them exactly which line failed. Done. > > Also, it would be better to call this rtnl_talk_iov, take an iov as an > argument > and have a common rtnl_talk_msg for existing code and this new one. > > As it stands you are having to add: > struct sockaddr_nl nladdr = { .nl_family = AF_NETLINK }; > > to tc functions when it really only needs to know about iov's. Done.