From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jamal Hadi Salim Subject: Re: [PATCH net 1/1] net sched actions: fix dumping which requires several messages to user space Date: Tue, 27 Mar 2018 07:26:16 -0400 Message-ID: <19661df7-bb9e-0157-0327-dfeeaa2e6fdb@mojatatu.com> References: <1522090712-9154-1-git-send-email-cdillaba@mojatatu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, kernel@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us To: Craig Dillabaugh , davem@davemloft.net Return-path: Received: from mail-it0-f46.google.com ([209.85.214.46]:40170 "EHLO mail-it0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750907AbeC0L0T (ORCPT ); Tue, 27 Mar 2018 07:26:19 -0400 Received: by mail-it0-f46.google.com with SMTP id y20-v6so14815559itc.5 for ; Tue, 27 Mar 2018 04:26:18 -0700 (PDT) In-Reply-To: <1522090712-9154-1-git-send-email-cdillaba@mojatatu.com> Content-Language: en-GB Sender: netdev-owner@vger.kernel.org List-ID: On 18-03-26 02:58 PM, Craig Dillabaugh wrote: > Fixes a bug in the tcf_dump_walker function that can cause some actions > to not be reported when dumping a large number of actions. This issue > became more aggrevated when cookies feature was added. In particular > this issue is manifest when large cookie values are assigned to the > actions and when enough actions are created that the resulting table > must be dumped in multiple batches. > > The number of actions returned in each batch is limited by the total > number of actions and the memory buffer size. With small cookies > the numeric limit is reached before the buffer size limit, which avoids > the code path triggering this bug. When large cookies are used buffer > fills before the numeric limit, and the erroneous code path is hit. > > For example after creating 32 csum actions with the cookie > aaaabbbbccccdddd > > $ tc actions ls action csum > total acts 26 > > action order 0: csum (tcp) action continue > index 1 ref 1 bind 0 > cookie aaaabbbbccccdddd > > ..... > > action order 25: csum (tcp) action continue > index 26 ref 1 bind 0 > cookie aaaabbbbccccdddd > total acts 6 > > action order 0: csum (tcp) action continue > index 28 ref 1 bind 0 > cookie aaaabbbbccccdddd > > ...... > > action order 5: csum (tcp) action continue > index 32 ref 1 bind 0 > cookie aaaabbbbccccdddd > > Note that the action with index 27 is omitted from the report. > > Fixes: 4b3550ef530c ("[NET_SCHED]: Use nla_nest_start/nla_nest_end")" > Signed-off-by: Craig Dillabaugh Good catch. Acked-by: Jamal Hadi Salim cheers, jamal