From patchwork Thu Dec 3 23:09:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Squyres X-Patchwork-Id: 7764211 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0B779BEEE1 for ; Thu, 3 Dec 2015 23:19:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4BC8320489 for ; Thu, 3 Dec 2015 23:19:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 52E7720221 for ; Thu, 3 Dec 2015 23:19:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753345AbbLCXTH (ORCPT ); Thu, 3 Dec 2015 18:19:07 -0500 Received: from rcdn-iport-5.cisco.com ([173.37.86.76]:4494 "EHLO rcdn-iport-5.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753293AbbLCXTH (ORCPT ); Thu, 3 Dec 2015 18:19:07 -0500 X-Greylist: delayed 561 seconds by postgrey-1.27 at vger.kernel.org; Thu, 03 Dec 2015 18:19:06 EST DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=965; q=dns/txt; s=iport; t=1449184746; x=1450394346; h=from:to:cc:subject:date:message-id; bh=qMwbqn5xJ9gpxs2mY8YspdabkrakM7oi96C4Ki3SdmA=; b=bq5Co0+uBXsL7AUb4tN5oCKTz56X2ObSa26KgLGdoNIxoeSJLGDJfLhT KauH/2C0oUgEkVutWUMJWvZ4e0l0WddUXsBgFDgxFkzD04APooprOWMEy vgkcaecO7prBwbK8H8J9i5vpnZx1WlyrpTg1dxICwdvADFVkQSFOQd6LH o=; X-IronPort-AV: E=Sophos;i="5.20,378,1444694400"; d="scan'208";a="52456257" Received: from rcdn-core-10.cisco.com ([173.37.93.146]) by rcdn-iport-5.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Dec 2015 23:09:43 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by rcdn-core-10.cisco.com (8.14.5/8.14.5) with ESMTP id tB3N9g9e002518; Thu, 3 Dec 2015 23:09:43 GMT Received: by cisco.com (Postfix, from userid 182726) id D03603FAAD58; Thu, 3 Dec 2015 15:09:42 -0800 (PST) From: Jeff Squyres To: linux-rdma@vger.kernel.org Cc: Jeff Squyres , Xuyang Wang Subject: [PATCH libibverbs] init.c: increase sysfs read buffer size to 16 Date: Thu, 3 Dec 2015 15:09:41 -0800 Message-Id: <1449184181-25676-1-git-send-email-jsquyres@cisco.com> X-Mailer: git-send-email 2.4.3 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-14.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY, USER_IN_DEF_DKIM_WL autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The default value of 8 is too small to read /sys/class/infiniband/usnic_x/node_type, which contains "6: usNIC UDP". Per a7a73a8c1b39362f1701256bc772d82847832f9c, the too-small buffer causes a stderr warning to be emitted from ibv_devinfo when reading usNIC devices. This commit therefore increases the buffer size to 16, which is long enough to read the usNIC node_type value. Signed-off-by: Jeff Squyres Signed-off-by: Xuyang Wang Reviewed-by: Haggai Eran --- src/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/init.c b/src/init.c index dbdd795..ef78871 100644 --- a/src/init.c +++ b/src/init.c @@ -351,7 +351,7 @@ static struct ibv_device *try_driver(struct ibv_driver *driver, { struct verbs_device *vdev; struct ibv_device *dev; - char value[8]; + char value[16]; if (driver->init_func) { dev = driver->init_func(sysfs_dev->sysfs_path, sysfs_dev->abi_ver);