Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3B54C43381 for ; Thu, 14 Feb 2019 13:49:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6D1F7222B6 for ; Thu, 14 Feb 2019 13:49:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391546AbfBNNtr (ORCPT ); Thu, 14 Feb 2019 08:49:47 -0500 Received: from mx2.suse.de ([195.135.220.15]:44840 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387759AbfBNNtr (ORCPT ); Thu, 14 Feb 2019 08:49:47 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 1708DAD25; Thu, 14 Feb 2019 13:49:46 +0000 (UTC) Received: by unicorn.suse.cz (Postfix, from userid 1000) id 7519EE0139; Thu, 14 Feb 2019 14:49:45 +0100 (CET) Date: Thu, 14 Feb 2019 14:49:45 +0100 From: Michal Kubecek To: netdev@vger.kernel.org Cc: David Ahern , Eric Dumazet , Stephen Hemminger , Eric Dumazet , Hangbin Liu , Phil Sutter Subject: Re: [PATCH iproute2] lib/libnetlink: ensure a minimum of 32KB for the buffer used in rtnl_recvmsg() Message-ID: <20190214134945.GJ25518@unicorn.suse.cz> References: <20190213015841.140383-1-edumazet@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Feb 12, 2019 at 07:04:17PM -0700, David Ahern wrote: > > Do we know of any single message sizes > 32k? 2d34851cd341 cites > increasing VF's but at some point there is a limit. If not, the whole > PEEK thing should go away and we just malloc 32k (or 64k) buffers for > each recvmsg. IFLA_VF_LIST is by far the biggest thing I have seen so far. I don't remember exact numbers but the issue with 32KB buffer (for the whole RTM_NELINK message) was encountered by some of our customers with NICs having 120 or 128 VFs. There is a bigger issue with IFLA_VFINFO_LIST, though, as it's an attribute so that netlink limits its size to 64 KB. IIRC with current size of IFLA_VF_INFO this would be reached with 270-280 VFs (I'm sure the number was higer than 256 but not too much higher.) This would mean unless we let something else grow too much, the whole message shouldn't get much bigger than 64 KB. And if we can find some other solution (e.g. passing VF information in separate messages if client declares support), even 32 KB would be more than enough. Michal Kubecek