From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [patch iproute2 v6 0/3] tc: Add -bs option to batch mode Date: Mon, 8 Jan 2018 07:40:14 -0800 Message-ID: <20180108074014.458333d1@xeon-e3> References: <20180104073454.11867-1-chrism@mellanox.com> <20180105172523.GD14358@orbyte.nwl.cc> <0cbfcbf5-0b54-f810-1891-b0d34fe97c6d@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: David Ahern , Phil Sutter , "marcelo.leitner@gmail.com" , "netdev@vger.kernel.org" , "gerlitz.or@gmail.com" To: Chris Mi Return-path: Received: from mail-pg0-f66.google.com ([74.125.83.66]:41300 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933818AbeAHPkQ (ORCPT ); Mon, 8 Jan 2018 10:40:16 -0500 Received: by mail-pg0-f66.google.com with SMTP id m17so3400667pgd.8 for ; Mon, 08 Jan 2018 07:40:16 -0800 (PST) In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Mon, 8 Jan 2018 08:00:00 +0000 Chris Mi wrote: > > >> I wonder whether specifying the batch size is necessary at all. > > >> Couldn't batch mode just collect messages until either EOF or an > > >> incompatible command is encountered which then triggers a commit to > > >> kernel? This might simplify code quite a bit. > > > That's a good suggestion. > > > > Thanks for your time on this, Chris. > After testing, I find that the message passed to kernel should not be too big. > If it is bigger than about 64K, sendmsg returns -1, errno is 90 (EMSGSIZE). > That is about 400 commands. So how about set batch size to 128 which is big enough? Use sendmmsg?