From patchwork Fri Sep 1 16:39:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kubecek X-Patchwork-Id: 808814 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3xkQ2P4mk0z9t2x for ; Sat, 2 Sep 2017 02:39:57 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752162AbdIAQjJ (ORCPT ); Fri, 1 Sep 2017 12:39:09 -0400 Received: from mx2.suse.de ([195.135.220.15]:38395 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751998AbdIAQjI (ORCPT ); Fri, 1 Sep 2017 12:39:08 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id F14F1AE7C; Fri, 1 Sep 2017 16:39:06 +0000 (UTC) Received: by unicorn.suse.cz (Postfix, from userid 1000) id 9995FA0F21; Fri, 1 Sep 2017 18:39:06 +0200 (CEST) Message-Id: From: Michal Kubecek Subject: [PATCH iproute2 0/2] fix "ip link show dev ..." for NICs with many VFs To: Stephen Hemminger Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Fri, 1 Sep 2017 18:39:06 +0200 (CEST) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Two of our customers recently encountered problems with processing of large messages produced by kernel in response to "ip link show" for NICs with many (120-128) virtual functions. While some of them have been already addressed in recent versions of iproute2, some still persist. Patch 1 adds check to handle the case when a message fits into the buffer in rtnl_talk() but not into the buffer in iplink_get(). Patch 2 increases the buffer size in iplink_get() to suffice even for NICs with 128 VFs. Note: after applying patch 2, patch 1 seems useless as both buffers have the same size so that the check cannot actually trigger. However, as we cannot guarantee they will always stay the same, I believe the check should still be added. Michal Kubecek (2): iplink: check for message truncation in iplink_get() iplink: double the buffer size also in iplink_get() ip/iplink.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)